Asked — Edited

This Script Used To Work

Not sure what happened here. This tiny fun script used to work and now it does not. Anyone interested in taking a look at this.

IF ($month = 4 And $day =16)
sayezb("happy birthday christian")
sleep(1500)
 

ElseIf ($month = 4 And $day = 17)
sayezb("happy birthday natalie")
sleep(1500)
 


 

ElseIf($month = 6 And $day = 12)
sayezb("happy birthday grace")
sleep(1500)

 


 
ElseIF($month = 10 And $day = 21)
sayezb("happy birthday cole")
sleep(1500)

EndIf

ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

#9  

It gets even more confusing when you have a bunch of "IF, ELSE and ENDIF" statements nested. I used to do this all the time and when something doesn't work it's hard to trace the problem... A while back when I first joined the forum @DJ (you probably don't remember) altered one of my scripts that had multiple nested IF statements. You showed me how to do the same thing without having to nest so many if statements... Funny, it was pretty simple so I am not sure why I never discovered it myself before ... Sometimes you will have to nest IF statements but try to avoid it if there is another way... Anyway, bottom line make your code easy to read so it's easy to follow the logic and debug...

#10  

I guess the thing is, is this used to work. Now it just says it randomly not waiting for its specific date.

#11  

This works perfectly for me...


IF($month = 4 And $day = 16)
sayezbWait("happy birthday christian")

 
ElseIf($month = 4 And $day = 17)
sayezbWait("happy birthday natalie")
 

ElseIf($month = 6 And $day = 12)
sayezbWait("happy birthday grace")


ElseIF($month = 10 And $day = 21)
sayezbWait("happy birthday cole")


EndIf

PRO
USA
#12  

@kamaran68

Is your ARC updated ? If not update and test again.

#13  

As a couple of us have said, your code works. Do you have another script that says "Happy Birthday" attached to a voice command? If so, maybe it's hearing that command and saying "Happy Birthday". If the code you attached is running it would have a name said after the "Happy Birthday"?

#14  

Nope, just that code all in one place, personality generator. When I tell the robot to " stop listening" it pauses speech recognition and starts personality generator. So the machine starts randomly looking around and says hello and a few other things. Then all of s sudden it just starts saying happy birthday and none of the dates match. Weird but I'm not going to worry about it anymore. Thanks