Author Topic: Chat Bot Help  (Read 4786 times)

Also, as I said before the %text $= "connected." will check to see if the text IS 'connected.', not if it contains it.

If it doesn't do anything, check if it executed in the first place or execute it yourself and see if any error comes up.
Alright, I'll do that now.

Also, as I said before the %text $= "connected." will check to see if the text IS 'connected.', not if it contains it.
How would I check if the string contains something?

How would I check if the string contains something?
Use strStr(%string,%contains) or strPos(%string,%contains)
Both return -1 if %contains is not found in %string, or a number >= 0 at the index where it's found

Would this be valid?
if(strStr(%text,%connected.))

Would this be valid?
if(strStr(%text,%connected.))
You should use either
if(strStr(%text,"connected.") >= 0) or
if(strStr(%text,"connected.") != -1)

When I try to activate the package myself it tells me the package is not found.

Are you using the wrong name?

Also, to keep players from triggering it in chat:
if(strStr(%text, "connected.") && strPos(getword(%text, 0), ":") == -1))


however, if a joining player has a : in their name it won't trigger

but how likely is that

Are you using the wrong name?

Also, to keep players from triggering it in chat:
if(strStr(%text, "connected.") && strPos(getword(%text, 0), ":") == -1))


however, if a joining player has a : in their name it won't trigger

but how likely is that
Thank you,
I don't think I'm using the wrong name

Exactly what I put in console:
activatepackage(ChatBotYola);

Use strStr(%string,%contains) or strPos(%string,%contains)
Both return -1 if %contains is not found in %string, or a number >= 0 at the index where it's found

Sigh. No.

strStr returns -1, 0 or 1, depending on the difference between the two specified strings. strPos returns the position of the secondary string in the primary string.

Sigh. No.

strStr returns -1, 0 or 1, depending on the difference between the two specified strings. strPos returns the position of the secondary string in the primary string.
No. They both do the same thing, except strPos has an optional argument for an offset.
I've also tested and used it countless times


Thank you,
I don't think I'm using the wrong name

Exactly what I put in console:
activatepackage(ChatBotYola);

are you sure you know what you're doing

Thank you,
I don't think I'm using the wrong name

Exactly what I put in console:
activatepackage(ChatBotYola);
The script probably hasn't been executed...

If you really want to make it fancy, shove all the special cases into a seperate file and just hook into those from the package. Keeps any one function from turning into a gigantic mess.