Hello,
I´m using this code:
x = GetVariable("HIGHEST_MIDDLE_X")
midx = GetVariable("IMAGE_WIDTH") / 2
leftThreshold = midx - 50
rightThreshold = midx + 50
if x <= leftThreshold then
SetVariable "left_motor", 0
SetVariable "right_motor", 255
else
if x >= rightThreshold then
SetVariable "left_motor", 255
SetVariable "right_motor", 0
else
SetVariable "left_motor", 255
SetVariable "right_motor", 255
end if
end if
And i have a problem.
What i need:
if: SetVariable "left_motor", 0
SetVariable "right_motor", 255
i need to send key R
And if
SetVariable "left_motor", 255
SetVariable "right_motor", 0
i need to send key L
I have tried putting some vbscript sendkey commands what i found from google. Like:
objShell.SendKeys "L"
But these dont work.
I´m not very good at coding these languages. Wish it would use php.
|
|