Fend
Active Members-
Posts
29 -
Joined
-
Last visited
About Fend
- Birthday January 15
Fend's Achievements
Seeker (1/7)
0
Reputation
-
The first step to bot writing in Autoit ofcourse would be to have a general understanding of Autoit. Understand how variables are used, control structure like while loops, arrays. After this I would spend sometime writing a simple script using the pixel functions...like pixelsearch. Write a scrpit that does something, could be to make something move left or right if a certain pixel changes colors. After you have made a little working script, redesign, rewrite untill you have a good idea of the mechanics. From here you could scrap pixel searches and directly work with memory, nomadmemory.au3 is a wonderfull tool for botmakers. There are a lot of posts on this site devoted to memory manipulation. These are a few steps you could follow to start working on your bot. On a side note, I would think that botmaking for a strategy game would be more difficult that other types of games. I would spend a good amount of time working out what you want it to do and under what circumstances the bot should do this or that.
-
The values for the cards will be in memory somewhere, but as to what they are it could be anything. the value for the ace of hearts could be -5647329564436 for all we would know. You could try searching for things you can find and maybe find a static adress and maybe those values are offset by 2 or 4. The easiest way would be to use the pixel related functions to simply read those cards from the screen, if you code the pixelgetcolor and pixelsearch's right, it could be just as reliable as directly reading it from memory.
-
Since the location of your value is constantly changing you nee to find a static address to refferene off of. This is commonly used when writting cheats or bots for games. I would use a program like cheat engine to find the value you are looking for. At that point, use pointer scan for addess or whatever it is phrased as. This will give you something like 0x435678+whatever.exe then you could use something like... #include <NomadMemory.au3> $ID = _MemoryOpen(ProcessExists("XYZ.exe"));;gets the process ID $baseADDR = _MemoryGetBaseAddress($ID, 1);;gets the base address after finding the ID $StaticOffset = Dec("37fc78");;the offset for the green address $CalcADDR = "0x" & Hex($baseADDR + $StaticOffset) $value = _MemoryRead($HPADDR,$ID);;the value Now, if you are unable to find the value in cheatengine then you will have to follow back the pointers to a static value...there are instruction/tutorials on the internet and I would not be able to explain it in a post. After tracking back the pointers use something like this.... $ID = _MemoryOpen(ProcessExists("XYZ.exe"));;gets the process ID $baseADDR = _MemoryGetBaseAddress($ID, 1);;gets the base address after finding the ID $StaticOffset = Dec("37fc78");;the offset for the green address $CharHPPtrOffset = "0xAC";;2nd level pointer offset $CharHPOffset = "0x4C";;1st level pointer offset $CalcADDR = "0x" & Hex($baseADDR + $StaticOffset);;2nd level pointer $value = "0x" & Hex(_MemoryRead($CalcADDR,$ID));;calc to find 1st level pointer $CalcADDR = "0x" & Hex($value + $CharHPPtrOffset);;1st level pointer $value = "0x" & Hex(_MemoryRead($CalcADDR,$ID));;calc to find address of value $HPADDR = "0x" & Hex($value + $CharHPOffset);;address of value $HP = _MemoryRead($HPADDR,$ID);;the value This code finds the value of hitpoints in a games memory, but its function is essentially what your are doing. It deals with a pointer to a pointer to a static address. You will have to use Szhlopp's _MemoryGetBaseAddress which you can find at this post http://www.autoitscript.com/forum/index.ph...ic=78834&hl And Nomad's Memory library which you can find by searching the forumns...NomadMemory.au3
-
Memory Address, What type of memory.
Fend replied to AwAke's topic in AutoIt General Help and Support
I dont play wow, but it strikes me as odd that the game would store HP in a string. normally it would be $Value = _MemoryRead(0x1B52BE68, $DllInformation) If you are sure the value is a string then try stating the size char[8] or whatever. If it is ascii then try byte[8]or whatever size you expect...I am at work or I would test out a few things on some games. On a side note, I have read that for wow you need to setPriviledge, SetPrivilege("SeDebugPrivilege", 1) Also have you tested that WinGetProcess("classname=GxWindowClassD3d","") is giving you what you need as far as your process? -
Memory Address, What type of memory.
Fend replied to AwAke's topic in AutoIt General Help and Support
Char[] should do the trick -
multiple operations, multiple processes?
Fend replied to punisa's topic in AutoIt General Help and Support
http://www.autoitscript.com/forum/index.php?showtopic=83967 I had a few secs to check for it...have fun! -
multiple operations, multiple processes?
Fend replied to punisa's topic in AutoIt General Help and Support
If you are allready using adlib and do not want to use it here, you could simply make that a function and call it periodically through out the code. Func WindowStatus() If WinExists ("error occured") Then WinClose ("error occured") EndFunc Then just call this function from time to time. I have seen a script for multiple adlib like executions, you can find it by searching multitasking I believe. Downside of adlib is it stops the execution of the script while running. The multitasking post I believe avoided this to some extent. -
That make perfect sense, thank you!
-
Ok, So lets say I want to timeout of a while loop If a condition is not met... If(some condition) Then $begin = TimerInit() While(some other condition) Sleep(50) If(TimerDiff($begin)=60000) Then ExitLoop EndIf WEnd EndIf I am at work and unanle to test this, would this work or is there a better function to achieve this? I could allways increment a variable after each sleep and have it exit loop when the variable is 1200, but it just seems a bit sloppy to me...any advice?
-
If you just want to see the value try this... #include <Array.au3> #include <NomadMemory.au3> SetPrivilege("SeDebugPrivilege", 1) $ID=_MemoryOpen(ProcessExists("WoW.exe"));;not sure what the process is for wow, that was a guess $Address=0x1F35CFB8 $Res = _MemoryRead($Address,$ID) MsgBox(0,"My value",$Res) _MemoryClose($ID) As for resources with auto it here is a good post on dealing with them... http://www.autoitscript.com/forum/index.ph...ic=78834&hl Also check out http://www.autoitscript.com/forum/index.ph...ic=78834&hl has some memory functions on the 2nd post I dont play wow, but i have seen a serious thread devoted to memory scanning and what not...should check it out. Here is a little code if it helps... $ID = _MemoryOpen(ProcessExists("XYZ.exe"));;gets the process ID $baseADDR = _MemoryGetBaseAddress($ID, 1);;gets the base address after finding the ID $StaticOffset = Dec("37fc78");;the offset for the green address $CharHPPtrOffset = "0xAC";;2nd level pointer offset $CharHPOffset = "0x4C";;1st level pointer offset $CalcADDR = "0x" & Hex($baseADDR + $StaticOffset);;2nd level pointer $value = "0x" & Hex(_MemoryRead($CalcADDR,$ID));;calc to find 1st level pointer $CalcADDR = "0x" & Hex($value + $CharHPPtrOffset);;1st level pointer $value = "0x" & Hex(_MemoryRead($CalcADDR,$ID));;calc to find address of value $HPADDR = "0x" & Hex($value + $CharHPOffset);;address of value $HP = _MemoryRead($HPADDR,$ID);;the value That is for a value that had two pointers Good luck
-
Thx man!! After a few more hours tweaking things I got it to work!! I spent most of the day playing with a few different programs and just using the code, I feel infinitely better about the whole memory process. I did run into a question though, I tried a different game and found the Xcoord as a 4byte but the Ycoord as a byte. Is this uncommon? the pointer to the Ycoord is 4byte so I get a huge value as apposed to what it should be. Does autoit have a means to convert that 4byte value to a byte? Thanks again so much!!!
-
Glad to hear you got it to speed up!
-
Might want to try ControlClick instead of MouseClick unless you need to see the cursor move. Those nested for loops might be causing some slow down.