New Zealand
Asked — Edited

Simple Greeting Script

Here's a little script to save you some time.... Hopefully the first of many....

#------------------------|

Simple Greeting Script |

#------------------------|

Print ("+------------------------------------------------+" ) Print ("| Responses = Good Morning, Afternoon or Evening |" ) Print ("+------------------------------------------------+" )

IF ($hour>-1 and $hour<12 ) say ("Good morning." ) ELSEIF ($hour>11 and $hour<18 ) say ("Good afternoon." ) ELSEIF ($hour >17 ) say ("Good evening." ) ENDIF

Halt()


ARC Pro

Upgrade to ARC Pro

With ARC Pro, your robot is not just a machine; it's your creative partner in the journey of technological exploration.

#1  

Love the scripts you have been posting.

These help out a lot since I'm not a programmer. I have been coping them down in a script folder and plan on using the later.

Again ... Thanks

#2  

Thanks tameion, youve shown that writing a little code can be easy!

United Kingdom
#3  

@irobot, it really can be very easy. Once you get to know what commands do and how etc. it's a piece of cake. That's the thing with scripting, it's all very logical, it has to be by nature:)

I'm still learning but I have a good idea at what I'm doing now. I'm hoping that my scripts I've been sharing and updating with commentary will aid others in understanding it all and learn at the same time I learn.

It's very daunting looking at a huge 2,000 line script with multiple nests of IFs ELSEs ANDs and ORs but break it down in to smaller chunks (or snippets) and you can make sense of each part one by one then see how they all fit together, then write your own.

@tameion's script shows how to take a variable, examine it and give a response depending on the content of the variable. It could be easily modified for the four seasons, 12 signs of the zodiac (I believe that's something you have metioned @irobot?), day and night, weekday or weekend... you get the idea (I hope).

This is exactly why I thought having a section of the forum for scripting was screaming out for being requested. The cloud is great and everything but there was no real area for discussion, help and just looking at it and trying to follow it.

#4  

@RichMR2 I whole heartedly agree! I think writing script may be a lot like writing a language which requires structure but can be very creative as you have shown many times with a task that can be "scripted " in different ways. I cant agree MORE about having forum for script. At this time in FRED's development(not robotmaker Fred) I use the random script, 80 percent of my file to always give the voice outputs a quasi AI and uncertainty in its "personality" . While I do like the "personality generator ' and do use it , its doesnt quite fill my requirement. I also look forward to the day when I can be more "helpful" with script and electronic circuits to members. My current saved file stands at 28 Megs with out any servo scripts as I just recieved my first EZ(and like you and others waiting to aquire more)|...like you said in a previous script, "its gonna be cold in the house and eating less food" ...LOL I think loosing a little weight is a good thing and drinking a little less as well, to aquire something tangible and fun is ok! I am looking forward to posting my Project Showcase FRED soon