Chat Catcher Code

Posts 1–9 of 9 · Page 1 of 1
Chat Catcher Code
Hi Everyone,

This is almost a continued thread from @Yuudoku
Who had an idea of making a chat catcher for AQW, where all chat of the user would be saved into a .txt file.
I think it's a pretty cool idea!
His original thread can be found here: http://www.mpgh.net/forum/219-aq-wor...g-catcher.html

I've been trying to make it for him, but I need help with the coding side of things...
I have been told that the actual chat is server sided but it would still be possible to collect the packets or whatnot.

I have been using the code below to try to at least pick up when a chat message had been entered:
Code:
package
{
 import flash.display.Sprite;
 import flash.events.Event;
 import flash.events.EventDispatcher;
 public Class ChatCatcher extends Sprite
 {
 private var chatModel:Model = this.Game.message;
public function ChatCatcher():void
{
  this.Game.message = new Model();
  this.Game.message.addEventListener(Model.VALUE_CHANGED, onModelChanged);
}
private function onModelChanged(e:Event):void
{
  trace('New Chat Message');
//This is where hopefully chat will be saved
}
}
}
But it hasn't been effective at all, as I'm not even sure if it is the correct thing to use
I think a starting point would be for me to ask... does anyone know the linkage to where the chat can be found?
These are my guesses, but they may be wrong:
Code:
//Found from previous code
Game.chatF
Game.world****otClass.chatF
//My guesses found from output
Game.chatM
Game.message
Game.chatm
This is also the output I receive when a single chat message is sent:
Code:
[Sending - STR]: %xt%zm%message%33057%lol%zone%

[ RECEIVED ]: %xt%chatm%33057%zone~lol%CHARNAME%42210%33057%0%, (len: 52)
responseObject STR: chatm
msg> lol ?> CHARNAME
Apologies to those of you who are not at all interested in code, but those who are, any suggestions?
It would be epic if we managed to get it working

Oliboli8769
Woah, nice progress.
Quote Originally Posted by Yuudoku View Post
Woah, nice progress.
Thanks man
I will continue to try xD
Even though it's a bit out of my depth :P
You're using packages, welp...
Make a new AS file and name that Game.
Copy and paste this code:

Code:
package{
	
	import flash.utils.ByteArray; 
	import flash.display.MovieClip;
	import flash.utils.setInterval;
	import flash.utils.clearInterval;
	
	//@Author JamesRo
	public class Game {
		
		private static var _instance:Object;
		public static var id:int;
		
		public static function get instance():Object{
			if(!_instance)
				throw new Error("Game instance uninitialized");
				
			return _instance; 
		}
		public static function set instance(o:Object) { _instance = o; }
		
		public static function showMessage(text:String)
		{
			_instance.showMessageBox(text, function(){});
		}
		
		static function clone(source:Object):* 
		{ 
			var myBA:ByteArray = new ByteArray(); 
			myBA.writeObject(source); 
			myBA.position = 0; 
			return(myBA.readObject()); 
		}
		
		/*You'll have to fix the getDrop disconnections by yourself ;D*/
		
	}
}
Remove the 'this.' unless your coding it from a seperate movie clip.
And add
Code:
.instance.
after every Game.
Also, are you sure its Game.message... maybe it's chatF or iChat, not sure. I used JamesRo's Le Bot 6.9 as a reference.
Quote Originally Posted by zerobrium View Post
You're using packages, welp...
Make a new AS file and name that Game.
Copy and paste this code:

Code:
package{
	
	import flash.utils.ByteArray; 
	import flash.display.MovieClip;
	import flash.utils.setInterval;
	import flash.utils.clearInterval;
	
	//@Author JamesRo
	public class Game {
		
		private static var _instance:Object;
		public static var id:int;
		
		public static function get instance():Object{
			if(!_instance)
				throw new Error("Game instance uninitialized");
				
			return _instance; 
		}
		public static function set instance(o:Object) { _instance = o; }
		
		public static function showMessage(text:String)
		{
			_instance.showMessageBox(text, function(){});
		}
		
		static function clone(source:Object):* 
		{ 
			var myBA:ByteArray = new ByteArray(); 
			myBA.writeObject(source); 
			myBA.position = 0; 
			return(myBA.readObject()); 
		}
		
		/*You'll have to fix the getDrop disconnections by yourself ;D*/
		
	}
}
Remove the 'this.' unless your coding it from a seperate movie clip.
And add
Code:
.instance.
after every Game.
Also, are you sure its Game.message... maybe it's chatF or iChat, not sure. I used JamesRo's Le Bot 6.9 as a reference.
Thanks Zero, your advice is always very much appreciated
Nice work, hope to see it made soon :3
The right one is Game.chatF(if you're doing 'timeline coding' )
Quote Originally Posted by JamesRo View Post
The right one is Game.chatF(if you're doing 'timeline coding' )
yay! thankyou. He has exams tomorrow though. But we really needed your help <3
Quote Originally Posted by JamesRo View Post
The right one is Game.chatF(if you're doing 'timeline coding' )
Thanks James!

Quote Originally Posted by zerobrium View Post
yay! thankyou. He has exams tomorrow though. But we really needed your help <3
Yeah 3 exams tomorrow, but let me know if you manage to do anything
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

Talk with us