ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
Help Simple avatar bot (Bots)
Help Simple avatar bot // Botsc pFeb 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. lord fettFeb 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 pFeb 11, 2004, 7:13pm
|