Blockland Forums > Modification Help
Math Chatbot
jes00:
How can I get it so when I say "Bob add(or subtract or whatever) number number" then it makes me say "BoB: ANSWER HERE"?
infiniteLoop:
Package the cliencmdchatmessage, strip the numbers from the message, do math, done.
jes00:
--- Quote from: infiniteLoop on October 12, 2011, 03:55:14 PM ---Package the cliencmdchatmessage, strip the numbers from the message, do math, done.
--- End quote ---
Err, idk how to "Strip the numbers from the message".
infiniteLoop:
--- Quote from: jes00 on October 12, 2011, 04:16:10 PM ---Err, idk how to "Strip the numbers from the message".
--- End quote ---
Well figure out what the equation is going to be using str str and getSubStr
%msg = "bob add 2+2 please";
if(strStr(%msg,"+") <= 0)
{
//we are adding do math stuff here using getsubstr
}
Placid:
if you want to make it using order of operations, better check for * and / first.
it wouldn't be perfect order, but it's worth a try.