Results 1 to 1 of 1
  1. #1
    zekikez's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    25

    17.4 ABC code for outputting to Chat and Screen

    One of the things that I want to do when I first start hacking a game is outputting text to screen/chat windows.
    This allows me to easily debug any possible hacks. Since I am extremely lazy, I briefly searched the forum and found nothing on how to do any of the screen output. I did take a look into the autoaim-notify code, which was not working as expected. Since it did pushstring "Auto-aim: ON" to a function for the Player. However, it was not working so I decided to figure out why it was not working.

    In the end, I wrote my own functions to output to screen/chat. Basically, I took a look at how the code outputs to chat/screen and replicated the steps in my own function that I can call whenever I want.

    This is specifically for version 17.4 and for where I want to use it, I have it in the "client-1\com\company\assembleegameclient\game\_-1Xo.class.asam"

     
    Code:
    ; zekikez
    ; Sends text to chat window 
    ; to update look for "QName(PackageNamespace(""), "REMOVED_FROM_STAGE")" a couple lines below it after "addEventListener" there should be a getlex
    ; note: removed from stage will give a lot of results.
    ; look for something like this:
    ; getlex              QName(PackageNamespace("_-06U"), "_-nS")
    ; callproperty        QName(PackageNamespace(""), "_-0wC"), 0
    ; coerce              QName(PackageNamespace("_-3a"), "_-1cT")
    ; setlocal2
    trait method QName(PackageNamespace(""), "SendToChat")
    	method
    	refid "com.company.assembleegameclient.game:_-1Xo/SendToChat"
    	param QName(PackageNamespace(""), "String")  ; name or "" or other special strings. Search "*HELP*" for example
    	param QName(PackageNamespace(""), "String")  ; message or other special strings. Search "helpCommand" for example
    	returns QName(PackageNamespace(""), "void")
    		body
    		maxstack 5
    		localcount 5
    		initscopedepth 4
    		maxscopedepth 5
    			code
    			    ; universal way of retrieving the class that will execute the dispatch below
    				; getlex              QName(PackageNamespace("_-06U"), "_-nS")
    				; callproperty        QName(PackageNamespace(""), "_-0wC"), 0
    				; coerce              QName(PackageNamespace("_-3a"), "_-1cT")
    				; setlocal			  4
    
    				; getlocal			  4
    				; getlex              QName(PackageNamespace("_-8B"), "_-0BL")           
    				; callproperty        QName(PackageNamespace(""), "getInstance"), 1      
    				; setlocal			  5
    				; getlocal			  5     
    				; end of universal way 
    				
    				;easiest method here by using a local variable
    			    getlocal0
    				getproperty         QName(PrivateNamespace("*", null), "_-0gz") ; params object
    				; end easiest method
    				
    				getlex              QName(PackageNamespace("_-1IY"), "_-06c")     ; search '/help' and scroll down this name should be the one above "Parameter" 
    				getlocal1                                                         ; some sort of chat text event. contains username, star etc
    				getlocal2
    				callproperty        QName(PackageNamespace(""), "make"), 2
    				callpropvoid        QName(PackageNamespace(""), "dispatch"), 1
    				
    				returnvoid
    			end ; code
    		end ; body
    	end ; method
    end ; trait

     
    Code:
    ; zekikez
    ; To update take a look at the player functions on level up or exp. They should have similar style of creating a string, textbox, and then addstatustext
    ; sends string to status text
    trait method QName(PackageNamespace(""), "SendToStatusText")
    	method
    	refid "com.company.assembleegameclient.game:_-1Xo/SendToStatusText"
    	param QName(PackageNamespace(""), "String")
    	returns QName(PackageNamespace(""), "void")
    		body
    		maxstack 6
    		localcount 6
    		initscopedepth 4
    		maxscopedepth 5
    			code
    				pushstring 			"{\"key\":\"blank\",\"tokens\":{\"data\":\""
    				getlocal            1                                               ; concat the string passed to the function
    				add
    				pushstring          "\"}}"
    				add       
    				setlocal 		    4   ; set json message to 4
    				
    				getlex              QName(PackageNamespace("_-04U"), "_-0tq")      ; create string message
    				getlocal			4   ; retrieve json message
    				callproperty        QName(PackageNamespace(""), "_-1KQ"), 1         ; create string message here?
    				coerce              QName(PackageNamespace("_-04U"), "_-0tq")
    				setlocal2           ; set string message event to 2
    				
    				getlocal0
    				getproperty         QName(PackageNamespace(""), "gs_")
    				getproperty         QName(PackageNamespace(""), "map")
    				getproperty         QName(PackageNamespace(""), "player_")
    				setlocal3           ; set player object to 3
    
    				findpropstrict      QName(PackageNamespace("_-s2"), "_-1Ue")       ; init a new text object
    				getlocal3
    				pushint             65280        ;color
    				pushshort           2000         ; how long message lasts
    				constructprop       QName(PackageNamespace("_-s2"), "_-1Ue"), 3
    				coerce              QName(PackageNamespace("_-s2"), "_-1Ue")        ; cast object into text object
    				setlocal			5                                              ; store it in the 5th register
    				
    				getlocal            5
    				getlocal2																	
    				callpropvoid        QName(PackageNamespace(""), "setStringBuilder"), 1  ; add string to text object
    				
    				getlocal0
    				getproperty         QName(PackageNamespace(""), "gs_")
    				getproperty         QName(PackageNamespace(""), "map")
    				getproperty         QName(PackageNamespace(""), "mapOverlay_")
    				getlocal            5
    				callpropvoid        QName(PackageNamespace(""), "addStatusText"), 1   ; draw to screen
    				returnvoid
    			end ; code
    		end ; body
    	end ; method
    end ; trait

     
    Code:
    ; zekikez
    ; sends string to queuetext
    ; to update search for 'getproperty         QName(PackageNamespace(""), "message")' and steal the names from a function that uses a similar syntax 
    trait method QName(PackageNamespace(""), "SendToQueueText")
    	method
    	refid "com.company.assembleegameclient.game:_-1Xo/SendToQueueText"
    	param QName(PackageNamespace(""), "String")
    	returns QName(PackageNamespace(""), "void")
    		body
    		maxstack 6
    		localcount 6
    		initscopedepth 4
    		maxscopedepth 5
    			code
    				pushstring 			"{\"key\":\"blank\",\"tokens\":{\"data\":\""
    				getlocal            1                                               ; concat the string passed to the function
    				add
    				pushstring          "\"}}"
    				add       
    				setlocal 		    4   ; set json message to 4
    				
    				getlex              QName(PackageNamespace("_-04U"), "_-0tq")
    				getlocal			4   ; retrieve json message
    				callproperty        QName(PackageNamespace(""), "_-1KQ"), 1         ; create message here?
    				coerce              QName(PackageNamespace("_-04U"), "_-0tq")
    				setlocal2           ; set message event to 2
    				
    				getlocal0
    				getproperty         QName(PackageNamespace(""), "gs_")
    				getproperty         QName(PackageNamespace(""), "map")
    				getproperty         QName(PackageNamespace(""), "player_")
    				setlocal3           ; set player object to 3
    				
    				findpropstrict      QName(PackageNamespace("_-1e8"), "_-Fr")        ; init text object for notification
    				getlocal3
    				getlocal2
    				pushint				3407871                                        ; the color in integer. 0x33FFFF
    				pushshort           500                                            ; how long message lasts
    				constructprop       QName(PackageNamespace("_-1e8"), "_-Fr"), 4
    				coerce              QName(PackageNamespace("_-1e8"), "_-Fr")           
    				setlocal            5                                              ; store it in the 5th register
    			
    				getlocal0
    				getproperty         QName(PackageNamespace(""), "gs_")
    				getproperty         QName(PackageNamespace(""), "map")
    				getproperty         QName(PackageNamespace(""), "mapOverlay_")
    				getlocal            5
    				callpropvoid        QName(PackageNamespace(""), "addQueuedText"), 1  ; show up on screen
    				returnvoid
    			end ; code
    		end ; body
    	end ; method
    end ; trait


    SendToChat - goes to chat window. It takes 2 params. 1st one is who it is from. There are special parameters for the first one. "*HELP*" colors it a certain way. "*ERROR*" is another way. I forget if it is all caps. But you can easily search for *Help* to find other examples of possible 1st arguments that are special. A empty string, "", for the first param is like a system message. It comes out yellow. If you put any other text then it assumes its a player. The 2nd param is the message.

    SendToQueueText - is used when notification packets are received from the kabaam server.

    SendToStatusText - is used ? well not sure. but it is the similar/same as queuetext. I noticed it is used for exp and levelup notices.

    For both QueueText and StatusText, the first param is the message. However there are built-in messages that you can use too. Instead of using key "blank", change it to something else such as "Player.levelUp". Search "Player.levelUp" you should be able to find other pre-built texts.

    Oh and here is example of usage from within _-Xo.class.asam;
    Code:
    	  getlocal0
          pushstring		  "" ; Makes text appear as yellow (stands out)
          pushstring		  "Test Long Message\nTest next line"
          callpropvoid		  QName(PackageNamespace(""), "SendToChat"), 2
    
    	  getlocal0
    	  pushstring		  "Test messages"
    	  callpropvoid        QName(PackageNamespace(""), "SendToQueueText"), 1
    Last edited by zekikez; 11-19-2013 at 11:50 AM.

  2. The Following 4 Users Say Thank You to zekikez For This Useful Post:

    059 (11-25-2013),CrazyJani (11-21-2013),Knorrex (12-10-2013),maat7043 (11-20-2013)

Similar Threads

  1. Replies: 10
    Last Post: 11-01-2013, 09:07 AM
  2. [WTS] Want to sell 75$ code for Hawken, Planetside 2 and World of tanks!
    By QcReckzon in forum Selling Accounts/Keys/Items
    Replies: 0
    Last Post: 06-29-2013, 06:43 PM
  3. [Request] NEed Help ..Need Code For No Fog On and Off!!
    By daddy1 in forum WarRock Philippines Hacks
    Replies: 2
    Last Post: 12-15-2012, 04:31 AM
  4. [Request] Need code for Anti Block chat in Cf
    By MightySaa0d in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 11
    Last Post: 09-24-2011, 02:27 AM
  5. Replies: 37
    Last Post: 06-20-2006, 04:24 PM