Thread

Xelagot Scripting (Bots)

Xelagot Scripting // Bots

1  |  

rc dodge viper

May 18, 2001, 9:01am
I would like to know how to get a line break in an Xelagot Bot. I am working
on an RPG Bot and want breaks for my stats like at AD&DRPG. I just don't
know how to do that. Kinda like CONTROL + ENTER only in a script. I want it
to say one line of the stats then another right after that. I tried using
"WhisperConcat" but that puts a peroid at the end of everything and it
doesn't break the line like a speech. I will send you the stats section of
the script if you need it. Otherwise just post the answer right here.
Thanks!

grimble

May 18, 2001, 9:38am
According to the help files (I've only played with Xelags out of curiosity)
....

Concat $b "This is a line break" #13 #10
Concat $b $b "so this starts at a new line"

ASCII 13 is a Carriage Return and ASCII 10 is a Line Feed

Grims


[View Quote]

xelag

May 18, 2001, 12:48pm
Use #0 for line breaks in chat: the chat interpreter will see this as a sign
to sendt the message in two parts. To make sure your line also starts as a
separate chat line, surround your whole text with #0:

SayConcat #0 "this is the first line" #0 "this is the second one" #0

You can also do this like this:

Concat $a #0 "this is the first line" #0 "this is the second one" #0
Say $a

See http://www.imatowns.com/xelagot/xlgassay.html at the bottom of the page.

XelaG.

the first #0 makes sure the chatline is not stuck to a previous line in the
chat buffer, the last #0 does the same for any text that may follow. These
#0 are removed by the chat interpreter.

[View Quote]

rc dodge viper

May 18, 2001, 1:39pm
I read that and tried it. I think I was doing it wrong. I'll try again.
Thanks!

[View Quote]

rc dodge viper

May 19, 2001, 12:11am
Never mind I can't make an RPG on Xel, since it only handles one thing at a
time. Xelag would have to reprogram it to deal with multiple things at once
for every person instead of just one person at a time. I guess I gotta find
another bot.

[View Quote]

who

May 20, 2001, 12:28pm
No, that would be the fault of the scripter - not the bot.

[View Quote]

--
Cheers,

Who

tony m

May 20, 2001, 3:17pm
WW91ciByaWdodCBvbiB0aGlzIG9uZSwgd2hvLiBUaGUgWGVsYWdvdCAqY2FuKiBkbyBpdCwgYnV0
IGRvIHlvdSAqd2FudCogdG8/DQoNCiJ3aG8iIDxyaWN0YUByaWN0YS5uZXQ+IHdyb3RlIGluIG1l
c3NhZ2UgbmV3czozQjA3RDRDNS4yNzE0NzhBQUByaWN0YS5uZXQuLi4NCj4gTm8sIHRoYXQgd291
bGQgYmUgdGhlIGZhdWx0IG9mIHRoZSBzY3JpcHRlciAtIG5vdCB0aGUgYm90Lg0KPiANCg==

rc dodge viper

May 20, 2001, 9:42pm
But even in the iLab Script it will only tell a joke or something to ONE
PERSON AT A TIME. How would I make it handle two or more things at once for
who ever says "/stats" or whatever? The problem I am having is when two
people say "/stats" at the same time it only gives the stats to the one
person.

who

May 21, 2001, 12:04am
Hi,

> But even in the iLab Script it will only tell a joke or something to ONE
> PERSON AT A TIME. How would I make it handle two or more things at once for
> who ever says "/stats" or whatever? The problem I am having is when two
> people say "/stats" at the same time it only gives the stats to the one
> person.

You need the event to initiate a response that isn't label orientated.

It is difficult to have the scripted Xelagot correctly recognise things
when same events occur at the same time. Normally it is not a problem
for the player as the one that missed out just goes "Huh? Nothing
happened" and then repeat '/stats' and get the response. (A few seconds
delay - who really cares).

You can just about eliminate the problem using scripting techniques. I
don't know how your "stats" is called, but take a look at this little
gem from the Xelagot site:

When ResetTo is in a Sub called from the main part of the script (or in
a Sub called by a Sub called by the main part), it has an inmediate
effect.
When ResetTo is within an event handler. or in Subs called from the
event handler, it has no immediate effect: it does not affect the
execution of subs called by the handler nor resets the script pointer
until the moment the event handler has finished processing and exits.

There are a couple of methods to try and speed up the response. Like
EscapeTo (from the Xelagot website):

EscapeTo $label
It is very similar to ResetTo, but it always exits inmediately (there is
no difference in behaviour when it is in the main section and in the
event handlers): it exits all subs, clears the sub stack, clears the
Wait command and resets the script pointer to the line following the
specified label.

Thus, to get a better stats response, you are best to escape from the
chat event or perhaps you could call the response from within a Sub that
is generated by the chat event rather then returning to a label. Resets
and other pointers to labels will slow things down.

I have never tried the exercise, but you could try a few simple chat
event scripts with different response mechanisms and get a few people to
test them by asking multiple queries - see which performs best for you.

You will never actually get it to respond to requests received "at the
same time", but in reality, that is a rare case. And I doubt you will
find any other bot that will either.

--
Cheers,

Who

xelag

May 22, 2001, 12:54pm
In the iLab script, it handles any amount of requests by different people
simultaneously. You only hear yours, of course, because it uses whisper so
as not to flood everybody's screen :) Have a look in the iLab script to
find out how it does it.

If you handle all your code inside the Chat event handler (it must not be a
long action of course, that would block the script), all requests will be
honoured. Asking for stats should be ok to handle in the event handler, you
only need a few lines of code for that.

Long requests, like ones including building etc, can not be handled all in
the event handler: in such cases, I disconnect the chat event handler
temporarily, do an EscapeTo or ResetTo a label in the main part of the
script, handle the request there, reconnect the chat event handler and reset
the script pointer to the main loop. An example of this is the chess bot:
when the bot is clearing a board, it will not execute moves.

XelaG

[View Quote]

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn