.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Programming
General Programming Help others and get yourself helped here!

Reply
 
Thread Tools
Am I in the right place?
Old
  (#1)
callide
Member
 
Status: Offline
Posts: 5
Join Date: Mar 2006
Default Am I in the right place? - 14-03-2006

Hi,
I want to create a bot for a 2d isometric game, an mmorpg. I havn't seen it attempted, heard people talking about, or found any groups that do this with any mmorpg's let alone this game. I was thinking since it is a 2d isometric game I could get the information such as the current co-ordinates, health etc. by scanning the screen and getting the information that way. I want the bot to move about and do repetitive tasks by itself.

I could do this myself but i'm having trouble with reading the whole screen into a variable and scanning through it. I've tried using CWnd functions to copy the whole screen. This works to the extent that I can say, copy the screen to clipboard or to a bitmap. But I want to be able to copy every pixel on the screen and be able to check each of them for thier colour and then evaluate whether my health is low or where I am.

If someone could point me in the right direction on how to read pixels on the screen for thier colour and sendkeys to application it would be very helpful. I don't even know if i'm approaching on how to do this so any information would be useful.

Thanks
  
Reply With Quote
Re: Am I in the right place?
Old
  (#2)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: Am I in the right place? - 14-03-2006

Doing what you are proposing isn't very easy for what you want to do, it would require pattern recognition and high intelligence to find points of interest on the screen. If there is only colour required to determine health (and it is on a static point on a screen continuously) then it might be easier but I dont know what functions you'll need exactly... Running through each pixel wont be very good either because youll run through millions of pixels and most likely suffer frame glitches during the game.

Best way is to find an API into the game, if none is available try hacking into the game to find the memory location offsets of the health/"co-ordinates" or whatever, you can find these quite easily with a trial & error approach by using a program such as GameHack or your own built program.

if its a windows program, i think there are methods of retrieving colour information, could update the information each time WM_PAINT message is called (as long as the method is trivial), you can also send messages, keys or other information I believe by using SendMessage() into the window.
  
Reply With Quote
Re: Am I in the right place?
Old
  (#3)
callide
Member
 
Status: Offline
Posts: 5
Join Date: Mar 2006
Default Re: Am I in the right place? - 14-03-2006

Thanks for reply i'll try that. I got slightly further, I used GetPixel to check through bitmap handle for certain colours, still not very effective though. Just wondering if there's any other tools about as im on XP, and GameHack is win98 and errors "Unable to load GameHack.VXD". It is a windows program.

Thanks

Last edited by callide; 14-03-2006 at 22:46..
  
Reply With Quote
Re: Am I in the right place?
Old
  (#4)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: Am I in the right place? - 15-03-2006

ignore the .missing .vxd error with gamehack. there is actually a bug with it crashing in XP, to fix you must select Win32 in "range mode" in the configuration window of it for it to work properly or else it will crash when searching. then select the process and search mem locations
  
Reply With Quote
Re: Am I in the right place?
Old
  (#5)
callide
Member
 
Status: Offline
Posts: 5
Join Date: Mar 2006
Default Re: Am I in the right place? - 15-03-2006

Hi,
the GameHack tool works and I can get the addresses of thing's like Co-ordinates. But health changes everytime I log in or out or restart the application, unlike co-ordinates. It is always C7XXXXXX, what do I do?
Thanks.
  
Reply With Quote
Re: Am I in the right place?
Old
  (#6)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: Am I in the right place? - 15-03-2006

you need the offset of the variable, not the exact memory location..

if you find the memory location of the health and co-ordinates, subtract from the memory location of the beginning of the process, you can find this out on the process window i think, if not try debugging with MSVC and view the modules, it will tell you the memory location of the beggining of the module. Once you find the offset you can get the variable back by casting it as a pointer from the mem location e.g. float coord=*(float*)(ProgramStartLocation + offset)

if you are already doing that then maybe you aren't picking up the correct location, keep searching within the locations you found for changes when health changes, increase/decreases/no change etc until you find just one location (or more that are always the same)

if you've done that too, then probably the program is creating the health from a heap and it will be pretty difficult to find this information. you could find the memory location of sometihng relating to the player such as co-ordinates and try seeing if the offset from the co-ordinates and health is always the same (and not the offset from the program's mem location)

oh, if all else fails, maybe you could see if someone has already made a trainer for the game which messes around with a players health, and contact them to see how they found it.

remember that if the program changes (updates etc) most liekly the offsets will change and you'll need to find them again to update your bot program. you could probably create a neat class that stores the offsets for each version if you can find out the version of the program.
  
Reply With Quote
Re: Am I in the right place?
Old
  (#7)
callide
Member
 
Status: Offline
Posts: 5
Join Date: Mar 2006
Default Re: Am I in the right place? - 15-03-2006

Thanks again, i'll keep trying . I must be doing it from the beginning of the process because co-ordinates offset doesn't change, so it's most likely creating it from heap. Which is going to be difficult is this is the case because co-ordinates dont actually change. Maybe I need an address that stores the offset where all the player information is stored?

Last edited by callide; 15-03-2006 at 18:41..
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com