Thread

Counting my Avatars (Sdk)

Counting my Avatars // Sdk

1  |  

john viper

Sep 11, 2001, 8:17am
Howdy <http://polygon.imatowns.com/images/smiles/icon_smile.gif>

I have been pondering a problem for a little while now. What I am trying
to do is make a bot that will count the number of avatars in a given
area of land, and if this is larger than the chat radius, it will divide
this land into regions, and teleport from one to the next, and then
start back from the beginning. I have everything down except for one
thing: Does anyone know how I could count the avatars in the bot's
current location?

A thought I have had is to set up an event handler for
AW_EVENT_AVATAR_ADD, call aw_wait(), have my handler just add the avatar
count to a global variable of some sort while a timer suspends other
execution for a few seconds. However, this seems inefficient to me.

I know that I have seen in some bot somewhere the ability to say the
names of all the avatars in its presence (for example, "Who is here"
would receive a reply of "John Viper, Citizen, 'tourist' and [bot] are
here.") Perhaps this was done a similar way: the bot had an internal
storage system holding information about the users, but I always thought
that there was some specific call that could be made through the SDK,
and if not, there were some other, more efficient way of doing it than
my method mentioned above.

Thanks for any help you can provide!

-JV
--
John Viper (#296714)
jviper at jtsoft.net
http://www.jtsoft.net

"Life on Earth may be expensive, but it does include a free trip around
the sun..." -anonymous

john viper

Sep 11, 2001, 8:51am
daggone it... Well you know where I copy-and-pasted this message from lol

[View Quote] > Howdy <http://polygon.imatowns.com/images/smiles/icon_smile.gif>


--
John Viper (#296714)
jviper at jtsoft.net
http://www.jtsoft.net

"Life on Earth may be expensive, but it does include a free trip around
the sun..." -anonymous

xelag

Sep 22, 2001, 4:35pm
The only way is to store the avatars' attibutes when you get an
avatar-add event, to modify them at avatar_change and to remove them
at avatar_delete and when you exit the world/universe. By counting
the items (avatars) stored in this way, you always know how many there
are. At every location you arrive at, give the bot some time to
receive the avatar_add events.

XelaG

[View Quote] >Howdy <http://polygon.imatowns.com/images/smiles/icon_smile.gif>
>
>I have been pondering a problem for a little while now. What I am trying
>to do is make a bot that will count the number of avatars in a given
>area of land, and if this is larger than the chat radius, it will divide
>this land into regions, and teleport from one to the next, and then
>start back from the beginning. I have everything down except for one
>thing: Does anyone know how I could count the avatars in the bot's
>current location?
>
>A thought I have had is to set up an event handler for
>AW_EVENT_AVATAR_ADD, call aw_wait(), have my handler just add the avatar
>count to a global variable of some sort while a timer suspends other
>execution for a few seconds. However, this seems inefficient to me.
>
>I know that I have seen in some bot somewhere the ability to say the
>names of all the avatars in its presence (for example, "Who is here"
>would receive a reply of "John Viper, Citizen, 'tourist' and [bot] are
>here.") Perhaps this was done a similar way: the bot had an internal
>storage system holding information about the users, but I always thought
>that there was some specific call that could be made through the SDK,
>and if not, there were some other, more efficient way of doing it than
>my method mentioned above.
>
>Thanks for any help you can provide!
>
>-JV

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