Im having trouble here is my code
$Plant = IniRead("settings.ini", "Main", "Plant", "Error Reading INI")
$Harvest = IniRead("settings.ini", "Main", "Harvest", "Error Reading INI")
AutoItSetOption("MouseCoordMode", 0)
WinActivate("Window")
Sleep(4000)
Global $slot1
Global $slot2
Global $slot3
Global $p
Global $h
$p = 0
$h = 0
;section1
If WinExists("Window") Then
Do
$slot1 = MouseMove(25,66)
MouseClick("left")
MouseClick("left")
Sleep(1000)
MouseMove(461,318)
Sleep(1000)
MouseClick("left")
Sleep(1000)
$slot3 = MouseMove(85,68)
Sleep(1000)
MouseClick("left")
MouseClick("left")
Sleep(1000)
MouseMove(461,318)
MouseClick("left")
Sleep(2000)
Send("{UP}")
$p = $p + 1
Until $p = $plant
Else
;section 2
if $p <= $plant Then
Do
Sleep(900)
$slot3 = MouseMove(56,65)
MouseClick("left")
MouseClick("left")
Sleep(1000)
MouseMove(461,318)
Sleep(1000)
MouseClick("left")
Sleep(3000)
Send("{DOWN}")
$h = $h + 1
Until $h = $Harvest
EndIf
If NOT WinExists("Window") Then
MsgBox(16, "Window Is Not Present In Memory")
EndIf
Ok now my problem is that it does the first section of code but when it gets to the 2nd part (else) it does not do it and the program closes.
I was hoping to make it do the 1st set there and then move on to the 2nd section but only the ammount of times that is put into the INI.
I am very lost this is for personal use only, for a game yes but only being made to help me understand things better i hope im not breaking any rules here
Thanks in advance