Xelagot script by Who 230147


Shadow Bot Guide

Some helpful hints and explanations on the Shadow Script   Click here to go to the actual script guide (read this page first though)

Question: I want to name my bot something different, I don't like the name "Shadow". How do I do that?

Answer: Easy! In the scripts advshadow1.txt and advshadow1a.txt alter the variable "Botname Shadow" to the name you want to use. Then log bot #1 in as that name and make sure you set a 'master' protocol account for it within the Xelagot server. Thats it, your bot has a new name. The Monster bots will detect the change automatically.

Question: Where do I find what you call "variables"?

Answer: Variables for Xelagot scripts are normally at the top of the script. They are declared with the "var" statement and then usually defined before the first label is declared. Most of the Shadow's variables will be found in the first 30-50 lines of the script before the first "Label".

Question: Oh rats, I am running your Shadow bot in AW and they just don't have enough Avatars to use as monsters or even as the male/female/alien av's for the Shadow itself :-(

Answer: No easy solution to this problem, your players will have to pretend even more than normal. May I suggest you befriend a suitable world owner with promises of setting up a really nice RPG style game for their world ;-)

Question: Oh heck, you have a time limit set for people to start playing again. How do I overcome this so someone can play again immediately?

Answer: There are 2 ways to do this (Actually there's 3, the 3rd will be discussed later on).
1. Open the file playeritems.txt and delete the last number (data field 10) beside the players name and save the file. The number will be huge, something like 3456.8473736223
or
2. Modify your Shadow to do this for you :) Instructions as following:-
Open your advshadow1.txt for editing.

(a). Paste the following "Label" after the last label before the "End" statement

Label resettime
OnChatEvent resett
$p = $c
Say Whom do you wish reset?
label rtime1
goto rtime1
Label rtime2
SListLoad /s_mydata $data
SListGetField /s_mydata $t %d6 $player
IfString $player <> $t Goto rtime20
GetDateTime !a
SListLoad /s_mydata1 $data1
SListSetField /s_mydata1 $t %d10 !a
SListSave /s_mydata1 $data1
Sayconcat "Time reset for " $t
OnChatEvent Chat
ResetTo start1
Label rtime20
Sayconcat "Sorry " $t " does not appear to have a record"
OnChatEvent Chat
ResetTo start1

(b). Look for the "Event Chat" section that appears after the "End" statement. Replace that Event with the following Event Chat.

Event Chat
  GetChatPerson &p
  GetChatLine $t
  GetName $c &p
  GetPosition @a &p
  IfString "start adventure" IsIn $t ResetTo gamestart
  IfString "make character" IsIn $t ResetTo character
  IFString $c = "<put your aw name here>" GoTo chatc
EndEvent
  Label chatc
  IfString "reset time" IsIn $t ResetTo resettime
EndEvent

IMPORTANT!! Make sure you change <put your aw name here> and put your AW nickname there instead.

(c). Add the following Event after "Event Chat" and before "Event Gender"

Event resett
  GetChatPerson &q
  GetChatLine $t
  GetName $c &q
IFString $c <> $p EndEvent
ResetTo rtime2
EndEvent

Thats it, save your advshadow1.txt and restart the script on the bot. say 'reset time' and your bot will ask and do the rest.
Note: This will only work on your command, other people will not have the right to reset the time.

==============================================

Question: I am having problems with the bot finding places like the weapons shop, potion shop etc it does nothing at the location I entered.

Answer: The locations used in the 2 locations files are the basis for getting the bot to do anything usefull. Close attention has to be paid when adding/editing locations, a simple error will ruin all your data. To demonstrate look at the location2.txt (this only has 12 locations).

Example:

Locations2.txt
#Locations for various events - you need 12 locations for these
# 1-weapon shop       2-Potion shop       3- Training guild   4- peasant (chat)   5 - peasant         6 - peasant         7 - peasant         8 - peasant         9 - peasant         10 - peasant         11 - food store     12 - bounty reward
1=0.799n 4.229e 2.00a,0.569n 3.845e 2.00a,0.204s 7.180w 6.00a,0.672s 6.729e 6.00a,0.633s 5.258e 6.01a,0.286s 5.258e 6.00a,0.311n 5.127e 6.01a,4.618s 1.619w 2.00a,1.172n 4.606e 2.00a,3.585n 0.411w 12.00a,0.704s 2.944e 2.00a,5.441n 0.629e 16.03a

Note the above will be word-wrapped on your screen here in the web browser, there are actually only 3 lines here. The first 2 are just explanatory and are ignored by the bot because each line begins with a # character. The locations are those stated on the 3rd line beginning with "1="

Things to remember:
Make sure your editor has not word wrapped the file when you edited and saved it. It must only be 3 lines including the 2 commented out (#) descriptive lines.
The 3rd line must begin with 1=
The 3rd line must have 12 co-ordinates separated by 11 comma's
Each coordinate must be written at 2.0a (2 metres) higher than position your avatar actually stands
Remember that 2.0a to a bot is 2 metres, even though when building with your AW browser that would mean 20 metres, bots and browsers are different.

How to check: After editing your file run the bot and start adventure. Teleport yourself to the first location less the 2 metres (you may have to move a little). The bot should initiate the weapon shop dialogue. If this is successful, teleport yourself to the 12th location (less the 2 metres again) and the bot should initiate the bounty reward scheme for collected heads.

If both succeed then your file is most probably correct.
If the 12th location fails there is an error in your line of locations. Check other locations to find the error point
If the first location fails then there is a serious error in your file.

NB: If the locations fail it is possible the bot will default all locations to GZ - you can try going to gz (you might have to alter your altitude a little once there). If the bot starts responding at gz then there are errors in the locations. Note: if you get a monster battle at gz the error is in locations1.txt, if you get a shop or peasant event the error is in Locations2.txt

==============================================

This page will be updated slowly :-)