loading
 
Roborealm Vbscript Problem
Anonymous
16 year
I dont know if Im posting this in the right place but i have a small problem with roborealm vbscript module, how do i make a delay between commands that i have written in the vbscript ?
Anonymous 16 year
See the following url on the sleep command http://mikesalsbury.com/mambo/content/view/133/
Anonymous 16 year
Also have a look at this previous post on the usage of SetTimedVariable.

http://www.roborealm.com/forum/index.php?thread_id=2080#2

STeven.
Anonymous 12 year
Hello everyone...

Below are my variables in VBScript.
---------------------------------------------------------------------------------

shapeLabel = GetStrVariable("SHAPE_LABEL")

if shapeLabel = square then
  SetVariable "left_motor", 0
  SetVariable "right_motor", 255
  SetVariable "coordinate_i", 0
  SetVarivale "coordinate_j", 0

else
  if shapeLabel = circle then
    SetVariable "left_motor", 255
    SetVariable "right_motor", 0
    SetVariable "coordinate_i", 0
    SetVariable "coordinate_j" 100
  else
    SetVariable "left_motor", 255
    SetVariable "right_motor", 255
  end if
end if

------------------------------------------------------------------------------
I want the coordinate value appear in screen. but when i apply the display variable.. no value of coordinate appear. pliz help me.

:)
Anonymous 12 year
First off you are missing quotes around the comparisons to square and circle. Try

---------------------------------------------------------------------------------

shapeLabel = GetStrVariable("SHAPE_LABEL")

if shapeLabel = "square" then
  SetVariable "left_motor", 0
  SetVariable "right_motor", 255
  SetVariable "coordinate_i", 0
  SetVarivale "coordinate_j", 0

else
  if shapeLabel = "circle" then
    SetVariable "left_motor", 255
    SetVariable "right_motor", 0
    SetVariable "coordinate_i", 0
    SetVariable "coordinate_j" 100
  else
    SetVariable "left_motor", 255
    SetVariable "right_motor", 255
  end if
end if

------------------------------------------------------------------------------

and watch the case too ... ie is it "square", "Square" or "SQUARE"

STeven.
Anonymous 12 year
what if i want to use Cscript?


char*shapelabel = getVariable("shape_label");

int left_motor;
int right_motor;
int coordinate_i;
int cooridnate_j;

if (shapelabel = 'square')
{
left_motor = 60;
right_motor = 128;
coordinate_i = 0;
coordinate_j = 100;
}
else
{
  if (shapelabel = 'circle')
  {
    left_motor = 128;
    right_motor = 60;
        coordinate_i = 0;
         coordinate_j = 200;
  }
  else
  {
    left_motor = 128;
    right_motor = 128;
        coordinate_i = 100;
        coordinate_j = 200;
  }
}

setVariable("left_motor", left_motor);
setVariable("right_motor", right_motor);
setVariable("coordinate_i", coordinate_i);
setVariable("coordinate_j", coordinate_j);

why is it wrong?
Anonymous 12 year
Try "==" instead of a single equal

shapelabel = 'square'

should be

shapelabel == 'square'
Anonymous 12 year
thank you. How shall i write 'case' in VBScript?? so that the landmarks can be detect in sequence?
Anonymous 12 year
Do you mean select case ? http://www.w3schools.com/vbscript/tryit.asp?filename=vbdemo_selectcase

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index