This is a little something I've been working on for a few days now. I believe I have all the kinks worked out on it, why I've decided to finally release it to the public. But I'm sure there will be a few small fixes that I'll need to make to it after this. This script adds the ability to use [color="#FF0000"]/addaccess <name> <access>[/color] and [color="#FF0000"]/remaccess <name> <access>[/color] in your chat room. It'll appear as a regular server command, with the exception of the access level change (decided to do something different.) The /addaccess command is pretty limited compared to the * access in WCS. In order to use the /addaccess and /remaccess commands, a user needs either the Z or the * access. The command will only allow users to add an access to someone if the user doing the command, already has that access. So this command can't be abused like * to give yourself full access. Also, if users have a "!" character in their access, that makes them completely immune to these commands. The /addaccess command will handle the + and @ access correctly and remove select ones when adding others, to keep the @ from over-ruling the + all the time. It will remove the @ if the user already has it and you add a + access. It will also not let you add or remove an access that the target user doesn't have.
This is just the tip of what the new WCS is capable of, I've got many scripts planned and a few even started. This will only work with the newest WCS 1.8b13 and the newest Metis 2.8b1m4. It could be down graded with a little work to work on previous versions of Metis though. In order to have this script working properly. You've gotta add these lines of code to your WCS room config first.
CustomCommand=/ADDACCESS=BotPassword
CustomCommand=/REMACCESS=BotPassword
Then add these xml commands to their own xml file and include it with your bot, or add it to an existing one.
<command type="script">
<in>/addaccess%PARAM%</in>
<out condition="==" lvalue="%PARAM%" rvalue=" ">/hidecmd /privnotice %NAME% #c62#Usage: #c1#/addaccess <username> <access></out>
<out type="break" condition="==" lvalue="%PARAM%" rvalue=" "/>
<out type="push" extdata="ADDUSERNAME">%RAWNAME%</out>
<out type="push" extdata="ADDTRIGGER">%TRIGGER%</out>
<out type="push" extdata="COMMANDCHECK"><operator type="strleft" lvalue="%USERVAR[ADDTRIGGER]%" rvalue="10"/></out>
<out type="break" condition="!=" lvalue="%USERVAR[COMMANDCHECK]%" rvalue="/addaccess"/>
<out condition="==" lvalue="%USERVAR[COMMANDCHECK]%" rvalue="/addaccess">/hidecmd /privnotice %NAME% #c58#>#c1# /addaccess%PARAM%</out>
<out type="push" extdata="FIRSTSPACE"><operator type="strfind" lvalue="%USERVAR[ADDTRIGGER]%" rvalue=" "/></out>
<out type="push" extdata="FIRSTSPACE"><operator type="++" lvalue="%USERVAR[FIRSTSPACE]%"/></out>
<out type="push" extdata="COMMANDPARAM"><operator type="strright" lvalue="%USERVAR[ADDTRIGGER]%" rvalue="%USERVAR[FIRSTSPACE]%"/></out>
<out type="push" extdata="SECONDSPACE"><operator type="strrfind" lvalue="%USERVAR[COMMANDPARAM]%" rvalue=" "/></out>
<out condition="==" lvalue="%USERVAR[SECONDSPACE]%" rvalue="-1">/hidecmd /privnotice %USERVAR[ADDUSERNAME]% #c62#Usage: #c1#/addaccess <username> <access></out>
<out type="break" condition="==" lvalue="%USERVAR[SECONDSPACE]%" rvalue="-1"/>
<out type="push" extdata="ADDTARGET"><operator type="strleft" lvalue="%USERVAR[COMMANDPARAM]%" rvalue="%USERVAR[SECONDSPACE]%"/></out>
<out type="push" extdata="SECONDSPACE"><operator type="++" lvalue="%USERVAR[SECONDSPACE]%"/></out>
<out type="push" extdata="NEWACCESS"><operator type="strright" lvalue="%USERVAR[COMMANDPARAM]%" rvalue="%USERVAR[SECONDSPACE]%"/></out>
<out type="pop" extdata="ADDTRIGGER"/>
<out type="pop" extdata="COMMANDCHECK"/>
<out type="pop" extdata="FIRSTSPACE"/>
<out type="pop" extdata="COMMANDPARAM"/>
<out type="pop" extdata="SECONDSPACE"/>
<out type="push" extdata="ADDUSERSTATALLOW">1</out>
<out>/hidecmd /stats %USERVAR[ADDUSERNAME]%</out>
</command>
<command type="script" condition="==" lvalue="ADDUSERSTATALLOW" rvalue="1">
<in>Unknown User</in>
<out>/hidecmd /privnotice %USERVAR[ADDUSERNAME]% #c62#Unknown User!</out>
<out type="pop" extdata="ADDUSERSTATALLOW"/>
</command>
<command type="script" condition="==" lvalue="%USERVAR[ADDUSERSTATALLOW]%" rvalue="1">
<in>Access: %PARAM%</in>
<out type="push" extdata="ADDUSERACCESS">%PARAM%</out>
<out type="push" extdata="ADDTARGETSTATALLOW">1</out>
<out type="pop" extdata="ADDUSERSTATALLOW"/>
<out>/hidecmd /stats %USERVAR[ADDTARGET]%</out>
</command>
<command type="script" condition="==" lvalue="%USERVAR[ADDTARGETSTATALLOW]%" rvalue="1">
<in>Unknown User</in>
<out>/hidecmd /privnotice %USERVAR[ADDUSERNAME]% #c62#Unknown User!</out>
<out type="pop" extdata="ADDTARGETSTATALLOW"/>
</command>
<command type="script" condition="==" lvalue="%USERVAR[ADDTARGETSTATALLOW]%" rvalue="1">
<in>Username: %PARAM%</in>
<out type="push" extdata="ADDTARGET">%PARAM%</out>
<out type="push" extdata="ADDTARGETSTATALLOW">2</out>
</command>
<command type="script" condition="==" lvalue="%USERVAR[ADDTARGETSTATALLOW]%" rvalue="2">
<in>Unknown User</in>
<out>/hidecmd /privnotice %USERVAR[ADDUSERNAME]% #c62#Unknown User!</out>
<out type="pop" extdata="ADDTARGETSTATALLOW"/>
</command>
<command type="script" condition="==" lvalue="%USERVAR[ADDTARGETSTATALLOW]%" rvalue="2">
<in>Access: %PARAM%</in>
<out type="push" extdata="ADDTARGETACCESS">%PARAM%</out>
<out type="pop" extdata="ADDTARGETSTATALLOW"/>
<out type="self">!addaccess</out>
</command>
<command type="script" mode="thread" condition="==" lvalue="%NAME%" rvalue="_BOT_SELF_TRIGGER_">
<in>!addaccess</in>
<out type="push" extdata="ACCESSALLOW">0</out>
<out type="push" extdata="ACCESSALLOW" condition="?" lvalue="%USERVAR[ADDUSERACCESS]%" rvalue="Z">1</out>
<out type="push" extdata="ACCESSALLOW" condition="?" lvalue="%USERVAR[ADDUSERACCESS]%" rvalue="*">1</out>
<out condition="==" lvalue="%USERVAR[ACCESSALLOW]%" rvalue="0">/hidecmd /privnotice %USERVAR[ADDUSERNAME]% #c62#Access denied!</out>
<out type="break" condition="==" lvalue="%USERVAR[ACCESSALLOW]%" rvalue="0"/>
<out condition="?" lvalue="%USERVAR[ADDTARGETACCESS]%" rvalue="!">/hidecmd /privnotice %USERVAR[ADDUSERNAME]% #c62#Access denied, that user is immortal!</out>
<out type="break" condition="?" lvalue="%USERVAR[ADDTARGETACCESS]%" rvalue="!"/>
<out type="push" extdata="ACCESSALLOW">0</out>
<out type="push" extdata="ACCESSALLOW" condition="?" lvalue="%USERVAR[NEWACCESS]%" rvalue="+"><operator type="++" lvalue="%USERVAR[ACCESSALLOW]%"/></out>
<out type="push" extdata="ACCESSALLOW" condition="?" lvalue="%USERVAR[NEWACCESS]%" rvalue="@"><operator type="++" lvalue="%USERVAR[ACCESSALLOW]%"/></out>
<out type="push" extdata="NEWACCESS" condition="==" lvalue="%USERVAR[ACCESSALLOW]%" rvalue="2"><operator type="strrem" lvalue="%USERVAR[NEWACCESS]%" rvalue="+"/></out>
<out type="push" extdata="TEMPACCESS">%USERVAR[NEWACCESS]%</out>
<out type="push" extdata="TEMPACCESSLENGTH"><operator type="strlen" lvalue="%USERVAR[TEMPACCESS]%"/></out>
<out type="push" extdata="LOOPCOUNT">0</out>
<out type="push" extdata="LOOPCOUNT" condition="!=" lvalue="%USERVAR[TEMPACCESS]%" rvalue=""><operator type="++" lvalue="%USERVAR[LOOPCOUNT]%"/></out>
<out type="push" extdata="SINGLEACCESS"><operator type="strtrm" lvalue="%USERVAR[TEMPACCESS]%" rvalue="1"/></out>
<out type="push" extdata="TEMPACCESS"><operator type="strright" lvalue="%USERVAR[TEMPACCESS]%" rvalue="1"/></out>
<out type="goto" extdata="7" condition="?" lvalue="%USERVAR[ADDUSERACCESS]%" rvalue="*"/>
<out type="push" extdata="ACCESSALLOW">0</out>
<out type="push" extdata="ACCESSALLOW" condition="==" lvalue="%USERVAR[SINGLEACCESS]%" rvalue="+"><operator type="++" lvalue="%USERVAR[ACCESSALLOW]%"/></out>
<out type="push" extdata="ACCESSALLOW" condition="?" lvalue="%USERVAR[ADDUSERNAME]%" rvalue="@"><operator type="++" lvalue="%USERVAR[ACCESSALLOW]%"/></out>
<out type="goto" extdata="3" condition="==" lvalue="%USERVAR[ACCESSALLOW]%" rvalue="2"/>
<out condition="!?" lvalue="%USERVAR[ADDUSERACCESS]%" rvalue="%USERVAR[SINGLEACCESS]%">/hidecmd /privnotice %USERVAR[ADDUSERNAME]% #c62#Access denied, you don't have that access!</out>
<out type="break" condition="!?" lvalue="%USERVAR[ADDUSERACCESS]%" rvalue="%USERVAR[SINGLEACCESS]%"/>
<out condition="?" lvalue="%USERVAR[ADDTARGETACCESS]%" rvalue="%USERVAR[SINGLEACCESS]%">/hidecmd /privnotice %USERVAR[ADDUSERNAME]% #c62#Access denied, that user already has that access!</out>
<out type="break" condition="?" lvalue="%USERVAR[ADDTARGETACCESS]%" rvalue="%USERVAR[SINGLEACCESS]%"/>
<out type="goto" extdata="-12" condition="!=" lvalue="%USERVAR[LOOPCOUNT]%" rvalue="%USERVAR[TEMPACCESSLENGTH]%"/>
<out type="push" extdata="ACCESSALLOW">0</out>
<out type="push" extdata="ACCESSALLOW" condition="?" lvalue="%USERVAR[NEWACCESS]%" rvalue="+"><operator type="++" lvalue="%USERVAR[ACCESSALLOW]%"/></out>
<out type="push" extdata="ACCESSALLOW" condition="?" lvalue="%USERVAR[ADDTARGETACCESS]%" rvalue="@"><operator type="++" lvalue="%USERVAR[ACCESSALLOW]%"/></out>
<out type="push" extdata="ADDTARGETACCESS" condition="==" lvalue="%USERVAR[ACCESSALLOW]%" rvalue="2"><operator type="strrem" lvalue="%USERVAR[ADDTARGETACCESS]%" rvalue="@"/></out>
<out type="push" extdata="ACCESSALLOW">0</out>
<out type="push" extdata="ACCESSALLOW" condition="?" lvalue="%USERVAR[ADDTARGETACCESS]%" rvalue="+"><operator type="++" lvalue="%USERVAR[ACCESSALLOW]%"/></out>
<out type="push" extdata="ACCESSALLOW" condition="?" lvalue="%USERVAR[NEWACCESS]%" rvalue="@"><operator type="++" lvalue="%USERVAR[ACCESSALLOW]%"/></out>
<out type="push" extdata="ADDTARGETACCESS" codition="==" lvalue="%USERVAR[ACCESSALLOW]%" rvalue="2"><operator type="strrem" lvalue="%USERVAR[ADDTARGETACCESS]%" rvalue="+"/></out>
<out type="push" extdata="NEWACCESS">%USERVAR[ADDTARGETACCESS]%%USERVAR[NEWACCESS]%</out>
<out type="push" extdata="NEWACCESS"><operator type="strrem" lvalue="%USERVAR[NEWACCESS]%" rvalue=" "/></out>
<out>/hidecmd /setaccess %USERVAR[ADDTARGET]% %USERVAR[NEWACCESS]%</out>
<out type="push" extdata="SHORTNAME"><operator type="strlen" lvalue="%USERVAR[ADDTARGET]%"/></out>
<out type="push" extdata="SHORTNAME"><operator type="-" lvalue="%USERVAR[SHORTNAME]%" rvalue="9"/></out>
<out type="push" extdata="SHORTNAME"><operator type="strtrm" lvalue="%USERVAR[ADDTARGET]%" rvalue="%USERVAR[SHORTNAME]%"/></out>
<out>/hidecmd /privnotice %USERVAR[ADDUSERNAME]% #c4#%USERVAR[SHORTNAME]%#c62#'s access has been changed to #c1#%USERVAR[NEWACCESS]%</out>
</command>
//
//Remove access
//
<command type="script">
<in>/remaccess %PARAM%</in>
<out condition="==" lvalue="%PARAM%" rvalue=" ">/hidecmd /privnotice %NAME% #c62#Usage: #c1#/addaccess <username> <access></out>
<out type="break" condition="==" lvalue="%PARAM%" rvalue=" "/>
<out type="push" extdata="REMUSERNAME">%RAWNAME%</out>
<out type="push" extdata="REMTRIGGER">%TRIGGER%</out>
<out type="push" extdata="COMMANDCHECK"><operator type="strleft" lvalue="%USERVAR[REMTRIGGER]%" rvalue="10"/></out>
<out type="break" condition="!=" lvalue="%USERVAR[COMMANDCHECK]%" rvalue="/remaccess"/>
<out condition="==" lvalue="%USERVAR[COMMANDCHECK]%" rvalue="/remaccess">/hidecmd /privnotice %NAME% #c58#>#c1# /remaccess %PARAM%</out>
<out type="push" extdata="FIRSTSPACE"><operator type="strfind" lvalue="%USERVAR[REMTRIGGER]%" rvalue=" "/></out>
<out type="push" extdata="FIRSTSPACE"><operator type="++" lvalue="%USERVAR[FIRSTSPACE]%"/></out>
<out type="push" extdata="COMMANDPARAM"><operator type="strright" lvalue="%USERVAR[REMTRIGGER]%" rvalue="%USERVAR[FIRSTSPACE]%"/></out>
<out type="push" extdata="SECONDSPACE"><operator type="strrfind" lvalue="%USERVAR[COMMANDPARAM]%" rvalue=" "/></out>
<out condition="==" lvalue="%USERVAR[SECONDSPACE]%" rvalue="-1">/hidecmd /privnotice %USERVAR[REMUSERNAME]% #c62#Usage: #c1#/remaccess <username> <access></out>
<out type="break" condition="==" lvalue="%USERVAR[SECONDSPACE]%" rvalue="-1"/>
<out type="push" extdata="REMTARGET"><operator type="strleft" lvalue="%USERVAR[COMMANDPARAM]%" rvalue="%USERVAR[SECONDSPACE]%"/></out>
<out type="push" extdata="SECONDSPACE"><operator type="++" lvalue="%USERVAR[SECONDSPACE]%"/></out>
<out type="push" extdata="NEWACCESS"><operator type="strright" lvalue="%USERVAR[COMMANDPARAM]%" rvalue="%USERVAR[SECONDSPACE]%"/></out>
<out type="pop" extdata="REMTRIGGER"/>
<out type="pop" extdata="COMMANDCHECK"/>
<out type="pop" extdata="FIRSTSPACE"/>
<out type="pop" extdata="COMMANDPARAM"/>
<out type="pop" extdata="SECONDSPACE"/>
<out type="push" extdata="REMUSERSTATALLOW">1</out>
<out>/hidecmd /stats %USERVAR[REMUSERNAME]%</out>
</command>
<command type="script" condition="==" lvalue="REMUSERSTATALLOW" rvalue="1">
<in>Unknown User</in>
<out>/hidecmd /privnotice %USERVAR[REMUSERNAME]% #c62#Unknown User!</out>
<out type="pop" extdata="REMUSERSTATALLOW"/>
</command>
<command type="script" condition="==" lvalue="%USERVAR[REMUSERSTATALLOW]%" rvalue="1">
<in>Access: %PARAM%</in>
<out type="push" extdata="REMUSERACCESS">%PARAM%</out>
<out type="push" extdata="REMTARGETSTATALLOW">1</out>
<out type="pop" extdata="REMUSERSTATALLOW"/>
<out>/hidecmd /stats %USERVAR[REMTARGET]%</out>
</command>
<command type="script" condition="==" lvalue="%USERVAR[REMTARGETSTATALLOW]%" rvalue="1">
<in>Unknown User</in>
<out>/hidecmd /privnotice %USERVAR[REMUSERNAME]% #c62#Unknown User!</out>
<out type="pop" extdata="REMTARGETSTATALLOW"/>
</command>
<command type="script" condition="==" lvalue="%USERVAR[REMTARGETSTATALLOW]%" rvalue="1">
<in>Username: %PARAM%</in>
<out type="push" extdata="REMTARGET">%PARAM%</out>
<out type="push" extdata="REMTARGETSTATALLOW">2</out>
</command>
<command type="script" condition="==" lvalue="%USERVAR[REMTARGETSTATALLOW]%" rvalue="2">
<in>Unknown User</in>
<out>/hidecmd /privnotice %USERVAR[REMUSERNAME]% #c62#Unknown User!</out>
<out type="pop" extdata="REMTARGETSTATALLOW"/>
</command>
<command type="script" condition="==" lvalue="%USERVAR[REMTARGETSTATALLOW]%" rvalue="2">
<in>Access: %PARAM%</in>
<out type="push" extdata="REMTARGETACCESS">%PARAM%</out>
<out type="pop" extdata="REMTARGETSTATALLOW"/>
<out type="self">!remaccess</out>
</command>
<command type="script" mode="thread" condition="==" lvalue="%NAME%" rvalue="_BOT_SELF_TRIGGER_">
<in>!remaccess</in>
<out type="push" extdata="ACCESSALLOW">0</out>
<out type="push" extdata="TEMPNEWACCESS">%USERVAR[REMTARGETACCESS]%</out>
<out type="push" extdata="ACCESSALLOW" condition="?" lvalue="%USERVAR[REMUSERACCESS]%" rvalue="Z">1</out>
<out type="push" extdata="ACCESSALLOW" condition="?" lvalue="%USERVAR[REMUSERACCESS]%" rvalue="*">1</out>
<out condition="==" lvalue="%USERVAR[ACCESSALLOW]%" rvalue="0">/hidecmd /privnotice %USERVAR[REMUSERNAME]% #c62#Access denied!</out>
<out type="break" condition="==" lvalue="%USERVAR[ACCESSALLOW]%" rvalue="0"/>
<out condition="?" lvalue="%USERVAR[REMTARGETACCESS]%" rvalue="!">/hidecmd /privnotice %USERVAR[REMUSERNAME]% #c62#Access denied, that user is immortal!</out>
<out type="break" condition="?" lvalue="%USERVAR[REMTARGETACCESS]%" rvalue="!"/>
<out type="push" extdata="TEMPACCESS">%USERVAR[NEWACCESS]%</out>
<out type="push" extdata="TEMPACCESSLENGTH"><operator type="strlen" lvalue="%USERVAR[TEMPACCESS]%"/></out>
<out type="push" extdata="LOOPCOUNT">0</out>
<out type="push" extdata="LOOPCOUNT" condition="!=" lvalue="%USERVAR[SINGLEACCESS]%" rvalue=""><operator type="++" lvalue="%USERVAR[LOOPCOUNT]%"/></out>
<out type="push" extdata="SINGLEACCESS"><operator type="strtrm" lvalue="%USERVAR[TEMPACCESS]%" rvalue="1"/></out>
<out type="push" extdata="TEMPACCESS"><operator type="strright" lvalue="%USERVAR[TEMPACCESS]%" rvalue="1"/></out>
<out type="goto" extdata="3" condition="?" lvalue="%USERVAR[REMUSERACCESS]%" rvalue="*"/>
<out condition="!?" lvalue="%USERVAR[REMUSERACCESS]%" rvalue="%USERVAR[SINGLEACCESS]%">/hidecmd /privnotice %USERVAR[REMUSERNAME]% #c62#Access denied, you don't have that access!</out>
<out type="break" condition="!?" lvalue="%USERVAR[REMUSERNAME]%" rvalue="%USERVAR[SINGLEACCESS]%"/>
<out condition="!?" lvalue="%USERVAR[REMTARGETACCESS]%" rvalue="%USERVAR[SINGLEACCESS]%">/hidecmd /privnotice %USERVAR[REMUSERNAME]% #c62#Access denied, that user doesn't have that access!</out>
<out type="break" condition="!?" lvalue="%USERVAR[REMTARGETACCESS]%" rvalue="%USERVAR[SINGLEACCESS]%"/>
<out type="push" extdata="TEMPNEWACCESS" condition="?" lvalue="%USERVAR[REMTARGETACCESS]%" rvalue="%USERVAR[SINGLEACCESS]%"><operator type="strrem" lvalue="%USERVAR[TEMPNEWACCESS]%" rvalue="%USERVAR[SINGLEACCESS]%"/></out>
<out type="goto" extdata="-9" condition="!=" lvalue="%USERVAR[LOOPCOUNT]%" rvalue="%USERVAR[TEMPACCESSLENGTH]%"/>
<out>/hidecmd /setaccess %USERVAR[REMTARGET]% %USERVAR[TEMPNEWACCESS]%</out>
<out type="push" extdata="SHORTNAME"><operator type="strlen" lvalue="%USERVAR[REMTARGET]%"/></out>
<out type="push" extdata="SHORTNAME"><operator type="-" lvalue="%USERVAR[SHORTNAME]%" rvalue="9"/></out>
<out type="push" extdata="SHORTNAME"><operator type="strtrm" lvalue="%USERVAR[REMTARGET]%" rvalue="%USERVAR[SHORTNAME]%"/></out>
<out>/hidecmd /privnotice %USERVAR[REMUSERNAME]% #c4#%USERVAR[SHORTNAME]%#c62#'s access has been changed to #c1#%USERVAR[TEMPNEWACCESS]%</out>
</command>
If you have any problems or need any help. Feel free to post and let me know. Also feel free to play around with the script, maybe create something new. The ideas are limitless, the only hard part is having the spare time.
To see this script in action, just drop by the MXControl chat room on winmx.