Onotice Window

By Urza on Dec 01, 2005

A snippet that puts onotices into a seperate custom window and creates log files for them, seperate to channel logs.



Set this up for a few ops in my channel, any suggestions on how to improve it are welcome.

Any pointers from the more experience people hereo n how to improve it also welcome :P Since im still kinda shady on some of the things ive used in this, mainly the debug idea.



Edit: Just realised the logging wont work unless you manually create a folder called Oplogs in your mirc directory.

Edit Again: Made and tested on mirc 6.16, doesnt appear to work on earlier versions.

on *:load: {
  echo -a 4*** Loaded: Opnotice Window script by urza
  echo -a 4*** NOTE: you MUST create a new folder in your mirc directory called Oplogs 
  echo -a 4*** $str( ,6) or this will NOT work
  var %x = 1, %nets = $scid(0)
  while (%x <= %nets) {
    scid %x
    window -hv @debug $+ $network
    debug -i @debug Ocheck
    window -hv @debug
    inc %x
  }
}
on *:connect: {
  window -hv @debug $+ $network
  debug -i @debug Ocheck
  window -hv @debug
}
on *:input:@: {
  if (/* !iswm $1) &&  (@Ops.* iswm $active) {
    .onotice $gettok($active,2,46) $1-
    echo $color(notice) -ti2 $gettok($active,2,46) -> Ops $+($gettok($active,2,46),:) $1-
  }
}
on @*:op:#: {
  var %window = $+(@Ops.,$chan)
  if ($window(%window)) {
    aline -l %window $+(@,$opnick)
    echo $color(mode) -tli2 %window $opnick was opped by $nick
  }
}
on @*:deop:#: {
  var %window = $+(@Ops.,$chan)
  if ($window(%window)) {
    dline -l %window $fline(%window,$+(@,$opnick),1,1)
    echo $color(mode) -tli2 %window $opnick was deopped by $nick
  }
}
on *:part:#: {
  var %window = $+(@Ops.,$chan)
  if ($window(%window)) {
    dline -l %window $fline(%window,$+(@,$nick),1,1)
    echo $color(part) -tli2 %window $nick has left $chan $+(',$1,')
  }
}
on *nick: {
  var %window = $+(@Ops.,$chan)
  if ($window(%window)) {
    dline -l %window $fline(%window,$+(@,$nick),1,1)
    aline -l %window $newnick
    echo $color(info2) -tli2 %window $nick is now known as $newnick
  }
}
on *:quit: {
  var %x = 1, %chans = $comchan($nick,0)
  while (%x <= %chans) {
    var %chan = $comchan($nick,%x), %window = $+(@Ops.,%chan)
    if ($window(%window)) {
      if ($fline(%window,$+(@,$nick),1,1)) {
        dline -l %window $fline(%window,$+(@,$nick),1,1)
        echo $color(quit) -tli2 %window $nick has quit $+(',$1-,')
      }
    }
    inc %x
  }
}
alias OCheck {
  tokenize 32 $1-
  if ($3 == NOTICE) && (@* iswm $4) {
    var %window = $+(@Ops.,$remove($4,@,#))
    if (!$window(%window)) MakeWindow %window
    if ($1 == ->) {
      echo $color(normal) -ti2 %window $+(<,$me,>) $right($5-,-1)
      write $+(oplogs/,$network,.,$gettok(%window,2,46),.txt) $time(ddd dd mmm. HH:nn:ss) $+(<,$me,>) $right($5-,-1)
    }
    else {
      echo $color(normal) -tli2 %window $+(<,$remove($gettok($2,1,33),:),>) $right($5-,-1)
      write $+(oplogs/,$network,.,$gettok(%window,2,46),.txt) $time(ddd dd mmm. HH:nn:ss) $+(<,$remove($gettok($2,1,33),:),>) $right($5-,-1)
    }
  }
}
alias -l MakeWindow {
  window -vnkeg1l14 $1
  var %x = 1, %chan = $gettok($1,2,46), %nicks = $nick(%chan,0,o)
  while (%x <= %nicks) {
    var %cnick = $+(@,$nick(%chan,%x,o))
    aline -l $1 %cnick
    inc %x
  }
}

Comments

Sign in to comment.
d0wn   -  Mar 06, 2011

you should disable the @op's notices in the channel, to keep them only in the @window

 Respond  
anthalus   -  Dec 05, 2005

I would add on:kick and on:ban to it. Otherwise, looks pretty good.

 Respond  
F*U*R*B*Y*   -  Dec 02, 2005

maybe you could say what the commands are. i know what the commands are but the noobs won\'t

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.