All pastes #156791 Raw Edit

Stuff

public text v1 · immutable
·published 2006-09-01 00:51 UTC
rendered paste body
#Test on
ON *:TEXT:!test:#:{ .notice $nick Test Command is working! }
#Test end

; This code will allow you to enable/disable commands in your script. If you want it
; to be able to be used by Ops only, just uncomment the if check for that.
; Please note that since this command uses :*: for a catch phrase, you MUST either
; place it in to a new file (Recommended) or at the VERY bottom of your script.
; If you do place it at the bottom of your script and make any more commands in
; your script, they must be ABOVE this one.

; To use: !enable test & !disable test
; do not specify the #. In your script, make it like the one above, where it shows the
; #test on & #test end. This lets mIRC know where your group starts/ends.
ON *:TEXT:*:#:{
  ;IF ($nick !isop $chan) Halt
  VAR %cmdchars = !@.$>
  IF ($regex($1,/^[ %cmdchars ]enable$/Si)) {
    IF (!$group($+($Chr(35),$2))) { .notice $nick Invalid Group Specified! | Halt }
    .enable $+($Chr(35),$2)
    IF ($group($+($Chr(35),$2)) == ON) .notice $nick Group $+($Chr(35),$2) is now Enabled.
    ELSE .notice $nick Failed to Enable the Group $+($Chr(35),$2,!)
  }
  ELSEIF ($regex($1,/^[ %cmdchars ]disable$/Si)) {
    IF (!$group($+($Chr(35),$2))) { .notice $nick Invalid Group Specified! | Halt }
    .disable $+($Chr(35),$2)
    IF ($group($+($Chr(35),$2)) == OFF) .notice $nick Group $+($Chr(35),$2) is now Disabled.
    ELSE .notice $nick Failed to Disable the Group $+($Chr(35),$2,!)
  }
}