Code:
; Usage:
; [color:green]/hide < - [r] [jpkmq] > <#channel>[/color]
; j = Joins p = Parts q = Quits m = Modes k = Kicks
;
; [color:red]r[/color] removes (shows) the other events specified in the switches.
; If no events are chosen, when using the -r switch, the script removes (shows) them all.

alias Hide {
  if ($1) && ($left($1,1) != -) { echo $color(info) -a * You need switches for this command. | return }
  if (!$2) { echo $color(info) -a * You must specify a channel. | return }
  if ($left($$2,1) !=  $chr(35)) { echo $color(info) -a * You must specify a channel. | return }
  if  ($1 == -r) { var %all = all, %switches = r }
  elseif ($1 != -r) { var %switches = $remove($1,-) }
  if (r !isin %switches) { goto add }
  elseif (r isin %switches) { goto remove }
 :add
  if (j isin %switches) || (%all) { .enable #Joins | hadd -m Hidden Joins $hget(Hidden,Joins) $$2 | var %do = $addtok(%do,Joins,32) }
  if (p isin %switches) || (%all) { .enable #Parts | hadd -m Hidden Parts $hget(Hidden,Parts) $$2 | var %do = $addtok(%do,Parts,32) }
  if (k isin %switches) || (%all) { .enable #Kicks | hadd -m Hidden Kicks $hget(Hidden,Kicks) $$2 | var %do = $addtok(%do,Kicks,32) }
  if (m isin %switches) || (%all) { .enable #Modes | hadd -m Hidden Modes $hget(Hidden,Modes) $$2 | var %do = $addtok(%do,Modes,32) }
  if (q isin %switches) || (%all) { .enable #Quits | hadd -m Hidden Quits $hget(Hidden,Quits) $$2 | var %do = $addtok(%do,Quits,32) }
  echo $color(info) * Now hiding on $$2 $+ : $iif(%all,All events,%do)
  halt
  :remove
  if (j isin %switches) || (%all) { .disable #Joins | hadd -m Hidden Joins $remtok($hget(Hidden,Joins),$$2,1,32) | var %do = $addtok(%do,Joins,32) }
  if (p isin %switches) || (%all) { .disable #Parts | hadd -m Hidden Parts $remtok($hget(Hidden,Parts),$$2,1,32) | var %do = $addtok(%do,Parts,32) }
  if (k isin %switches) || (%all) { .disable #Kicks | hadd -m Hidden Kicks $remtok($hget(Hidden,Kicks),$$2,1,32) | var %do = $addtok(%do,Kicks,32) }
  if (m isin %switches) || (%all) { .disable #Modes | hadd -m Hidden Modes $remtok($hget(Hidden,Modes),$$2,1,32) | var %do = $addtok(%do,Modes,32) }
  if (q isin %switches) || (%all) { .disable #Quits | hadd -m Hidden Quits $remtok($hget(Hidden,Quits),$$2,1,32) | var %do = $addtok(%do,Quits,32) }
  echo $color(info) * Now showing on $$2 $+ : $iif(%all,All events,%do)
  halt
}
#Joins off
on ^*:JOIN:#: if ($istok($hget(Hidden,Joins),$chan,32)) { haltdef }
#Joins end
#Parts off
on ^*:PART:#: if ($istok($hget(Hidden,Parts),$chan,32)) { haltdef }
#Parts end
#Kicks off
on ^*:KICK:#: if ($istok($hget(Hidden,Kicks),$chan,32)) { haltdef }
#Kicks end
#Modes off
on ^*:RAWMODE:#: if ($istok($hget(Hidden,Modes),$chan,32)) { haltdef }
#Modes end
#Quits off
on ^*:QUIT: {
  var %i = $comchan($nick,0)
  while (%i) {
    if ($istok($hget(Hidden,Quits),$comchan($nick,%i),32)) { haltdef }
    else { echo $color(quit) $comchan($nick,%i) * Quits: $nick $+($chr(40),$address,$chr(41)) ($1-) }
    dec %i
  }
}
#Quits end
I know this is very rusty, long and primitive, but I've tested here and it seems to work fine. If there is any bugs, please tell me smile

Usage:
/hide < - [r] [jpqkm] > <#channel>

A switch is always needed, so is the channel. Maybe later I work sth out to make it avaiable to all chans? :P

Like suggested:
j = Joins; p = Parts; q = Quits, m = Modes; k = Kicks

Eg: /hide -jp #home - will hide Joins and Parts in the channel #home

Eg2: /hide -rj #home - will show the events on #home

Eg3: /hide -r #home - will show all events in channel #home

I didn't add a multiple channel to it yet (Eg: /hide -j #home #work) because it's complicated to remove them (a simple $remtok wouldn't do it), but maybe later smile

Hope this helps (and works)
Zyzzyx smile


Last edited by Zyzzyx26; 09/08/04 01:20 AM.

"All we are saying is give peace a chance" -- John Lennon