Blockland Forums > Modification Help
clientsided help
(1/2) > >>
Gartanium:
So I want to be able to message some one "I'm afk at the moment, please talk to me later" when some one says my name and I'm in some one elses server. How would I go about doing this? I don't know what to use to check to see when some one sends a message, or how to check that message and see if it is equal to "afk".
 
howtoshotbillwetellyou:
this should work... if it doesn't play around with it
in the console you type $afk::bool=1; to turn it on


--- Code: ---package chat
{
function clientCmdChatMessage(%a,%b,%c,%d,%atag,%name,%btag,%msg)
{
parent::clientCmdChatMessage(%a,%b,%c,%d,%atag,%name,%btag,%msg);
if($afk::bool == 1 && $afk::cantRespond $= "")
{
for(%i=0; %i<getWordCount(%msg); %i++)
{
if(getWord(%msg,%i) $= $pref::Player::NetName)
{
commandtoserver('messageSent',"Sorry "@%name@", I am currently afk.");
$afk::cantRespond = 1;
schedule(10000,0,afk_timeout);
}
}
}
}
};activatePackage(chat);

function afk_TimeOut()
{
$afk::cantRespond = "";
}
--- End code ---
MegaScientifical:

--- Quote from: howtoshotbillwetellyou on January 07, 2011, 10:56:41 PM ---this should work... if it doesn't play around with it

-snip-

--- End quote ---

Overcomplicated, easily breakable, wouldn't even work how given.
howtoshotbillwetellyou:

--- Quote from: MegaScientifical on January 07, 2011, 10:58:46 PM ---Overcomplicated - lol, easily breakable - lol, wouldn't even work how given - and lol.

--- End quote ---
MegaScientifical:

--- Quote from: howtoshotbillwetellyou on January 07, 2011, 11:01:07 PM ---
--- Quote from: MegaScientifical on January 07, 2011, 10:58:46 PM ---Overcomplicated - lol, easily breakable - lol, wouldn't even work how given - and lol.

--- End quote ---

--- End quote ---

You are going word by words for the EXACT name. Two+ word names obviously break there, never mind most people don't go by full name. You're using For loops for this instead of a simple striCmp or whatever it is. And it looks like it's defaulting the afk message instead of none.

You can also abuse that one by having a bunch of people say their name to cause flood protection. And with Add-Ons these days, probably spam kicked.
Navigation
Message Index
Next page

Go to full version