Blockland Forums > Suggestions & Requests
Please fix my chatbot.
setro2:
/title
Please fix my chatbot. If you're not gonna help, please don't post.
--- Code: ---package chatbot
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
{
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
if(%msg $= "lol")
{
commandToServer('messageSent',"Ahahahahaha... I dont get it.");
}
else if(msg $= "rofl")
{
commandToServer('messageSent',"I still don't see what's funny.");
else if(%msg $= "shut up")
{
commandToServer('messageSent',"Right back at ya.");
}
else if(%msg $= "fail")
{
commandToServer('messageSent',"If you never fail, you never succeed.");
{
else if(%msg $= "spin")
{
turnleft(1);
}
else if(%msg $= "stop spin")
{
turnleft(0);
else if(%msg $= "holdmouse")
{
mousefire(1);
}
else if(%msg $= "releasemouse")
{
mousefire(0);
}
else if (%msg $= "getid")
{
commandToServer('getid');
}
}
};
activatePackage(chatbot);
--- End code ---
This does not belong in Coding Help, I want someone to fix it.
Mold:
--- Code: ---package chatbot
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
{
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
switch$(%msg)
{
case "lol":
commandToServer('messageSent',"Ahahahahaha... I dont get it.");
case "rofl":
commandToServer('messageSent',"I still don't see what's funny.");
case "shut up":
commandToServer('messageSent',"Right back at ya.");
case "fail":
commandToServer('messageSent',"If you never fail, you never succeed.");
case "spin":
turnleft(1);
case "stop spin":
turnleft(0);
case "holdmouse":
mousefire(1);
case "releasemouse":
mousefire(0);
case "getid":
commandToServer('getid');
}
}
};
activatePackage(chatbot);
--- End code ---
Now don't use it because chatbots suck.
otto-san:
--- Quote from: Mold on September 08, 2012, 04:02:02 PM ---
Now don't use it because chatbots suck.
--- End quote ---
they're good for first client mod practice projects though
this does belong in coding help btw
since you're seeking help with coding
Racerboy:
--- Quote from: otto-san on September 08, 2012, 04:04:43 PM ---they're good for first client mod practice projects though
this does belong in coding help btw
since you're seeking help with coding
--- End quote ---
I can't tell if he wants to learn how to code or steal other people's codes, make small edits, and release them as his own without giving the original author credit or asking him for permission in the first place.
otto-san:
--- Quote from: Racerboy on September 08, 2012, 04:08:00 PM ---I can't tell if he wants to learn how to code or steal other people's codes, make small edits, and release them as his own without giving the original author credit.
--- End quote ---
The only mistake was actually releasing it in that state. It's not as if it's rare for that to happen. Lots of people do the same thing. Especially as some of their first projects.