Blockland Forums > Modification Help
Chat Bot Help
¥ola:
When I try to activate the package myself it tells me the package is not found.
ThinkInvisible:
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
¥ola:
--- Quote from: ThinkInvisible on June 13, 2012, 10:16:42 AM ---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
--- End quote ---
Thank you,
I don't think I'm using the wrong name
Exactly what I put in console:
activatepackage(ChatBotYola);
Port:
--- Quote from: Treynolds416 on June 13, 2012, 09:18:45 AM ---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
--- End quote ---
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.
Treynolds416:
--- Quote from: Port on June 13, 2012, 11:06:30 AM ---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.
--- End quote ---
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