QUOTE(DaMOB @ Aug 7 2009, 04:24 PM)

First things first, and this is before anyone attempts to help you with your "END" statement problem, and that is you have to get rid of that recursion bug. I saw it and Triane finally saw it and I will tell you that you had better see it or your program is doomed to utter failure and the lack of a closing "END" statement is the least of your worries.
Do you happen to know what recursion is?
Actually, that was my first knee-jerk response too (as indicated by my post), but afterwards I realised that if you look at the code between the "loop 10000" and its associated "end" statement as the "mainline" of the program, and the procedure as being only the code up to the "loop 10000" statement, then there isn't a recursion bug, and I suspect that's where the missing "end" should be placed...
Adding additional "end" statements to the bottom of the macro results in the recursion bug, and that's why (I think) he's getting errors that aren't indicating the actual problem clearly when he tries that.
i.e. this is what I
think he intended:
CODE
Procedure checkcolor
LoadRGB $mouse
IF {RGBRed} = 167 and {RGBGreen} = 255 and {RGBBlue} = 255
delay 1000
LeftClick
Stop
end
end
// mainline
loop 10000
delay 600000
loop 2
MousePos 279, 752
delay 500
leftclick
delay 500
MousePos 762, 140
delay 500
call checkcolor
MousePos 396, 749
delay 500
leftclick
delay 500
MousePos 810, 171
call checkcolor
MousePos 496, 757
delay 500
leftclick
delay 500
MousePos 862, 198
call checkcolor
MousePos 592, 761
delay 500
leftclick
delay 500
MousePos 909, 224
call checkcolor
MousePos 682, 757
delay 500
leftclick
delay 500
MousePos 960, 256
call checkcolor
end
end
...personally, I think it should be something like:
CODE
constants
result = true
end
Procedure checkcolor
LoadRGB $mouse
IF {RGBRed} = 167 and {RGBGreen} = 255 and {RGBBlue} = 255
delay 1000
LeftClick
SetConst $result = false
end
end
Procedure Work using x_coord1, y_coord1, x_coord2, y_coord2
If $result = true
MousePos $x_coord1, $y_coord1
delay 500
leftclick
delay 500
MousePos $x_coord2, $y_coord2
delay 500
call checkcolor
End
End
// mainline
While $result = true
delay 600000
loop 2
Call Work 279, 752, 762, 140
Call Work 396, 749, 810, 171
Call Work 496, 757, 862, 198
Call Work 592, 761, 909, 224
Call Work 682, 757, 960, 256
end
end
I have a suspicion though, that this isn't the entirety of the code, in which case what I've put in the "mainline" segment here,
probably needs to be proceduralized...
-Triane