Bot Functionality

Ask for Help on Using the Language With Memory Hacking Software

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

Bot Functionality

Postby DeathProxy » Sat Jan 24, 2009 10:02 am

Hi L. Spiro,

I have been playing around with MHS for about a week or so working with Warcraft III, mostly just trying to find complex addresses (which I am getting much better at thanks to the various tutorials on this site). Anyways, tonight I started working with your scripting language and have made some extern variables, which is quite an incredible feature!

Basically, I had this idea to make a bot that would run in the background of my dota games and could be asked a variety of questions about stats and other things by anyone on the team using the ingame chat and would then respond the same way. I have checked and Type() works perfectly for this purpose and I have written some simple scripts that read the current value of the extern variables and then output messages based on them. The only problem (if you could call it a problem, I might just have to settle for using hotkeys), is that because it is event driven I am having trouble figuring out how (if possible) to loop through the code and have it continue to check the extern variables without issuing a new event. I tried a simple while loop with a Sleep() attached to the end, and it kind of worked except for the fact that it freezes the MHS window (because of the infinite while loop), which seems like a bad idea.

Thanks for this great piece of software!
DeathProxy
I Have A Few Questions
 
Posts: 4
Joined: Tue Jan 20, 2009 6:22 am

Postby L. Spiro » Sat Jan 24, 2009 11:00 am

If continuous checking within a loop is your goal, you are on the right track, but you need to look at the CreateThread() function and possibly the synchronized keyword borrowed from Java.

Loop in another thread so the main window does not freeze. Add a Hotkey to start and stop the second thread.

Adding Hotkeys can also be done via scripts.


L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan


Return to Help

Who is online

Users browsing this forum: No registered users and 0 guests