Sponsored Links




Topic Options
Rate This Topic
#12 - 08/01/06 01:13 AM Mass Commands Script
usrbingeek Administrator Offline
WyldRyde Staff

Registered: 07/31/06
Posts: 512
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


Recent Posts
Script to join channels with 30+ users.
by usrbingeek
44 minutes 32 seconds ago
Rules for Voiced (+v) users in #Chris
by Brandon
Today at 01:05 PM
Ustream IRC Auto Identtifyer
by Dark_Aaron
Today at 10:42 AM
IRC Bot Platforms
by Sam Ferry
Today at 02:58 AM
Get a free forum for your channel!
by Sam Ferry
Today at 02:48 AM
Ban Appeal Process
by Sam Ferry
Today at 02:36 AM
Flood Protection
by Dark_Aaron
01/03/09 08:14 PM
IRCop Script
by Samuel
01/03/09 04:57 AM
A simple topic script.
by Samuel
01/03/09 04:56 AM
Complete Autojoin script.
by Samuel
01/03/09 04:47 AM
Voice
by Matt Smith
01/02/09 07:54 PM
Kicked & Devoiced - Due to spam
by eggy
01/02/09 07:25 PM
Recent Pics
Xchat
mIRC on Linux
mIRC on Linux???
Who's Online
1 registered (1 invisible), 6 Guests and 6 Spiders online.
Key: Admin, Global Mod, Mod
Top Posters
usrbingeek 510
Kat 281
Phil 112
iPhone 109
Freekie 88
Justin 81
CCMike 78
techman224 75
tengrrl 58
wirelesspacket 53
Terms Of Use
Use of this community signifies your agreement to the Terms Of Service and Conditions of Use.