Here are some explanations for the example user-defined buttons. Note that many of these buttons are included with MBot as examples to show you how to write your own button "scripts". You can always delete the ones you have no use for. (However, be careful about deleting any buttons with bracketed names, e.g. [PickAv], as these may be used by actions in the Behavior Table.)
Note: this page can be generated using the "Save button info as HTML" button.
Also see Quick & Easy Instructions and Object List buttons.
(root)
[CellFromZX]
Calculate cell page @pz @px and cell coords @cz @cx within page, from world coords @z @x.
[CitName]
Use this as a function $ftn["[CitName]",@avsession] to find a person's name from their citizen ID.
[CitNumber]
Use this as a function @ftn["[CitNumber]",$avname] to find a person's citizen ID from their name.
[DebugMsg]
Print debug message to a file.
[FindNote]
Returns the handle of the instance with the specified note.
[FName]
Extracts just the file name from a path+filename+extension.
[Height]
Calculate terrain height at coords. Use "Terrain/load terrain buffers" first.
[InstOfSession]
Get instance from session.
[Load zone list]
[PickAv]
Displays a list of nearby avs from which you can select one, and returns the av's name as a $ftn result.
[PickAvN]
Like [PickAv] except returns the chosen av's session instead of name.
[PickInst]
Displays a list of bot instances, and returns the instance of the one you choose.
[PickPos]
[Rights]
[Round]
[Save zone list]
[SetZone]
[Status]
[StoVL]
Converts a string of pipe-delimited values to a vlist.
[Texture]
Returns the texture of terrain at Z,X. Use "Terrain/load terrain buffers" first.
[VLtoS]
Converts a vlist to a string of pipe-delimited values.
[ZoneInfo]
Aliases - add new
Aliases - delete
Aliases - edit existing
These buttons let you add, delete or edit an alias that the bot will respond to in chat as if you used the bot's actual name.
Atdump
Attribs
Lists all AW attributes (although some may not be valid if there is no connection).
bounds from area
Creates a boundary string like "12000,11000,-236,-234" from a "safe" area.
Change Bot Name
Citizen info from nearby
Clear Error Log
Create Instance Button
Creates a button that will allow you to restart the current instance at the same location, with the same name, etc.
Create MultiInstance Button
Creates a button that will allow you to restart all current instances at the same locations, with the same names, etc. (Note: the script in the created button may be truncated if you have too many instances running at once.)
DeleteZone
EditUserDefs
Calls notepad to edit the macros file.
List locs
List locations of all avs present.
Load OLD zone list
Load zone list
reload behavior & buttons
report instIDs
Each bot has an Instance ID that can be used to uniquely identify that instance. The Instance ID persists even if that bot is disconnected and auto-recovered, causing the session and instance to change.
Roll call
All instances list their status.
Save all button Categories individually
Save All Buttons individually
This causes all action buttons to be written to individual .btn files to the folder you specify.
Save All Buttons names
Saves all button names to a file
Save button info as HTML
This button is used to create this web page! Any REM statement within curly braces that is placed at the begining of a button's code, will be put into the button's description on the web page. Use . and - as the first character in the REM statement to indicate the beginning and ending of a group of comments.
Save zone list
Score Timer OFF
Score Timer ON
The Score timer is used when broadcasting status messages to Magsbot clients.
Seek
When you click this button, the bot will search throughout the current world and report on whoever it finds. (Not really practical in huge public worlds like AW, but it can report everyone in a 100x100 private world in under a minute.)
SetAreaE
SetAreaN
SetAreaS
SetAreaW
(Formerly these were named "SetSafe..." etc.)
These buttons allow you to define a particular rectangular area. The @safe and @safe_ macros (along with several other similar macros) can then be used to determine if an avatar is within the defined area or not. (It's called "safe" because it was originally created for use with a paintball bot, to tell when an avatar is within the safe zone.) To define the area, move the bot into the general vicinity, then position your own avatar (i.e., in the AW browser) at the northmost limit of the area you want to define and click "SetAreaN", selecting your avatar name when prompted. You will also be prompted to enter a name for the area; if setting a safe area for paintball, then use "safe" for the area name; otherwise you can give the area any name you want to use with the @safe_ macro when writing your own script. Do the same for each of the other three limits, using the corresponding buttons.
SetBoundsE
SetBoundsN
SetBoundsS
SetBoundsW
SetZoneActive
SetZoneB
SetZoneE
SetZoneN
SetZoneS
SetZoneT
SetZoneW
Show NSWE boundaries
Shows the boundaries defined by the "SetArea" buttons.
Show Rights
World Expiration
World Release
World Rights
Lists the permissions for the current world, by citizen name.
WorldList-goto World
Optionally updates the list of running worlds from the universe server, then teleports the bot to the world you choose from the list.
zone from area
Creates a zone from a safe area.
ZoneInfo
Weather
# Dawn
# Day
# Night
# Sunset
% Day Timer OFF
% Day Timer ON
% Enter Sunrise,Sunset
% Weatherbot - Set to defaults
% Weatherbot settings
% WeatherBot setup
[CalcLightXYZ]
[Dawn]
[Day]
[GetWAttribs]
[Night]
[SetLight]
[SetLightByTime]
[SetLightByXY]
[Sunset]
Attribs - create weather button
Attribs - lighting
Attribs - save lighting, sky & ground
Lighting-Dawn
Lighting-Day,Cloudy
Lighting-Day,Fog
Lighting-Day,Heavy Fog
Lighting-Early,Clear
Lighting-Late,Clear
Lighting-Midday,Clear
Lighting-moonlit
Lighting-Night,Clear
Lighting-Night,Fog
Lighting-Spooky Dark
Lighting-Spooky Dark
Lighting-Sunset
Lighting-Sunset, early
Lighting-Total Dark
Lighting-Total Dark OFF
Build
[BuildDB]
[BuildObjLst]
[DelBlanks]
[DelFromDB]
[DelObjLst]
Build from DB
Build from obj list
Build from Propdump
Change Object
Change Owner from Obj list
CLOSE LOG
Create one object
Create selected from objlist
Delete blank items
Delete Direct from Survey
Delete duplicate objects in obj list
Delete from DB
Delete from obj list
Delete last object made
Delete Object
Delete selected from object list
Flock of birds
Instant Woods
Load (build) from Propdump
Make a Tree
OPEN LOG
Remove RWX extension
Replace from Obj list
Replace rwx from Obj list
Replace selected from object list
Search & Replace from Obj List
Seed at Target Position
Set relative mode
Chat
(Notes)
[AncLong]
Send an announcement, breaking it up into several lines if necessary.
[AncNear]
Make an announcement to everyone nearby.
[brdcast all]
Adds bot to public speaker permissions, broadcasts message, then removes bot from PS permissions.
[LoadChat]
[LongAnnounce]
[ReportLong]
[RndChat]
[SayLong]
Send an chat message, breaking it up into several lines if necessary.
[WhAnc]
Announce if possible, else whisper
[WhLong]
Send a whispered chat message, breaking it up into several lines if necessary.
[WhSay]
whisper or say, depending on value passed in @wh
Broadcast
Broadcast - all instances
Speak a message in broadcast mode, either the active bot only or all bot instances.
Random Chatter
Random Chatter - Delete List
Random Chatter - Load File
Random Chatter - Stop
Random Chatter - Stop All
The Random Chatter buttons are used to cause the bot to speak randomly from a list, previously loaded from a text file.
Recite from Text File
The bot recites the specified text file.
Recite from Text File-resume from last
Same as Recite from Text File above, except if interrupted (by a disconnect, for example), the bot will resume where it left off when this button was last used.
(Note that for either of the "Recite" buttons, the bot will speak out loud or whisper depending on whether or not names in the Nearby List window are selected for whispering. With the Storytelling system, the bot itself selects names on the Nearby List automatically, according to their location.)
Storytelling OFF
Storytelling ON
Storytelling PAUSE
The Storytelling system is a more complex way to have the bot recite text. Click the ON button to choose the text file and activate Storytelling. When Storytelling is on, the bot will whisper the text file only to avatars within a defined area. If all avatars leave the area, the story will stop. To define the Storytelling area, use the "Set Safe" buttons.
Database
[select dataset]
Add Field (mySQL)
Add Table
Change Field (mySQL)
Copy ObjLog to database
Delete Field
Drop table
Explain
Lookup name
Open Access ODBC database
Open Access OLE provider databse
Open dBase ODBC database
Open Excel ODBC database
Open mySQL ODBC database
Open Text ODBC database
Optimize table
Remove a table
Show fields
Show status
Show table info
Show tables
SQL command
Eject
Eject for 1 minute
Eject for 5 minutes
Eject for a day
Eject for a week
Eject tagged
Ejection List
Ejection List - Add
Ejection List - Remove
Ejection List to File
Lists
[CopyStrLst]
[CopyToVList]
[Renumber]
Clear obj list
Click Log
Compare string lists
Copy entries from obj list
Copy Numeric List
Copy specified from Obj List
Copy String List
Delete duplicate entries in obj list
Delete duplicate entries in vlist
Delete entries from obj list
Find in string list
Free Selected VLists
LoadPosList
Merge String Lists
Node Log
Object Log
Read node list from file
Read obj list from file
Read propdump into obj list
Read propdump into vlist
Renumber list
Save node list to file
Save obj list as propdump
Save obj list to file
SavePosList
Search obj list for string
Selection Log
Show All VLists
Show Numeric List
Show String List
Movement
(Notes)
[Patrol]
[PatrolResume]
[PatrolStop]
[PickPos]
[RndMove]
[RndMoveStop]
[WalkStop]
[WalkTo]
Clear Markers
Clear Positions
Drag Avatar
Drag Avatar - Stop
Enter Bookmark
Follow - Stop
Follow - Stop (ALL)
Follow Target
Following - Stop (ALL)
Goto A'tuin
Goto Avatar
Goto Avatar position
Goto Bookmark
Goto Magine's Gardens
Goto Marker
Goto object
Goto Position
Goto zone NWB corner
MoveToward - Stop
Patrol
Patrol - Stop
Patrol - Stop All
Random Movement
Random Movement - Stop All
Random Movement - Stop;
Set Bookmark from Bot
Set Bookmark from Target
Set Marker from Bot
Set Marker from Target
Set Position from Bot
Set Position from Target
Teleport Target
Walk To Marker
WalkStop
Warp Target
Warp Target to Bot
Warp Target to Target
Warp to object
Quiz
Quiz - scores
Quiz - show tags
Quiz - start
Quiz - stop
Recorder
(Notes)
[Play]
[Playback]
[PlayF]
[PlayFile]
[PlayMem]
[RecAvChg]
[RecChat]
[RecStart]
[StopPlay]
PLAYBACK
PLAYBACK (warp)
PLAYBACK STOP
RECORD
RECORD STOP
Remote
[ListNB]
[SendBMsg]
[SendMsg]
[Transmit]
Release Control
RemoteListVars
Send Chosen Button
SendABehavior
SendBehTable
SendButtons
Verify Control
Survey
[DBLogObject]
[DBOpenObjLog]
[LogObject]
DBOpenObjLog
Log from 15x15 Survey
Log from 25x25 Survey
Log from 5x5 survey
Log from Survey
Log from World Survey
Log Live OFF
Log Live ON
Log Objects by Click
Log Objects by Click - Stop
Log Objects by Select
Log Objects by Selection - Stop
Log One Object
Log Replace (world)
Log to DB from Survey
Log to DB from World Survey
Log to vlist from World Survey
Open ObjLog DB
Resolve Select Log
Resolve Select Log - WORLD
Survey for atm
Survey for Object by Number
Survey set relative mode
Survey World in Sections
Terrain
[BuildNodeLst]
[LogNd]
[LogNode]
Build from node list
Build Node
Build terrain page
dump buffers
Dump Node
free terrain buffers
load terrain buffers
Loads terrain info for the whole world into buffers that are used by the [Height] and [Texture] functions.
Log from Terrain Query
move all instances to height
move to height
Raise Ground
Set Area height & texture
Set height at location
Set Nearby height
Set Nearby height & texture
Set World height & texture
Set World texture
Trivia
Trivia - End
Ends the Trivia game
Trivia - Start
Causes the bot to respond to requests to play trivia. The functionality for running a trivia contest is already in the sample Behavior Table. To run trivia, you should create a file "trivia.txt" in the same folder at MBot.exe, containing questions and answers. Each line of the file should contain one question and the correct answer, separated by a tilde ~.
Trivia Score
Shows the trivia score.
Universes
Universe-ActiveWorlds
Universe-CityForAll
Universe-DreamlandPark
Universe-Eduverse
Universe-OuterWorlds
After clicking one of the Universe buttons, the default information for new bot instances will be set to the corresponding universe. The code in these buttons is very simple; if you want to make a new button for another universe, just edit one of these to see an example.