Blockland Forums > Modification Help

Chat Bot Help

Pages: << < (3/12) > >>

elm:


Add this under inStr:


function chatBot_Talk(%msg)
{
   commandToServer('messageSent',%msg);
}


then erase the old commandtoserver('messagsent..
and put this in it's place:


            %delay = getRandom(100,2000);
            schedule(%delay,0,chatBot_talk,%ms);


¥ola:

One last thing,
is this a correct if statement after the clientcmdchatmessage?


--- Code: ---if(%name == ¥ola)
--- End code ---


elm:


--- Quote from: ¥ola on June 11, 2012, 05:08:36 PM ---One last thing,
is this a correct if statement after the clientcmdchatmessage?


--- Code: ---if(%name == ¥ola)
--- End code ---

--- End quote ---

== in torque script is not used to compare strings, it's generally used to compare integers and things of that sort. To compare strings we use $= (does string equal?) so "hi" $= "hello", etc.

¥ola:


--- Quote from: elm on June 11, 2012, 05:10:12 PM ---== in torque script is not used to compare strings, it's generally used for integers and things of that sourt. To compare strings we use $= (does string equal?) so "hi" $= "hello", etc.

--- End quote ---
Okay thank you a lot for that, but I was talking more along the lines of will it recognize the ¥ in my name

elm:


--- Quote from: ¥ola on June 11, 2012, 05:11:45 PM ---Okay thank you a lot for that, but I was talking more along the lines of will it recognize the ¥ in my name

--- End quote ---

Yes, if you do %name $= "¥ola"

Pages: << < (3/12) > >>

Go to full version