This script runs only in 3.1 world servers (build 30 upwards)
It requires: X1 version 2.9999967 or up, or Av99/SrvcXlgbot 2.0 or up.
This bot script counts the objects in the world once every minute, and updates a sign. Scripters could combine this code with other scripts, for example, with the WorldScedule bot (I leave that to you, people!).
There are two versions of this script: one, the caretaker version, stays in the world and resets the world attributes; the second, the bouncing version, bounces in and out of the world to refresh the object count. Both versions have this in common:
There are two script files, which must be kept in the same folder:
%Interval = 1 %Debug = 0 $Action = " name @@@," $Desc = "objects in world: " $File = "ObjectsInWorld_Sign.txt"%Interval is in minutes, the bot waits %Interval minutes before changing the sign again. Leave %Debug = 0, it is used to test the script (if = 1, then the bot says things aloud). $Desc is the part of the description in the sign just before the number of objects. You can change that to suite your needs.
The caretaker version requires that the bot be Caretaker. It works fine for visitors using a 3.0 or a 3.1 browser, but 2.2 browsers have a small problem with this bot: by resetting the world attributes to refresh the object count, the web page in 2.2 browsers gets reset to the world url once every cycle (by default, once a minute).
Download the script for the caretaker version.
The bouncing version does not require that the bot be caretaker, and works well with all browsers. The bot leaves the world and re-enters to refresh the object count once every cycle (by default, once a minute). This can produce a lot of internet traffic in populated areas, so the bot should be moved far away from people and bots when running this script. (For the Setup, it must be near the object). You may also decide to change the default interval from 1 minute to longer, for example, 5 minutes. You can do that by changing the %Interval in the ObjectsInWorld2.txt file from 1 to 5 or more.
Download the script for the bouncing version.