
Aceboss
Singapore
Asked
— Edited
The last couple of days I have been struggling with Elseif's which do not appear to be recognized by ARC (latest version) as an Elseif but rather as an If in the structure as can be seen below:-
This of course is just an example template to illustrate the issue. If I replace the
statements instead with an endif / if combination the structure appears fine, it is only when I introduce an elseif into the equation that the structure fails.Quote:
Elseif
I have only noticed this problem since upgrading to Windows 10, and the code appears to run OK.
Actual code that exhibits this behavior also appears below:
Code:
$standRandomResult=0
:standingLoop
if ($autonomous = true)
print("something")
if ($isStanding = true)
$standRandomResult=getRandomUnique(1,50)
print($standRandomResult)
$autoAction=true
if ($standRandomResult=1)
ControlCommand("Auto Position", AutoPositionAction, "Thinking")
pause(3000)
elseif ($standRandomResult=2)
ControlCommand("Auto Position", AutoPositionAction, "Bow")
pause(3000)
endif
$autoAction=false
endif
endif
SleepRandom( 5000, 20000 )
goto(standingLoop)
The only reason for the
Code:
print("something")
statement is that I read EZ-Script does not like there to be no statements in between an If/EndIf pair. Has anyone experienced similar before, and what could be going on here? This has occurred with multiple scripts I have written over the last 2 days and persists between saves or even if the code is pasted into a new script.
I would check that you don't have the variable being used somewhere else in another script.
If you press FORMAT CODE button, that is how the compiler parses the conditions.
Code:
However if I try any combination of the original script I pasted, then the bracketed indicators to the left of the line numbers show an imbalance of if/endif's once elseif is introduced.
Anyway, I guess the most important thing is that the script itself runs OK, it's just I am rather pedantic about things looking correct. Thanks for the assistance.
Incidentally I see I stupidly added pauses instead of sleeps in the sample code I pasted, I have since corrected that and pressed FORMAT CODE without any change to the original issue.
Thanks.
you're good to go
Regards,