Blockland Forums > Modification Help
Block a bot
Fluff-is-back:
I saw too many people complaining about chatbots and how they are irritating and the rest.
So I threw together a little script that should stop the majority of them:
// Chatboticide
// For those annoying little bots
package blockDemBots
{
function serverCmdMessageSent(%client, %message)
{
%pos = strPos(%message, ":");
if(!%pos < 1)
{
%message = strLwr(%message);
if(getSubStr(%message, %pos - 3, 3) $= "bot")
{
commandToClient(%client, 'messageBoxOK', "No Bots!", "You are not allowed to use irritating chatbots on this server");
return;
}
}
return parent::serverCmdMessageSent(%client, %message);
}
};
activatePackage(blockDemBots);
I made this topic because it's not worth releasing as a proper add-on, more of a resource; this basically stops any chat-bot using the form "*bot: blah blah" from being posted in chat and also sends them a message. Hope this is useful
also:
--- Quote from: Chrono on March 27, 2012, 07:37:56 AM ---Don't forget this little part!
--- Code: ---package BlockWelcomeBot
{
function serverCmdMessageSent(%c,%m)
{
%tempmsg = getSubStr(%m,0,strLen(%m)-1);
%tempmsg = getWord(%m,1);
for(%x=0;%x<ClientGroup.getCount();%x++)
if(%tempmsg $= ClientGroup.getObject(%x).getPlayername() && ClientGroup.getObject(%x).joinTime+0.3 > getSimTime()/1000)
{
commandToClient(%client, 'messageBoxOK', "No Bots!", "You are not allowed to use irritating chatbots on this server");
return;
}
return parent::serverCmdMessageSent(%c,%m);
}
function GameConnection::autoAdminCheck(%c)
{
%c.jointime = getSimTime()/1000;
return Parent::autoAdminCheck(%c);
}
};
activatePackage(BlockWelcomeBot);
--- End code ---
Stops people from saying "____ <name>" when <name> has just joined the server. Effectively blocking greeting bots.
--- End quote ---
Some market research right there
--- Quote from: Eussorus on March 25, 2012, 06:55:25 PM ---Chat bots are just plain pointless and annoying, the advanced chat bots are just so loving stupid.
--- End quote ---
--- Quote from: -Jetz- on March 26, 2012, 02:14:51 PM ---Whenever I see someone's messages starting with "_____Bot:", I add the bot's name to the e-tard list.
--- End quote ---
--- Quote from: SeventhSandwich on March 25, 2012, 03:56:23 PM ---Clientside bots are loving annoying.
Badspot should find a way to make them no longer function (if possible without locking up important parts of the engine).
--- End quote ---
--- Quote from: mp7964 on February 15, 2012, 06:23:37 PM ---But nobody wants another chatbot ._.
--- End quote ---
MrLoL:
Great, thanks.
Aware:
Thank you very much.
Blocki:
Chat bots have no sense
I used mine to learn very basic scripting
Then I used it to automaticly eval useless functions
Then I realised how stupid that way is
Then I deleted it
Blocki:
To go around that script, simple make the bot say Blahbot says blah or something