How to script a simple auto-bot [AutoIT]

08/28/2010 22:36 pimel2#106
Quote:
Originally Posted by calonlineFreak View Post
look at this here:

[Only registered and activated users can see links. Click Here To Register...]

i found it while surfing. seems nice to lern coding as well...
This is no autoit you jerk...
11/12/2011 19:52 damulagcarl#107
anyone here can make a script of autopot the key is q...w...e...a...s...d so everytime i press the hotkey it floods qweasd in my screen thanks i will used it in ran online private server
11/17/2011 12:23 obieq#108
Mine code
Code:
Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Global $Paused

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



$mobColorRed = "0xFF1F1E"
$mobColorYellow = "0xFEFE00"
$1mobColorYellow = "E0E91E"
$mobColorOrange = "0xFE8000"
$MobColorGreen = "0xC0BE40"
$MobColorGrey = "0x787878"
$1MobColorGrey = "0x8B8F8F"
$xTop = 30; i declare them
$yTop = 73
$xBot = 1802
$yBot = 892
$mobGreen = "0xC0BE40"; i also declare the mob color HERE

Sleep(6000)
while 1
$coord = PixelSearch($xTop,$yTop,$xBot,$yBot,$MobColorGrey,$1MobColorGrey,105);i search for the green mobs
$n = @error
If NOT @error Then;if the mob is found
while $n = 0;while it is still in the screen
$x = Random($coord[0], $coord[0]+1040, 1);we randomize coordinates so we won't miss the mob
;since mobs have different shape and sizes
$y = Random($coord[1], $coord[1]+840, 1)
MouseClick("left", $x, $y, 2, 0); i click at the randomized coordinates
HotKeySet("{PAUSE}", "TogglePause")
sleep(3000)
$mm = PixelGetColor ( 799 , 11 ); i get the pixel color of that mob HP LIMIT
$mob = Hex($mm, 106);since the pixel i got is hex and PixelGetcolor function returns a decimal value i convert it
If $mob = "FFD26C" Then; HERE i compare the converted value i got from PixelGetColor in that point with the have i collected using AWI in the same point
ExitLoop; if it's a match (that means that the mob was selected)
;it will exit the loop and continue
EndIf
$coord = PixelSearch($xTop,$yTop,$xBot,$yBot,$MobColorGrey,$1MobColorGrey,105);w e repeat the same pixel search
; the ideea is that the program will try to click the mob untill he is selected
$n = @error
wend
;in this moment we have the mob selected
If $mob = "FFD26C" Then ; HERE but we check it anyway
while $mob = "FFD26C" ; HERE so as long as the mob is selected
HotKeySet("{PAUSE}", "TogglePause")
Send("1"); we just send the skills from F4 to F1
Send("2"); chaotic i know but since we use speed hack
Send("3");adding waiting times will just be a waste of time
Send("4")

$mm = PixelGetColor ( 799 , 11 );we once again look for the mob's HP so we can complete the while loop
$mob = Hex($mm, 2);this means that the keys will be pressed untill the mob is dead
wend
Send("1"); we just send the skills from F4 to F1
Send("2"); chaotic i know but since we use speed hack
Send("3");adding waiting times will just be a waste of time
Send("4")
Send("{Space}"); after the mob is dead we collect the items
Sleep(200)
EndIf

;now remember the "IF NOT @error Then" from the start?
;what if there is no mob in the screen?
;what then?

Else;if no mob is found
Send("{Right 7}") ;rotate the camera to look in other directions
HotKeySet("{PAUSE}", "TogglePause")
Endif
Wend


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
Any clues to get it working ? Its clicking randomly but dont pick monsters even if i clik it then doesn't attack


Edit;
Ok i get it working a little but the problem of recognizing mob colours is still exist.
I guess this is due to transpraent mob names.
12/15/2011 01:20 tano1221#109
is this working in CABAL PH?
12/20/2011 16:50 idiota2#110
Pictures don't works ;(
02/23/2012 09:23 geosnuk#111
can some one do this 4 cabal ph?auto loot will be nice too
03/04/2012 13:35 GaminG00#112
made some changes but script work thx
05/28/2012 13:13 mjmelencio14#113
Hey why i can't see the screenshots? :( Broken Link. Can someone help me? :(
06/12/2012 10:40 strontklit#114
Quote:
Originally Posted by geosnuk View Post
can some one do this 4 cabal ph?auto loot will be nice too
This is a guide on how to do it yourself, so you gotta read it and then script it yourself!
06/12/2012 22:36 geosnuk#115
sorry sir^_^ imjust still learning tnx
06/16/2012 13:54 genesisVI#116
sir pls enlighten me on the hotkey code it always says error on calling func
07/12/2012 19:01 osyris124#117
Can anyone share the complete codes here? The pre-made codes given by Dizzydbd is not working, it used to turn around and around.. i try to change the color hex code. but still nothing happens.. Can anyone share it here? thanks a lot!
07/12/2012 19:24 ronaldgrn#118
try [Only registered and activated users can see links. Click Here To Register...] l its not as complete as the one here but it should work.

You can also try my [Only registered and activated users can see links. Click Here To Register...] its a bit more advanced but u don't get to practice and improve ur programming skills :( ..

Theres also option 3 of posting your code here, ill take a look and point you in the right direction..

ps. id go with option 3
07/13/2012 16:44 bartbilf#119
@ronaldgrn
don't spoonfeed them that much lol, just let them read and then they can make it themselves, else.. too bad, then can always buy CR if they don't want to put effort in reading and learning
07/15/2012 21:06 MyMyner#120
Errrm... Just tried it but since there was Xtrap or GG on every server I couldnt really test it. I guess both Guides I found here are just for bypassed or unprotected Servers?