Thread

memory bug in xelagot scripts (Bots)

memory bug in xelagot scripts // Bots

1  |  

xelag

Jul 13, 2003, 10:11am
A problem has been discovered in some of my (and surely in other's)
xelagot scripts. When a xelagot builds, deletes or modifies objects
in the world, a description of these objects is kept in it's memory
lists. If these lists are not cleared regularly, the bot will use
more and more memory.

I have checked all the scripts on my web page
http//www.imatowns.com/xelagot/xlgasexamplesidx.html
for this problem. The following scripts are affected and have been
patched

NaughtsAndCrosses (Tic-Tac-Toe)
PaintBall Bot
RandomTeleport Bot
DoubleWarps Bot
LaserTag Bot
Chess Bot
Checkers Bot

For the technically minded, the patch consists of this

1) Add, at the beginning of the script, a statement to clear all
RWX/COB objects from memory lists
ClearLists

you can also put ClearLists in the OnWorldEnterEvent (or in the
obsolete OnWorldReconnectEvent) handler, never elsewhere because it
can mess up 'objects in transit', i.e. commands to build, modify or
delete objects sent to the world server but still not confirmed as
done by the server.

2) Add the following Subroutine

Sub ClearConfirmed
ClearListAS
ClearListAF
ClearListDS
ClearListDF
EndSub

3) and call it periodically, for example at the begining of a game

Gosub ClearConfirmed

This will clear all objects stored in the confimed lists (AddSuccess,
AddFailed, DeleteSuccess, DeleteFailed)

That's all. This patch need only be applied, of course, to scripts
that add, delete or modify objects regularly, like some games do.

Alex

themask

Jul 13, 2003, 5:57pm
Why don't you make a side in the Xelagot bot like a news and update popup
that people can turn on and off, and they just can click update :)

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