PDA

View Full Version : Wizbot documentation



imported_Kranar
07-07-2003, 05:24 PM
Anyone know where I can find a readme file with all the commands available for the Wizbot scripting engine?

Cain
07-17-2003, 11:41 PM
I've been looking for that forever but to no avail. I got IF statements and the counter down, that's about it. So let me know if ya find anything else out.

BigWorm
07-24-2003, 03:32 AM
Last modified: March 9, 2001

WizBot Documentation
====================

You'll have to deal with bare bones documentation for the moment.

WizBot is a telnet application designed to run pre-made scripts. To connect, choose File -> connect, choose the address and port, and click connect. A button is provided for easy connection using Gemstone's launcher information.

A script is a text file with the extension .cmd that resides in the application's script folder. To execute a script, type a '.' (period) followed by the script name. Anything that follows the script name is sent to the script as parameters %1 .. %n. This should work with most Wizard FE scripts with perhaps only minor tweakings.


To connect to Gemstone
======================
Right when you are about to click to enter the game, right click and 'save as' to a known location and open it. Inside you'll note the server address and port you want to connect to. Once you connect, enter the value shown as your key twice and you'll be connected. There's a button on the connection window that will do this for you.


Important information to be aware of
====================================
"The Buffer"
The buffer is an all too important thing to be aware of. You need to be aware of it in the script usage. The buffer is a big block of data that is stored for use in the matching commands (MATCH, WAITFOR). Some operations, such as PUT - flush the buffer completely, whereas others - WAITFOR for instance, truncates the buffer up to and including the first letter of the match. Matching the string "cow" in the sentence "That lady is a cow!" would crop the buffer down to "ow!".

Keep in mind that when the MUD sends me data - it comes in spurts. Sometimes more than one line at a time is sent - so if you're matching in the following:
MAIN:
MATCH WHISPERER [TARGET] whispers, "[TARGET_DATA]"
MATCH SPELLREADY Your spell is ready.
MATCHWAIT

WHISPERER:
PUT whisper [TARGET] leave me alone!!
GOTO MAIN

.. and multiple lines are receive from the MUD that include first the whisper and then the match for SPELLREADY, you would never receive the message as the matching buffer would be flushed on the PUT. Because of this - i've included a different set of "non-flushing" commands to use. SEND is a non-flushing version of PUT - and DELAY is a non-flushing version of PAUSE/WAIT.

Now don't blindly replace all your PUTs with SENDs and PAUSEs with DELAYs - there's a NEED to flush all this crap. Firstly - you don't want to be a memory hog (though the buffer is kept pared down to a reasonable size), but mainly - that's not the way things operate. If you PUT look and want to MATCH a '[' signifying entering a new room - you'd not want the previous rooms description to be found by your MATCH.

"Variables"
Another thing to be aware of deals with the way variables are used. Since variables are enclosed in brackets, this can sometimes cause problems with current scripts. If you're MUST use a left bracket in a match (like looking for a room title), preface it with a \.
MATCH [Town Square, East]
.. becomes ..
MATCH \[Town Square, East]


Function Reference
==================

VARIABLE
Defines a variable to be used in the script.

Usage:
VARIABLE [<name>] [initial value]

Examples:
VARIABLE [NUMCOINS]
VARIABLE [NUMATTEMPTS] 5

WAITFOR You have [NUMCOINS] coins.
ECHO I have [NUMCOINS]! I'm rich!

----------------------------------------------------------
HILITE
Defines a strin to highlight a different color.

Usage:
HILITE [color] [text]

[color] = A hex number defining the color RRGGBB
= A string ID for the color:
RED, LT_RED, GREEN, LT_GREEN, BLUE, LT_BLUE,
YELLOW, ORANGE, WHITE, MAGENTA

Example:
HILITE FF0000 Wooly Mammoth
HILITE F0FA12 a giant rat
HILITE GREEN a green sapphire
----------------------------------------------------------
WAITFOR
Wait for specified text.

Usage:
WAITFOR <text>

Examples:
WAITFOR Your spell is ready.
WAITFOR You have [NUMCOINS] coins.

----------------------------------------------------------
LOG
Log to the user log text.

Usage:
LOG <text>

Example:
LOG Currently have [NUMCOINS] coins.

----------------------------------------------------------
SCRIPT
Call a different scripting file.

Usage:
SCRIPT <script name>

Example:
SCRIPT pickpocket

----------------------------------------------------------
COUNTER
Manipulate the counter. (A special int variable.)
Counter starts at 0, and is referenced by %C in scripts.

USAGE:
COUNTER SET <value>
COUNTER ADD <value>
COUNTER SUBTRACT <value>
COUNTER MOD <value>
COUNTER DIVIDE <value>
COUNTER RANDOM <maximum value>

Example:
COUNTER RANDOM 8
GOTO IDLE%C

----------------------------------------------------------
GOSUB
Jump to an index and execute the commands until you see
the command RETURN. Then return to your script place.

Usage:
GOSUB <index>

Example:
GOSUB ROOMPEOPLE
GOSUB ROOMEXITS
MATCHWAIT

ROOMEXITS:
MATCH SEEROOM Obvious paths:
MATCH SEEROOM Obvious exits:
RETURN

ROOMPEOPLE:
MATCH SEEPEOPLE Also here:
MATCH SEEPEOPLE Also in the room:
RETURN

----------------------------------------------------------
RETURN
See GOSUB

----------------------------------------------------------
PAUSE
Pause the script and ignore text.

Usage:
PAUSE <time in seconds>

Example:
COUNTER RANDOM 8
COUNTER ADD 1
PAUSE 0.%c

----------------------------------------------------------
DELAY
Pause the script and but do not ignore text.

Usage:
DELAY <time in seconds>

Example:
COUNTER RANDOM 8
COUNTER ADD 1
DELAY 0.%c
MATCH SOMEONETALKED [TARGET] says, "[TARGET_DATA]"
----------------------------------------------------------
PUT
Send text to the console.

Usage:
PUT <text>

Examples:
PUT deposit [NUMCOINS]
PUT 'Thanks ma'am!
PUT emote doffs his cap courteously.

----------------------------------------------------------
INDEX
A marker for scripts to reference.

Usage:
<index>:

Example:

GOTO LIVE
PUT sign of hopelessness
exit
LIVE:
PUT sing oh it's good to be alive.

----------------------------------------------------------
GOTO
Goto a script index.

Usage:
GOTO <index>

Examples:
GOTO LIVE
GOTO IDLE%C

----------------------------------------------------------
SHIFT
Shift the input parameters.

Usage:
SHIFT

Example:
(script called with parameters laugh cry snort)
START:
IF_1 GOTO GESTURE
exit

GESTURE:
PUT %1
SHIFT
GOTO START

----------------------------------------------------------
MATCH
One of a group of WAITFOR objects - the pause is triggered
by a MATCHWAIT command.

Usage:
MATCH <index> <text>

Example:
MATCH SMILE You see a young flower girl.
MATCH FROWN You see Drizzdt.
MATCHWAIT

----------------------------------------------------------
MATCHWAIT
See MATCH

----------------------------------------------------------
EXIT
Terminate the currently running script.

Usage:
EXIT

Example:
PUT 'I'm gonna do it!
EXIT
PUT lick my broadsword

----------------------------------------------------------
ECHO
Echo text to the console but don't transmit it to the MUD.

Usage:
ECHO <text>

Example:
ECHO Running idle script #%C
GOTO IDLE%C

----------------------------------------------------------
MATH
Simple mathmatical functions on variables.

Usage:
MATH <var name> RANDOM <amt> (0 to amt-1)
MATH <var name> RANDOM <min> <max> (min to max)
MATH <variable name> = <variable name or const> <operator> <variable name or const>

Valid operators:
+ = Add
- = Subtract
* = Multiply
/ = Divide
% = Modulus

Examples:
VARIABLE [IDLE]
MATH [IDLE] RANDOM 8
GOTO IDLE[IDLE]

INCCOUNT:
MATH [COUNT] = [COUNT] + 1
MATH [COUNT] = [COUNT] % 10
RETURN

----------------------------------------------------------
IF
Check for a comparison to call a function.

Usage:
IF_<number of parameter> <command>
IF <variable name> <operator> <variable name or const> <command>

Valid operators - <, >, =, <=, >=, <>

Examples:
IF_1 ECHO Data at parameter #1 = %1
IF %C > 10 ECHO Counter overload! OH NO!!!
IF [TARGET] = "Lord ABC" GOTO SALUTEABC

----------------------------------------------------------
SAVE
Save data to a variable.

Usage:
SAVE <text> -- saves data to the internal %s variable
SAVE <defined variable> <text>

Example:
SAVE %C
COUNTER RANDOM 9
PAUSE %s.%C

SAVE [COUNT] %C

----------------------------------------------------------
NEXTROOM
Essentially a WAITFOR Obvious paths: or Obvious exits:

Usage:
NEXTROOM

Example:
PUT east
NEXTROOM

----------------------------------------------------------
MOVE
Essentially a PUT with a NEXTROOM attached to it.

Usage:
MOVE <direction>

Examples:
MOVE east
MOVE go bank

----------------------------------------------------------
FLUSH
Flush the text buffer. For internal storage and match
comparisons.

Usage:
FLUSH

----------------------------------------------------------
FILE
File access for simple storage and recollection.

Usage:
FILE PURGE <local filename>
FILE WRITE <local filename> SECTION INDEX VALUE
FILE READ <local filename> SECTION INDEX VARIABLE DEFAULT
FILE MOVE <local filename> MOVEFILE

Examples:
FILE PURGE treasure.txt
FILE MOVE friends.txt friends_backup.txt
FILE READ friends.txt [TARGET] active [TARGET_ACTIVE] 0
FILE WRITE friends.txt [TARGET] active 1
----------------------------------------------------------
SEND
Send text to the buffer, but do NOT flush the buffer.

Usage:
SEND <text>

Example:

PRECAST:
MATCH CASTSPELL Your spell is ready.
MATCH INTERRUPTED [TARGET], whispers "[TARGET_DATA]"
MATCHWAIT

INTERRUPTED:
SEND whisper [TARGET] shhhh .. wait a moment.
MATCH CASTSPELL Your spell is ready.
MATCH PRECAST You whisper
MATCHWAIT
----------------------------------------------------------




Contact info
============
bakleldem@yahoo.com
http:\\members.xoom.com\bakleldem

imported_Kranar
07-24-2003, 04:12 AM
Much appreciated. Thank you.

Cain
07-28-2003, 12:53 AM
Anyone tell me where I can get a copy of Wizbot that can take advantage of the Hilite function mentioned in posted documentation? My version doesn't seem to recognize Hilite . Email me at rrtech123@yahoo.com

gcstader
08-02-2004, 11:34 PM
Wow, just download WizBot. These functions are amazing. Time to completely rehaul my hunting scripts.

gcstader
08-02-2004, 11:54 PM
Can't seem to get WizBot to connect. I downloaded the .sal file for my char but wizbot gets disconnected every time. I think it's an older version and there might be a patch out there somewhere. I'm usin ver. 0.8.0.1
If someone has the patch please post it, can't find it on the internet.

Thanks
~Greg / Eldas

Deathravin
08-04-2004, 04:42 PM
I don't think it works with GS4. Wizbot is actually pretty shitty only becasue of the the variable extraction doesn't work well.

for instance:
>
Character1 laughs
>
Character2 Taps you on your shoulder.
>

if you do a script to see

[person] taps you on the shoulder.

the [person] variable would be "Character1 laughs > Character2"


He was rumored to have fixed that problem in a new version, but I have yet to find a version that doesn't do that.