Return to Fortebit website

Welcome to the Fortebit Helpdesk

Use the Knowledge Base to find the answer to your question,
or click on the chat icon to start a conversation with our Support team.

How do I modify the generated RoboBASIC code?
Let's say you want to modify the RoboBASIC code so that:

- Command 0=HELLO in Group 1 triggers action K1 (bow action)
- Command 1=MOVE in Group 1 will wait for another command out of Group 2, containing only two commands UP and DOWN, and then performs the action K2 or K3 respectively
- Command 2=ACTION in Group 1 will wait for a command out of Group 3 that contains numbers from 1 to 10 (1=ONE, 2=TWO, etc...)

That way you can use commands like ROBOT + HELLO, ROBOT + MOVE + UP/DOWN, ROBOT + ACTION + ONE...TEN (remember that ROBOT is the default trigger word).

Around line 360 of the generated code, you can write something like this:

'<--- implement actions based on VRGROUP and VRCOMMAND
'example:

IF VRGROUP = GROUP_0 THEN
VRGROUP = GROUP_1 ' activate command group
VRBLINK = 1 'blink
VRLED = 1 'on
ELSE
IF
VRGROUP = GROUP_1 THEN
IF
VRCOMMAND = 1 THEN ' Considering MOVE as word 1 of Group 1
VRGROUP = GROUP_2 ' Goes to Group 2
ELSE
IF
VRCOMMAND = 2 THEN ' Considering ACTION as word 2 of Group 1
VRGROUP = GROUP_3 ' Goes to Group 3
ENDIF
ENDIF
ON
VRCOMMAND GOTO K1,MAIN,MAIN 'K1 motion for HELLO (word 0 of Group 1)
ELSE
IF
VRGROUP = GROUP_2 THEN
VRGROUP = GROUP_0 ' back to trigger
VRBLINK = 0 'still
VRLED = 1 'off
'do command
ON VRCOMMAND GOTO K2,K3 'K2 and K3 motions for UP and DOWN
ELSE ' must be in Group 3
VRGROUP = GROUP_0 ' back to trigger
VRBLINK = 0 'still
VRLED = 1 'off
'do command
ON VRCOMMAND GOTO K4,K5,K6,K7,K8,K9,K10,K11,K12,K13 'K4..K13 are motions for ACTION + 0..10
ENDIF
ENDIF
ENDIF

GOTO
MAIN
[...]
4 of 12 people found this helpful.