| Blockland Forums > Modification Help |
| Client Sided Slash Command |
| << < (4/6) > >> |
| phflack:
to make @hi toggle something, try function clCmdhi() { $toggled = !$toggled; } edit: and truce, is there a way to get it to not send the message to the server? |
| jes00:
--- Quote from: phflack on September 13, 2011, 04:33:30 PM ---function clCmdhi() --- End quote --- Didn't work. |
| Truce:
--- Quote from: phflack on September 13, 2011, 04:33:30 PM ---to make @hi toggle something, try edit: and truce, is there a way to get it to not send the message to the server? --- End quote --- The code I posted uses /, not @, and it does not send the message to the server either. |
| jes00:
--- Quote from: Truce on September 13, 2011, 11:29:27 PM ---The code I posted uses /, not @, and it does not send the message to the server either. --- End quote --- But where do I tell it what slash command it is and what it does? |
| infiniteLoop:
I don't know which way you are trying to do this but look below: You type /j and it'll perform a jump for you, I could get more complex with it but I'm just keeping it simple. package clCmd { function NMH_Type::send(%this) { %msg = %this.getValue(); %fw = getWord(%msg,0); if(%fw $= "/j") { jump(1); schedule(100,0,jump,0); canvas.popDialog(newMessageHud); return true; } Parent::send(%this); } }; activatePackage(clCmd); This way evaluates code so like if you typed, /moveForward(1); in the chat, it'll move forward for you. package clCmd { function NMH_Type::send(%this) { %msg = %this.getValue(); if(getSubstr(%msg,0,1) $= "/") { %f = getSubStr(%msg,1,strLen(%msg)); %if = getSubStr(%msg,1,strStr(%msg,"(")-1); if(isFunction(%if)) { eval(%f); canvas.popdialog(newmessagehud); return true; } } Parent::send(%this); } }; activatePackage(clCmd); |
| Navigation |
| Message Index |
| Next page |
| Previous page |