• Home
  • Servers
  • Chat
  • Channels
  • Commands
  • Forum
  • FAQ
  • Software
  • Quotes
Topic Options
Rate This Topic
#12 - 08/01/06 01:13 AM Mass Commands Script
usrbingeek Offline

WyldRyde Staff

Registered: 07/31/06
Posts: 646
Loc: Burlington, VT
Originally posted by Helio

To install:
1. Create mcom.mrc file in mirc's directory, and populate it with the code below.
2. type: "/load -rs mcom.mrc" without quotes, in any mIRC channel window
3. Go to Tools -> Scripts Editor
4. Click the popups tab
5. Click View -> Nicklist
6. Replace the Control and CTCP with the contents of popup.txt
7. now, all the commands in the Control, Oper, and CTCP popup menus, will apply to all the users you select in the nicklist smile
8. Enjoy!!


Here's the code, there is currently a bug in /mmodeb, and /mkick, that has me stumped hmm As soon as I find the source of the prob, I'll post an updated ver.

Contents of mcom.mrc:
Code:
; Mass Commands Script
; v2.14
; Copyright 2004 Helio
; type /mcom command $target(#channel)

; Common Command Aliases
; /mkick #channel     =  kicks all selected users from the channel
; /mmode #channel +o  =  sets mode to all selected users in the channel
; /mmodeb #channel +b  =  sets mode to all selected users in the channel, but fills it in with masks (for +b, +e)
; /mctcp #channel ping  =  sends a ctcp to all selected users in the channel

alias mkick mcom kick $$1 $target($$1) $2-
alias mmode mcom mode $$1 $$2 $target($$1)
alias mmodeb mcom mode $$1 $$2 $target($$1) $$3
alias mctcp mcom ctcp $target($$1) $$2-

alias -l maskmode {
  if ($4 == $null) /mode $$1 $$2 $reptok($address($3,9),$3,*,1,33)
  else /mode $$1 $$2 $4 $+ : $+ $reptok($address($3,9),$3,*,1,33)
}

alias -l kban {
  maskmode $$1 +b $$2 
  kick $$1 $$2 $$3-
}

; Target Insertion Alias
; every form of mcom must
; have this identifier,
; somewhere

alias target {
  return @- $+ $1-
}

; Main mcom alias
; hard to code,
; even harder to understand
; :/

alias mcom {
  if ($matchtok($1-,@-,0,32) != 0) {
    set %string $1-
    goto bypass
  }
  if ($matchtok($1-,$,0,32) = 0) {
    echo -a Missing "$ $+ target()" insert
    halt
  }
  if ($matchtok($1-,$,0,32) > 0) {
    set %string $eval($1-,2)
    if ($matchtok(%string,@-,0,32) == 0) {
      echo -a Missing "$ $+ target()" insert
      halt
    }
  }
  :bypass
  set %window $deltok($matchtok(%string,@-,1,32),1,45)
  set %position $findtok(%string,$matchtok(%string,@-,1,32),1,32)
  set %counter 1
  while (%counter <= $snick(%window,0)) {
    set %test $reptok(%string,$matchtok(%string,@-,1,32),$snick(%window,%counter),1,32)
    %test
    inc %counter
  }
  goto endpoint
  :error
  if ($3 == $evalnext) {
    echo -a insufficient parameters
    /reseterror
    goto endpoint
  }
  :endpoint
  unset %string
  unset %test
  unset %position
  unset %counter
  unset %window
  halt
}

fixed a small bug when dealing with channels with - in them, currently kicking myself for how simple the fix was

Contents of popups.txt:

Code:

Control
.Ignore:/ignore $$1 1
.Unignore:/ignore -r $$1 1
.Op:/mmode # +o
.Deop:/mmode # -o
.HalfOp:/mmode # +h
.De Halfop:/mmode # -h
.Voice:/mmode # +v
.Devoice:/mmode # -v
.Kick:/mkick #
.Kick (why):/mkick # $$?="Reason:"
.Ban:/mmodeb #
.Ban, Kick:/mcom kban # $target(#)
.Ban, Kick (why):/mcom kban # $target(#) $$?="Reason:"
Oper
.Kill:/mcom kill $target(#) Channel Nuke
.Kill(Reason):/mcom kill $target(#) $?="Reason:"
CTCP
.Ping:/mctcp # ping
.Time:/mctcp # time
.Version:/mctcp # version


mmodeb does not work as originally intended (it doesn't fill in the masks right, I removed maskmode from the alias because of bugs). You might have to be careful, the channel mode variant does the modes one at a time per user, may cause flooding on very large channels (50+)

Top
Sponsored Links
Sponsored Links
Member
*****

Registered: 27/08/04
Posts: 10136
Loc: Mountain View, CA
Top


Moderator:  Jeff, mandy, usrbingeek