MouseClick("left", $XColumn1, $YRow1, 1)
$Paused = NOT $Paused
$PixelCheck = PixelGetColor($PixelCheckBoatX,$PixelCheckBoatY)
ElseIf $APTimes > 0 Then $APTimes = $APTimes - 1
ElseIf $APTimes>0 Then $APTimes=$APTimes-1
$APTimes = 10 If False Then ElseIf $APTimes > 0 Then $APTimes = $APTimes - 1 EndIf msgbox(48, "Alert", $APTimes) ;=> 9
#include "botlib.au3"
Func Bot()
$runs = get_runs(10)
For $i = 1 To $runs
hit_start()
skip_map(3)
sleep(1000*75)
god()
ohk()
walk("w",8000)
While NOT battle_cleared_screen_present()
paladin1()
tentacle(3)
WEnd
hit_replay()
Next
EndFunc

msgbox("", "ExampleTitle", "We are about to enter the for loop")
for $example = 1 to 10
msgbox("", "ExampleTitle", $example)
Next
msgbox("", "ExampleTitle", "Done")
If $ErrorCountdown = 0 Then
Call("Forfeit")
Else
ToolTip("SinBotv2.2 is now taking steps to remove errors. Waiting for all error messages to appear", 50, 50)
Sleep(500)
Send("{ALT DOWN}")
MouseClick("left", $CloseBattleScreenX, $CloseBattleScreenY, 1)
Sleep(500)
Send("{ALT UP}")
Sleep(500)
Do
$GameUIErrorPixel = PixelGetColor($GameUIErrorPixelX,$GameUIErrorPixelY)
Until $GameUIErrorPixel = 0 Or $GameUIErrorPixel = 12957332
If $GameUIErrorPixel = 0 Then
Sleep(1000)
Send("{ALT DOWN}")
Sleep(100)
MouseClick("left",$GameUIErrorPixelX,$GameUIErrorPixelY,1)
Sleep(1000)
MouseClick("left",$GameUIErrorPixelX,$GameUIErrorPixelY,1)
Sleep(100)
Send("{ALT UP}")
$ErrorCountdown = $ErrorCountdown - 1
Call("LeaveAndRunColhen")
ElseIf $GameUIErrorPixel = 12957332 Then
$ErrorCountdown = $ErrorCountdown - 1
Call("SelectMap")
EndIf
EndIf
For $ErrorCountdown = 1 to 5
ToolTip("SinBotv2.2 is now taking steps to remove errors. Waiting for all error messages to appear", 50, 50)
Sleep(500)
Send("{ALT DOWN}")
MouseClick("left", $CloseBattleScreenX, $CloseBattleScreenY, 1)
Sleep(500)
Send("{ALT UP}")
Sleep(500)
Do
$GameUIErrorPixel = PixelGetColor($GameUIErrorPixelX,$GameUIErrorPixelY)
Until $GameUIErrorPixel = 0 Or $GameUIErrorPixel = 12957332
If $GameUIErrorPixel = 0 Then
Sleep(1000)
Send("{ALT DOWN}")
Sleep(100)
MouseClick("left",$GameUIErrorPixelX,$GameUIErrorPixelY,1)
Sleep(1000)
MouseClick("left",$GameUIErrorPixelX,$GameUIErrorPixelY,1)
Sleep(100)
Send("{ALT UP}")
Call("LeaveAndRunColhen")
ElseIf $GameUIErrorPixel = 12957332 Then
Call("SelectMap")
EndIf
Next
Call("Forfeit")
Func Skill()
If $AP=1 Then
If $APTimes>2 Then
ToolTip("SinBotv2.2 will launch the skill spending program after " & $APTimes & " more runs.", 50, 50)
ElseIf $APTimes=2 Then
ToolTip("SinBotv2.2 will launch the skill spending program after " & $APTimes-1 & " more run.", 50, 50)
ElseIf $APTimes=1 Then
ToolTip("SinBotv2.2 will launch the skill spending program after the current run.", 50, 50)
EndIf
Sleep($SkillDelay)
If $APTimes=0 OR $APTimes<0 Then
If $SmartAP=0 Then
ToolTip("SinBotv2.2 cannot be stopped during AP spending process. Please wait until finished.", 50, 60)
Send("v")
Send("{ALT DOWN}")
MouseClick("left", $SkillBoxX, $SkillBoxY, 1) ; Selects All
Call("SkillSelect")
MouseClick("left", $XTab2, $SkillBoxY, 1) ; Combat
Call("SkillSelect")
MouseClick("left", $XTab3, $SkillBoxY, 1) ; Training
Call("SkillSelect6")
MouseClick("left", $XTab4, $SkillBoxY, 1) ; Restoration
Call("SkillSelect8")
MouseClick("left", $XTab5, $SkillBoxY, 1) ; Equipment
Call("SkillSelect8")
MouseClick("left", $XTab6, $SkillBoxY, 1) ; SP
Call("SkillSelect6")
Send("{ALT UP}")
ElseIf $SmartAP=1 Then
Send("v")
Send("{ALT DOWN}")
MouseClick("left", $SkillBoxX, $SkillBoxY, 1) ; Selects All
Call("SkillSelect")
EndIf
Sleep(500)
If FileExists ( $IniFile ) Then
$APTimes=IniRead ( $IniFile, "skill", "APTimes", 40)
Else
$APTimes=40
EndIf
Sleep($LaunchButtonDelay)
Call("Launch")
ElseIf $APTimes>0 Then
$APTimes=$APTimes-1
Sleep($LaunchButtonDelay)
Call("Launch")
EndIf
ElseIf $AP=0 Then
Sleep($LaunchButtonDelay)
Call ("Launch")
Else
MsgBox(0, "SinBotv2.2", "INI File Error. AP value must be 0 or 1.")
Call("ExitBot")
EndIf
EndFunc