Guest
Feb 5, 2012, 9:42 pm UTCHome arrow Examples arrow Simple Walker Bot
header image
Simple Walker Bot
Written by Dream Dancer   
Feb 17, 2008 at 09:39 AM

Simple bot walking script which does not flash the bot across the screen, you can watch it move.  Unless you like sudden speedy appearing bots that is. Grin

First you may find it prudent to add the follow line to your start up trigger:

Trigger Name: Start Up
Connection establishes
   No Additional Conditions.
THEN:
      Store {FALSE} to variable {[skipping]}

Once you have that, you construct an Action which captures your walking command:

Action Name: Walker
 Stop Action Search if TRUE
If {Dreamless|Dancer} Whispers me {walk *}
   No Additional Conditions.
THEN:
      Store {1} to variable {[skipper]}
      Store {TRUE} to variable {[skipping]}
      Store {[startingword2]} to variable {[walking]}

Then you make a timer which steps through the string you stored and moves the bot accordingly:

Timer Name: Walker
When {0.2} seconds has passed
AND:
    if variable {[skipping]} is the same as {TRUE} (text comparison)
THEN:
$ Begin Wolfscript: (1)
// walk a path in steps
&newvar #count &getvar(skipper)
&newvar #path &getvar(walking)
&newvar #length &len(#path)

// below is optional for displaying the sequence of the walk
&newvar #where {Step: }
&join #where #count
&join #where {:}
&join #where #length
&display #where

// end display step sequence
&ifn #count > #length
  &setvar skipping FALSE
  &setvar skipper 0
  &exitwolf
&endif
&newvar #point &mid(#path #count 1)
&movebot #point
&add #count 1
&setvar skipper #count

$ End Wolfscript: (1)

Ta Da! You could try going faster, but the 0.2 seems to work best for fluid movement.

Last Updated ( Feb 17, 2008 at 09:41 AM )
<Previous   Next>
header image