Blockland Forums > Modification Help
Chat Bot Help
ThinkInvisible:
Also, as I said before the %text $= "connected." will check to see if the text IS 'connected.', not if it contains it.
¥ola:
--- Quote from: Daenth on June 13, 2012, 12:48:37 AM ---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.
--- End quote ---
Alright, I'll do that now.
--- Quote from: ThinkInvisible on June 13, 2012, 07:37:59 AM ---Also, as I said before the %text $= "connected." will check to see if the text IS 'connected.', not if it contains it.
--- End quote ---
How would I check if the string contains something?
Treynolds416:
--- Quote from: ¥ola on June 13, 2012, 09:08:12 AM ---How would I check if the string contains something?
--- End quote ---
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
¥ola:
Would this be valid?
if(strStr(%text,%connected.))
Treynolds416:
--- Quote from: ¥ola on June 13, 2012, 09:36:05 AM ---Would this be valid?
if(strStr(%text,%connected.))
--- End quote ---
You should use either
if(strStr(%text,"connected.") >= 0) or
if(strStr(%text,"connected.") != -1)