hey guys, this is the beginning of a bot,
anyone could correct the errors out of it?
anyone could correct the errors out of it?
Quote:
HotKeySet("{F12}","startover") ;i allocate to key F12 the function start over
;i do this because when i exit the game the auto-hunt might be too fast for me to stop
; so i'll just press F12 and it will be stopped
; also u can add any key u want F1-12, NumPad0-9 ... and so on
startover() ; i call that same function to run so i just won't have to press F12
Func startover();i declare it
Endfunc ;and i end it
while 1; it will just keep the program in stand by untill the function is called
; useless in our case since we called the function automatically but it's good for u to know it
sleep(1000)
WEnd
while 1 ;because i want it to run over and over again
ProcessClose("hunt.exe") ;that's the auto-hunt i'll make later
ProcessClose("pot.exe") ;and the auto-pot i'll make later
;ProcessClose it basically just does what it says it closed a process
;what i do this ? because i don't want my auto-hunt and auto-pot to run more that once
;so each time the function initiate it will kill it?s *Sub-Functions*
Wend
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
while 1;we start a loop that wait for u to enter the game
PixelSearch(964,743,964,743,0xF7E52B,15) ; we look for the GOLD color we;collected . The last number ?15? it?s the pixel color range it can search
;so basically it doesn?t have to be the EXACT pixel
If NOT @error Then; PixelSearch color returns @error = 1 if the color ain?t found
;and 0 if the color is found
;NOT @error means @error = 0
;so if it founds that GOLD pixel it continues
Run("pot.exe"); run it
Run("hunt.exe") ; run it
Mouseclick("left",999,22,1); this will close the mini-map in 1024x768
ExitLoop ; it exists the current while loop
EndIf ; we close the IF
sleep(1000) ; it waits 1000 ms (1 second) before it continnues
Wend ; we close the while loop
;in less words this while loop will search for pixel over and over and over again
;until the pixel it?s found
;then it exit loop and it continues
EndFunc
;the best way is to use the same recognition system as before only the opposite way
;we don't want the GOLD pixel to be there
PixelSearch(964,743,964,743,0xF7E52B,15) ;same pixel search as before
$n = @error
while $n ;while the pixel is not found
Select
Case Hex(PixelGetColor(428,347),6) = "FEFEFE" and Hex(PixelGetColor(581,444),6) = "EEEEEE"
; the 2 pixels in the main menu
Sleep(200)
ProcessClose("hunt.exe") ; we close both the Sub-Functions
ProcessClose("pot.exe") ; we don't want keys to be pressed
;while it writes the password
Sleep(6000)
Send("{Enter}");just to be sure we try a log in before we right;the password. This will clear the pass field and leave it blank
Sleep(2000)
MouseClick("left",528,381,1,0) ; left click in the pass field
Sleep(200)
Send("PutYourPasswordHere") ;it will write the pass
Send("{Enter}");log in
Sleep(800)
MouseMove(950,650) ;move the mouse to a non-related point
; u can notice some useless things that i add to the script just to be sure the program will never fail
;next server list
Case Hex(PixelGetColor(457,572),6) = "EEEEEE"
Sleep(1000)
Send("{Right}");it collapse the server list
Send("{Down 1}"); the number will be sub-server u want 1-20
Sleep(200)
EndIf
;next is char list
Case Hex(PixelGetColor(755,575),6) = "55504A"; adaugi un Send("{Down}")
;before the next Send("{Enter}") u have to add Send("{Down x}") where
;x is 1 for the 2nd char, 2 for the 3rd char and so on
;u don't add anything if the char u wanna play with it's the 1st char
Send("{Enter}");it selects the char
ExitLoop 2; it exits 2 loops: the current one and the one that
;started the search for disconnect
EndSelect
PixelSearch(964,743,964,743,0xF7E52B,15)
$n = @error
Sleep(1000)
;this keeps the while loop running till success
wend
wend
while 1
$coord = PixelSearch(186,26,187,26,0xA00C00,1);looking for the HP pixel in a color;range of 1
If not @error Then;if the color is not found
Send ("{F11}") ;it presses F11
;in game Options -> Game -> unMark "Use numeric Keys"
;just trust me with this one
EndIf
Sleep(100) ; if we don't put this sleep the auto-pot will keep the CPU used 100%
WEnd
while 1;just keep the script alive
sleep(1000)
wend