Thread

Anyone know how to make a bot respond in VB? (Bots)

Anyone know how to make a bot respond in VB? // Bots

1  |  

trekkerx

Apr 1, 2001, 8:27pm
Dose anyone know how to make a bot respond to someting a person says in
VB? Cuz i just made one and it just sits there doing nothing... Cuz i
want to add like, when u say the bots name to make it say version, Oh
yea, can someone make a example of aa bot that u can fill out info on
where it is and stuff? and make it into a script and post it?

hal9000

Apr 1, 2001, 10:42pm
set up an event for the chat
sdk.AwEventSet AW_EVENT_CHAT
then in your SDK_event_chat() function
if SDK.awchatmessage = "hello bot" then
SDK.awsay "Hello " & SDK.awavatarname
end if

--
-=Hal9000=- world:Discover
--==~~out~~==--
--== http://hal9000.xoasis.com


[View Quote]

m a k a v e l i

Apr 2, 2001, 1:54am
That would make it case sensitive.. better to do

Message = sdk.awchatmessage
If Message = "hello" then
sdk.awsay "HI!"
end if

[View Quote]

grimble

Apr 2, 2001, 8:59am
Oops ... I guess you meant something like

If UCase(Message) = "HELLO" Then

.... or ...

If LCase(Message) = "hello" Then

Grims


[View Quote]

m a k a v e l i

Apr 2, 2001, 9:35am
Oh my! I came in late last night, sorry about that.

[View Quote]

jeiden

Apr 2, 2001, 1:58pm
Actually it doesn't matter the case so long as the letters spell the key
word
[View Quote]

grimble

Apr 2, 2001, 4:19pm
Ummm .... actually no. "Hello" is not equal to "hello" ... therefore without
converting the message to a single case, you cannot guarantee a match.

Grims

[View Quote]

trekkerx

Apr 2, 2001, 11:10pm
Thanxs, but it dosnt work. It just sits there... doing nothing... thats all...
Same with when a person enters, i have

Private Sub sdk_EventAvatarAdd()
Sdk.AwWhisper Sdk.AwAvatarSession, "Hello " & Sdk.AwAvatarName
message "[" & txtBotName.Text & "] : (whisper to " & Sdk.AwAvatarName & _
") Hello " & Sdk.AwAvatarName
EndSub

Ive been told thats right, but it wont work. It just sits there... doing
nothing...

[View Quote] > Actually it doesn't matter the case so long as the letters spell the key
> word
[View Quote]

trekkerx

Apr 2, 2001, 11:10pm
Thanxs, but it dosnt work. It just sits there... doing nothing... thats all...
Same with when a person enters, i have

Private Sub sdk_EventAvatarAdd()
Sdk.AwWhisper Sdk.AwAvatarSession, "Hello " & Sdk.AwAvatarName
message "[" & txtBotName.Text & "] : (whisper to " & Sdk.AwAvatarName & _
") Hello " & Sdk.AwAvatarName
EndSub

Ive been told thats right, but it wont work. It just sits there... doing
nothing...

[View Quote] > Actually it doesn't matter the case so long as the letters spell the key
> word
[View Quote]

mrgrimm

Apr 2, 2001, 11:45pm
1 - Call sdk.AwEventSet AW_EVENT_AVATAR_ADD
2 - Make sure you are calling sdk.AwWait 0 periodically (I usually have a
Timer fire every second for this).

[View Quote]

m a k a v e l i

Apr 3, 2001, 12:17am
Make it like this Trekker:

Private Sub sdk_EventChat()
Message = LCase(sdk.AwChatMessage)
If Message = "hello" Then
sdk.AwSay "Hello " & sdk.AwAvatarName
End If
End Sub

Also, does anyone know what the interval on a timer needs to be multiplied
by to equal 1 second?

xelag

Apr 3, 2001, 5:48am
1000

[View Quote]

kah

Apr 3, 2001, 1:53pm
Well, as MrGrimm sayd, you have to call AW_WAIT! And you should also do the
state thingy when you log in your bot.

KAH
PS. If you don't call AW_WAIT all the time, your bot will be thrown away by
the AW server.

trekkerx <troop2 at empirenet.com> skrev i
meldingsnyheter:3AC91F5B.F5FB7B2C at empirenet.com...
> Thanxs, but it dosnt work. It just sits there... doing nothing... thats
all...
> Same with when a person enters, i have
>
> Private Sub sdk_EventAvatarAdd()
> Sdk.AwWhisper Sdk.AwAvatarSession, "Hello " & Sdk.AwAvatarName
> message "[" & txtBotName.Text & "] : (whisper to " & Sdk.AwAvatarName
& _
> ") Hello " & Sdk.AwAvatarName
> EndSub
>
> Ive been told thats right, but it wont work. It just sits there... doing
> nothing...
>
[View Quote]

xelag

Apr 3, 2001, 2:23pm
If you don't call AW_WAIT, you don't collect the events anyway, and after 60
seconds or so, your bot gets disconnected. So as MrGrimm says: *install*
the event handler using AwEventSet AW_EVENT_AVATAR_ADD (or else
sdk_EventAvatarAdd() will never get triggered because it is not recognised
as an event handler by the aw.dll), and then *call* sdk.AwWait 0 once a
second (or more often if you like, I call it 16 times a second now in the
new xelagot, the AW browser calls it at every frame). To call AwWait, you
can use a windows Timer if you like, set to an interval of 1000 milliseconds
or even less (mine is at 64 milliseconds)

XelaG

[View Quote]

grimble

Apr 3, 2001, 2:39pm
LOL... this isn't a dig KAH, but "the state thingie"?? LOLOL

Grims

[View Quote]

xelag

Apr 3, 2001, 3:33pm
[View Quote] aw_state_change? LOL :)

kah

Apr 3, 2001, 5:32pm
didn't remember the exact name... LOL

KAH
xelag <xelag at 3dee.nl> skrev i
meldingsnyheter:3aca0978$1 at server1.Activeworlds.com...
[View Quote]

m a k a v e l i

Apr 3, 2001, 5:55pm
Thanks XelaG! Now I may be able to do something lol.

[View Quote]

trekkerx

Apr 3, 2001, 9:12pm
And it wont be Case Sentive?

[View Quote] > Make it like this Trekker:
>
> Private Sub sdk_EventChat()
> Message = LCase(sdk.AwChatMessage)
> If Message = "hello" Then
> sdk.AwSay "Hello " & sdk.AwAvatarName
> End If
> End Sub
>
> Also, does anyone know what the interval on a timer needs to be multiplied
> by to equal 1 second?

m a k a v e l i

Apr 3, 2001, 9:27pm
Nope, because it changes all the characters to lowercase and then judges,
but you cant say

If Message = "HELLO" Then

because it throws off the whole purpose, it has to be

If Message = "hello" then

: )

[View Quote]

trekkerx

Apr 5, 2001, 8:30pm
Still wouldent that make it case sentive cuz thats what it dose on mine, and
the Lcase(something) makes it so it has to be lowercase to work, isnt there a
way to do it without it?

[View Quote] > Nope, because it changes all the characters to lowercase and then judges,
> but you cant say
>
> If Message = "HELLO" Then
>
> because it throws off the whole purpose, it has to be
>
> If Message = "hello" then
>
> : )
>
[View Quote]

m a k a v e l i

Apr 5, 2001, 8:35pm
You missed the point.

Message = LCase(sdk.AwChatMessage)

that makes what the person said lowercase

If Message = "whatever" Then

That checks to see if the lowercased message is the same.

trekkerx

Apr 5, 2001, 9:32pm
What about the people that use correct grammer, and use Upper case
words? It excludes them

[View Quote] > You missed the point.
>
> Message = LCase(sdk.AwChatMessage)
>
> that makes what the person said lowercase
>
> If Message = "whatever" Then
>
> That checks to see if the lowercased message is the same.

m a k a v e l i

Apr 5, 2001, 9:49pm
Oh my! Listen, say I was in your world and I said "HeLlO AlL"

and your bot is set to do the following:

Message = LCase(Sdk.AwChatMessage)
If Message = "hello all" Then

It would take "HeLlO AlL" and make it "hello all" and Message is "hello all"
then whatever code you have under the If statement is what the bot would do.

trekkerx

Apr 5, 2001, 10:37pm
I see, it takes the message and makes it lowercase, okay i get it, thanxs

[View Quote] > Oh my! Listen, say I was in your world and I said "HeLlO AlL"
>
> and your bot is set to do the following:
>
> Message = LCase(Sdk.AwChatMessage)
> If Message = "hello all" Then
>
> It would take "HeLlO AlL" and make it "hello all" and Message is "hello all"
> then whatever code you have under the If statement is what the bot would do.

m a k a v e l i

Apr 5, 2001, 10:55pm
No Problem.

grimble

Apr 6, 2001, 9:38pm
LOL ... Well done makaveli ... have a coffee now mate.


[View Quote]

m a k a v e l i

Apr 6, 2001, 10:57pm
lol

the derek

Apr 7, 2001, 11:18pm
well if the bot wont say anthing when you tell it to make sure you got the aw_Wait
timer going... im pretty sure one of these guys has sample code so im not gonna
type example code for you when everyone else has... just a thought

[View Quote] > Thanxs, but it dosnt work. It just sits there... doing nothing... thats all...
> Same with when a person enters, i have
>
> Private Sub sdk_EventAvatarAdd()
> Sdk.AwWhisper Sdk.AwAvatarSession, "Hello " & Sdk.AwAvatarName
> message "[" & txtBotName.Text & "] : (whisper to " & Sdk.AwAvatarName & _
> ") Hello " & Sdk.AwAvatarName
> EndSub
>
> Ive been told thats right, but it wont work. It just sits there... doing
> nothing...
>
[View Quote]

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2022. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn