Thread

Chat Event (Sdk)

Chat Event // Sdk

1  |  

brandon

Aug 22, 2001, 1:41am
If sdk.AwChatMessage Is "owner" Then sdk.AwSay "My owner is: " &
sdk.AwLoginOwner & sdk.AwLoginPrivilegeNumber

I did that for the version to with a diferent message but the bot doesnt say
it. I dont really know of another way to do this ether
--
- Brandon
(website coming soon)
World: A'Dude
Co-owned world: Safira

the derek

Aug 22, 2001, 3:13am
it might help if you tell us the code you used? if thats it then you really dont know what your doing cause its basically just english


if you want the bot to say its owner and cit# if someone says "owner" then this would be the code (case INsensitive)

'if they say owner do the following stuff:
If UCase(sdk.AwChatMessage) = "OWNER" Then

'create a variable for the owners name
Dim OwnerCitName as string

'get the attributes of the owners cit# cause there is no direct function for owner name
sdk.AwCitizenAttributesByNumber(sdk.awloginowner)

'make owner name variable the citizenname from the last function
OwnerCitName = sdk.AwCitizeNname

'say it!
sdk.AwSay "my owner is: " & OwnerCitName & " (" & sdk.awloginowner & ")."
End If

[View Quote]

brandon

Aug 22, 2001, 3:19am
yes thats what i used....i had no idea how to do it so sooooooory....actualy
what i used looks more like how bot script would do it lol

[View Quote]

the derek

Aug 22, 2001, 3:20am
lol tell me how that works...and buy a book :P

[View Quote]

brandon

Aug 22, 2001, 3:27am
well it doesnt say anything when i say version or owner and i used that code
for both :\

[View Quote]

the derek

Aug 22, 2001, 3:41am
can you see the bot?

[View Quote]

the derek

Aug 22, 2001, 3:41am
more importantly did you install the event
handler?

[View Quote]

brandon

Aug 22, 2001, 3:49am
yes and yes


[View Quote]

the derek

Aug 22, 2001, 3:51am
ok did you use the aw_wait timer?
can you use sdk.say "jggrjre" in any other sub and
have it work?

[View Quote]

brandon

Aug 22, 2001, 3:59am
yes i used the timer and i can use sdk.AwSay "Hello"

[View Quote]

brandon

Aug 22, 2001, 4:02am
MenuBar.sdk.AwEventSet AW_EVENT_AVATAR_ADD
MenuBar.sdk.AwEventSet AW_EVENT_CHAT

thats what i use for the events right? It should be so im doing that part ok

[View Quote]

the derek

Aug 22, 2001, 4:07am
menubar is the name of the form i suppose?

[View Quote]

brandon

Aug 22, 2001, 4:13am
yah lol....this code is on the log-in window and the sdk is on the menubar
(becuase it is always open) thats why

anyways...i dunno about this right now i'll figure it out tommorrow i
guess...probly just some stupid mistake i overlook like always ;)

[View Quote]

the derek

Aug 22, 2001, 4:18am
wellthats weird you dont get any errors or nutin
heres a longshot but last resort:
change this line to this
sdk.AwSay "my owner is: " & OwnerCitName & " (" &
to
rc=sdk.AwSay "my owner is: " & OwnerCitName & " ("
&
if rc>0 then
msgbox rc
end if

[View Quote]

kah

Aug 22, 2001, 9:13am
you post too many posts, try to combine them into fewer, it's really
confusing... just try this code (note that it's case-sensitive, I think The
Derek's code isn't).

Private Sub sdk_EventChat()
'place the textbox txtIC on the SAME form as the SDK
txtIC.Text = txtIC.Text & vbNewLine & sdk.AwChatMessage
'that code was to see if any chat is received at all, so if nothing
'appears in the textbox when there's chat, your bot ain't receiving
'anything. oh, and set the textbox's multiline property to true.

'this if block will check for any special words and handle them
If sdk.AwChatMessage = sdk.AwLoginName & " owner" Then
> sdk.AwWhisper sdk.AwChatSession, "My owner's " &
sdk.AwLoginPrivilegeName & " (cit# " & sdk.AwLoginOwner & ")." 'this will
give the name and cit# of the owner, note that the privilegename property IS
NOT THE PPW!!!
ElseIf sdk.AwChatMessage = sdk.AwLoginName & " version" Then
> sdk.AwWhisper sdk.AwChatSession, "I'm [nameofbotapp] version
[botversion]. Copyright © yyyy [author]" 'fill in the blanks...
End If
End Sub

KAH

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