It looks like I already fixed the really weird problem I mentioned before. However, the SetTimedVariable timeout parameter its not accurate at all. Now that I have experimented with it a little bit, it seems that the timeout takes twice the time it should. Also, the time intervals are not consistent. Here is a copy of the robo file, so you can check my prog flaws.
if GetVariable("k") = 1 then
SetVariable "k2",0
SetTimedVariable "k2",1,5000
SetVariable "k",0
end if
if GetVariable("k2") = 1 then
if GetVariable("COG_X") < 54 then
SetVariable "move", 4
SetTimedVariable "move",0,300
elseif GetVariable("COG_X") > 190 then
SetVariable "move",8
SetTimedVariable "move",0,300
end if
if GetVariable("COG_Y") > 190 then
SetVariable "move", GetVariable("move") OR 2
SetTimedVariable "move",0,300
elseif GetVariable("COG_Y") < 58 then
SetVariable "move", GetVariable("move") OR 1
SetTimedVariable "move",0,300
end if
SetVariable "k",1
end if
|
|