I'm trying to convert an existing script, and now have a major problem with press(). The code I'm trying to get working is basically
C=get_exp_count
press "shoot_half"
press "shoot_full"
do
D=get_exp_count
until (D-C)>=j
release "shoot_full"
so it could convert to something like
count_initial = get_exp_count()
press( "shoot_half" )
press( "shoot_full" )
repeat
until ( get_exp_count() - count_initial ) >= count_target
release( "shoot_full" )
.
Here's the problem:
uBASIC version does what it's supposed to: presses shoot_half, (actually goes to loop already), presses shoot_full when shoot_half completed...
Lua version presses shoot_half and goes to loop, but shoot_full never gets pressed.
Why?
I have no idea. Could this have something to do with stack manipulation?