[Newbies] How can I execute a script on carriage return?

Steve Thomas sthomas1 at gosargon.com
Fri Feb 25 06:37:42 UTC 2011


I just discovered Bots Inc. and am trying to render some of the lessons
within Etoys.

In Bots Incs. when you click on a Bot a balloon pop's up and when you enter
text and hit <return> the text you entered is executed.
How can I execute a command (do it) on <return>?

Also, I have a script that on mouse over prints:

Im a Bot.
My position is: 769.5 at 452.5
and my direction is:34.3357941965284


How do I print integers or specify that I only want 2 digits to the right of
the decimal point? (Below is my script).
script1
| tmpStr |
tmpStr := 'Im a Bot.\My position is: ' withCRs , self getLocation
printString , '\and my direction is:' withCRs , self getHeading printString.
self sayText: tmpStr

Thanks,
Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20110225/2b70ea2b/attachment.htm


More information about the Beginners mailing list