Thread

Help Simple avatar bot (Bots)

Help Simple avatar bot // Bots

1  |  

c p

Feb 11, 2004, 3:04pm
I need a bit of help with my bot, id like it so people can click an avatar
object and it changes them to that avatar, for example I click Hotep and it
changes them to hotep.

c p

Feb 11, 2004, 3:05pm
Oh btw VB please.
[View Quote]

lord fett

Feb 11, 2004, 6:25pm
Well... you'd have to setup a database type thing that stored av names to
their av number in the avatars list... So something like that...

Public Function get_avnum(name as string) as long
Select Case name
Case "Hotep"
get_avnum = 5
Exit Function
Case "Sarah"
get_avnum = 13
Exit Function
End Select

get_avnum = -1

End Function

So, to set it up, you'd need to put the avatar names in the object
descriptions, so when someone clicks, you can setup an object_click event
like the one below.

Public Sub sdk_EventObjectclick()
Dim i as long

i = get_avnum(sdk.aw_string(AW_OBJECT_DESCRIPTION))
If i = -1 then Exit Sub 'Object isn't an valid avatar

sdk.aw_int_set(AW_AVATAR_TYPE, i)
sdk.aw_avatar_set(sdk.aw_int(AW_AVATAR_SESSION))

End Sub

Hope that helps. There are other things that you can do to make it better,
but this is just the general code that you can go by.

-Lord Fett

[View Quote]

c p

Feb 11, 2004, 7:13pm
Thanks I was testing my bot and wanted a function like this, ill add it and
test it.
[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