Blockland Forums > Modification Help
Chat Bot Help
ThinkInvisible:
if(%text.getword(%text.getwordcount()-1) $="connected." && stripos(%text.getword(0), :) == -1)
the second part is to keep people from triggering it randomly
it won't greet people with a : in their name though but that's derpy anyways
¥ola:
No I mean it won't work at all. Not one part of it
I thought it might be the connected stuff, so I deleted that and tried it but it still won't work
Exact code I'm using:
--- Code: ---package ChatBot
{
function clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg)
{
Parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
if($ChatBot::On)
{
switch$(%msg)
{
case "Hey":
commandToServer('messagesent', "ChatBot: Hey");
}
}
}
};
activatepackage (ChatBot);
package ChatBotRegister
{
function clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg)
{
Parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
if(%name $= "¥ola")
{
switch$(%msg)
{
case "ChatBot On":
commandToServer('messagesent', "ChatBot: On"):
$ChatBot::On = true;
case "ChatBot Off":
commandToServer('messagesent', "ChatBot: On"):
$ChatBot::On = false;
}
}
}
};
activatepackage (ChatBotRegister);
--- End code ---
Ipquarx:
No, use onServerMessage for any sort of auto greeter that should never ever be made.
¥ola:
--- Quote from: Ipquarx on June 11, 2012, 07:09:34 PM ---No, use onServerMessage for any sort of auto greeter that should never ever be made.
--- End quote ---
... Explain how to use it, give me an example?
elm:
--- Quote from: ¥ola on June 11, 2012, 07:11:34 PM ---... Explain how to use it, give me an example?
--- End quote ---
http://forum.blockland.us/index.php?topic=191941.0