Asked — Edited
Resolved Resolved by Dunning-Kruger!

Random Personality Script Not Running

I cant seem to get this script to do anything other than to assign a random number to the $personality variable. When I run the script, it changes the variable and does nothing. I have been watching the variable change and it does hit 1, 2, 10 and 19 but nothing fires from there. Does anyone see anything wrong with the script? I am on version 2014.5.27 of the ARC software and this is running in a script manager. Thanks for any help you can provide.


# Get a response value
$personality = GetRandom(0,19)

If($personality = 0) 
  # dance

ElseIf($personality = 1)
  ControlCommand("Script Manager", ScriptStart, "TellMeAJoke")

ElseIf($personality = 2)
  ControlCommand("Script Manager", ScriptStart, "SayRandomFact")

ElseIf($personality = 3)
  #  ask if anyone else is getting hungery

ElseIf($personality = 4)
  #  Call Maples name and start autonimous movement

ElseIf($personality = 5)
  # make a huge expression then look down with your arms hung low.

ElseIf($personality = 6)
  #check the temp and if it is hot or cold, make a comment about it

ElseIf($personality = 7)
  #Act like you are reading

ElseIf($personality = 8)
  #look up and find someone, identify them, and ask how they are doing today.

ElseIf($personality = 9)
  #see if it dark and if so, see if it is after 9 PM.  if so, ask if it is bedtime

ElseIf($personality = 10)
  Say("Can I chase the ball?")
  :ChaseBall
  WaitForChange($QuestionsAnswer)
  if ($QuestionAnswer = "yes")
    ControlCommand("Script Manager", ScriptStart, "ChaseColor")
  Elseif ($QuestionAnswer = "no")
    #look sad
  else
    say("I did not hear you.  Can I chase the ball?")
  endif
  If($QuestionAnswer = "")
    Goto(ChaseBall)
  endif
  $QuestionAnswer = ""

ElseIf($personality = 11)
  say("Did you know it is ") 
  ControlCommand("Script Manager", ScriptStart, "SayTime")

ElseIf($personality = 12)
  #autonomous collision avoidance

ElseIf($personality = 13)
  #look mad and play mad sound

ElseIf($personality = 14)
  #sway from side to side and play song

ElseIf($personality = 15)
  #find someone and wave at them

ElseIf($personality = 16)
  #look sad and say eve

ElseIf($personality = 17)
  #scratch head - Thinking

ElseIf($personality = 18)
  #Raise arms and gears
  #Make yawn sound

ElseIf($personality = 19)
  #look up and find someone
  ControlCommand("Script Manager", ScriptStart, "FollowMotion")
  ControlCommand("Soundboard", Track_4)
  ControlCommand("Script Manager", ScriptStart, "kiss")
  Left(255,1000)
  Right(255,1000)
else
endif


ARC Pro

Upgrade to ARC Pro

Unleash your creativity with the power of easy robot programming using Synthiam ARC Pro

United Kingdom
#25  

lol Dave. If only women were logical... that may explain why I struggle to understand them most of the time:) The EZ-Script GetRandom() comes to mind whenever a woman gives an answer... Except for the Canadian ones of course (and any others who lurk in here but don't post)

This also gave me the opportunity to post and receive notifications without answering the issues. I am loving this topic as this is the way people learn most in my experience.

As a side note though, and it's probably just me but I prefer to assign variables with at least something to them rather than a $variable = "". Usually when I reset a variable I use $variable = "null". More than likely this is just me and my OCD but I don't like a variable to be empty.

#26  

Rich and Dave, I often get accused of being too logical:) I'm not the only girl like this. Lol.

I don't think it's so much about being a girl, it's just your personality as molded by environmental and genetic pressures:)