Blockland Forums > Modification Help
Client Sided Slash Command
jes00:
--- Quote from: Truce on September 13, 2011, 12:49:44 PM ---http://forum.blockland.us/index.php?topic=140618.msg3218049#msg3218049
--- End quote ---
Where would I put in the command?
--- Code: ---package clCmd
{
function NMH_Type::send(%this)
{
%msg = %this.getValue();
%wrd = firstWord(%msg);
%cmd = "clCmd" @ getSubStr(%wrd,1,strLen(%wrd));
if(getSubStr(%msg,0,1) $= "/" && isFunction(%cmd))
{
%eval = "call(%cmd,";
%cnt = getWordCount(%msg);
for(%i = 1; %i < %cnt; %i++)
%eval = %eval @ "\"" @ getWord(%msg,%i) @ "\",";
eval(getSubStr(%eval,0,strLen(%eval) - 1) @ ");");
%this.setValue("");
}
Parent::send(%this);
}
};
activatePackage(clCmd);
--- End code ---
MegaScientifical:
Use the exact code from his post, and make your command start with "clCmd".
jes00:
--- Quote from: MegaScientifical on September 13, 2011, 02:14:40 PM ---Use the exact code from his post, and make your command start with "clCmd".
--- End quote ---
--- Quote from: jes00 on September 13, 2011, 01:49:43 PM ---Where would I put in the command?
--- End quote ---
MegaScientifical:
Somewhere in the same .cs as the commands you want to activate?
jes00:
--- Quote from: MegaScientifical on September 13, 2011, 03:21:29 PM ---Somewhere in the same .cs as the commands you want to activate?
--- End quote ---
*sigh* I mean't if I typed the command it would change $toggled to 1.