Автор: Inquisition
Дата сообщения: 14.11.2008 17:27
Код:
WinActivate("Тра ляляля") ;Activate window and wait till it's opened.
WinWaitActive("Тра ляляля")
Opt("MouseCoordMode", 0) ;1=absolute, 0=relative, 2=client
Opt("PixelCoordMode", 0) ;1=absolute, 0=relative, 2=client
Dim $Runner ;Declare variable
Dim $array[5] = ["","414,223","471,233","528,220","470,204"] ;Mouse positions for moving to random map
HotKeySet("{ESC}", "Terminate") ;On/Off
HotKeySet("{F9}", "ShowMe")
While 1 ;If F9 is clicked then enitiate Func Start()
Sleep(20)
If $Runner Then Start()
WEnd
Func ShowMe() ;Look above
$Runner = Not $Runner
EndFunc ;==>ShowMe
Func Terminate() ;If Esc is clicked then stop script
Exit 0
EndFunc
Func CombatCheck()
sleep(3000)
$CombatCheck = PixelSearch(352, 365, 353, 366, 0x7AB800, 1)
If IsArray($CombatCheck) Then
MouseClick('Left', 381, 426)
sleep(1000)
mouseclick("left", 511, 455)
sleep(300)
mouseclick("left", 511, 441)
sleep(300)
mouseclick("left", 511, 408)
sleep(10000)
start()
Func Start() ;The main bot
$coord = PixelSearch(129, 261, 858, 490, 0xfa6541) ;Look for monster
If IsArray($coord) Then
MouseClick('Left', $coord[0], $coord[1] - 1) ;If monster found, click on its coords
EndIf
If Not IsArray($coord) Then ;If monster not found, move to random map
$random = Random(1, 4, 1)
$Split = StringSplit($array[$random], ",")
MouseClick("Left", $Split[1], $Split[2])
Start() ;Restart the script and look for monster
EndIf
mouseclick("left", 289, 230) ;START combat
sleep(1000)
$FightCheck = PixelSearch(309, 250, 310, 251, 0x0054e3, 2) ;If combat with that monster already started, leave and restart script
If IsArray($FightCheck) Then
MouseClick('Left', 525, 520)
Start()
EndIf
CombatCheck()
Do ;Combat script | Search for attack button, click it, move on to next attack
sleep(100)
$Bottom1 = PixelSearch(352, 456, 353, 457, 0x68181b, 3)
until IsArray($Bottom1)
If IsArray($Bottom1) Then
MouseClick('Left', $Bottom1[0], $Bottom1[1] - 1)
EndIf
CombatCheck()
Do
sleep(100)
$Upper1 = PixelSearch(328, 377, 329, 378, 0x68181b, 12)
until isArray($Upper1)
If IsArray($Upper1) Then
MouseClick('Left', $Upper1[0], $Upper1[1] - 1)
EndIf
CombatCheck()
Do
sleep(100)
$Upper11 = PixelSearch(328, 377, 329, 378, 0x68181b, 12)
until IsArray($Upper11)
If IsArray($Upper11) Then
MouseClick('Left', $Upper11[0], $Upper11[1] - 1)
EndIf
CombatCheck()
Do
sleep(100)
$Middle1 = PixelSearch(357, 429, 358, 430, 0x731111, 15)
until IsArray($Middle1)
If IsArray($Middle1) Then
MouseClick('Left', $Middle1[0], $Middle1[1] - 1)
EndIf
CombatCheck()
Do
sleep(100)
$Bottom2 = PixelSearch(352, 456, 353, 457, 0x68181b, 3)
until IsArray($Bottom2)
If IsArray($Bottom2) Then
MouseClick('Left', $Bottom2[0], $Bottom2[1] - 1)
EndIf
CombatCheck()
Do
sleep(100)
$Upper2 = PixelSearch(328, 377, 329, 378, 0x68181b, 12)
until IsArray($Upper2)
If IsArray($Upper2) Then
MouseClick('Left', $Upper2[0], $Upper2[1] - 1)
EndIf
CombatCheck()
Do
sleep(100)
$Upper22 = PixelSearch(328, 377, 329, 378, 0x68181b, 12)
until IsArray($Upper22)
If IsArray($Upper22) Then
MouseClick('Left', $Upper22[0], $Upper22[1] - 1)
EndIf
CombatCheck()
Do
sleep(100)
$Middle2 = PixelSearch(357, 429, 358, 430, 0x731111, 15)
until IsArray($Middle2)
If IsArray($Middle2) Then
MouseClick('Left', $Middle2[0], $Middle2[1] - 15)
EndIf
CombatCheck()
Do
sleep(100)
$Middle3 = PixelSearch(357, 429, 358, 430, 0x731111, 15)
until IsArray($Middle3)
If IsArray($Middle3) Then
MouseClick('Left', $Middle3[0], $Middle3[1] - 1)
EndIf
CombatCheck()
Do
sleep(100)
$Middle4 = PixelSearch(357, 429, 358, 430, 0x731111, 15)
until IsArray($Middle4)
If IsArray($Middle4) Then
MouseClick('Left', $Middle4[0], $Middle4[1] - 1)
EndIf
CombatCheck()
Do
sleep(100)
$Middle5 = PixelSearch(357, 429, 358, 430, 0x731111, 15)
until IsArray($Middle5)
If IsArray($Middle5) Then
MouseClick('Left', $Middle5[0], $Middle5[1] - 1)
EndIf
CombatCheck()
EndFunc ;Repeat