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.