Author Topic: clientsided help  (Read 455 times)

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".
 
« Last Edit: January 07, 2011, 10:50:11 PM by Gartanium »

this should work... if it doesn't play around with it
in the console you type $afk::bool=1; to turn it on

Code: [Select]
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 = "";
}
« Last Edit: January 07, 2011, 11:02:16 PM by howtoshotbillwetellyou »

this should work... if it doesn't play around with it

-snip-

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

Overcomplicated - lol, easily breakable - lol, wouldn't even work how given - and lol.

Overcomplicated - lol, easily breakable - lol, wouldn't even work how given - and lol.

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.

i think you are failing to see, it was just a base for him to work off of, yeah there are some things that could be revised considering i wrote it in 1 minute