mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2005
Posts: 51
P
Babel fish
OP Offline
Babel fish
P
Joined: Jul 2005
Posts: 51
Will check if the nickname was opped in an on part/on kick/on quit event ($comchan for quit) before he parts/quits/is kicked.

Also wasvoice/washop for voice and half-op.

Why not also adding an $id that returns the time in seconds that the person spent in a channel also in the on part/on kick/on quit events.


chadchoud @ DALnet
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
1) Im pretty sure u can just use a ^ event to test before the defualt action is taken for them (might be wrong)
2) you could take care of that yourself with a simple hashtable

Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
the was* (wasop, wasvoice, washelp etc etc) comparison has been suggested before tho in a different context.

As for checking if the nick was opped in an on part/kick, you can do that already with:

Code:
on *:part:#channel: {
  if ($nick isop #) { echo -s OP }
  if ($nick isvoice #) { echo -s VOICE }
  if (($nick isop #) && ($nick isvoice #)) { echo -s BOTH }
}


Try that sometime and see if it will do what you need it to smile


Those who fail history are doomed to repeat it
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Here's a code for the "time in channel" that I wrote for someone else.
Code:
 on *:start:{
  if !$hget(Wasted) { .hmake Wasted 100 }
  if $exists(Wasted.hsh) { .hload Wasted Wasted.hsh }
}
on *:join:#:{
  .hadd -m Wasted $+($chan,.,$address) $ctime
  .hadd -m Wasted $+($chan,.,$nick) $addtok($hget(Wasted,$+($chan,.,$nick)),$address,32)
}
on *:part:#:{
  wasted $chan $address
}
alias wasted {
  if $hget(Wasted,$+($1,.,$2)) {
    var %total = $hget(Wasted,$+(Total,.,$1,.,$2))
    var %wasted = $calc($ctime - $hget(Wasted,$+($1,.,$2)))
    inc %total %wasted
    .hadd -m Wasted $+(Total,.,$1,.,$2) %total
  }
}
on *:quit:{
  var %a = 1, %b = $comchan($nick,0)
  while %a <= %b {
    wasted $comchan($nick,%a) $address
    inc %a
  }
}
on *:kick:#:{
  wasted $chan $address
}
on *:text:!wasted*:#:{
  if !$2 {
    .msg $nick Your wasted time in $chan is $duration($calc($ctime - $hget(Wasted,$+($chan,.,$address)) + $hget(Wasted,$+(Total,.,$chan,.,$address))))
  }
  elseif !$hget(Wasted,$+($chan,.,$2)) {
    .msg $nick Sorry, but I don't have a record for $2 on $chan
  }
  else {
    var %a = 1, %b = $numtok($hget(Wasted,$+($chan,.,$2)),32), %time = 0
    while %a <= %b {
      var %address = $gettok($hget(Wasted,$+($chan,.,$2)),%a,32)
      inc %time $hget(Wasted,$+(Total,.,$chan,.,%address))
      inc %a
    }
    if $2 ison $chan {
      var %address = $right($address($2,0),-2)
      inc %time $calc($ctime - $hget(Wasted,$+($chan,.,%address)))
    }
    .msg $nick $2 $+ 's wasted time in $chan is $duration(%time)
  }
}  


If you want/need it more specific, post a request in the Scripts & Pop-ups section, and I can probably have it to you within 12 hours (untested) or 72 hours (tested)


Link Copied to Clipboard