Deop if Away

By MoshMage on Jan 30, 2011

use !seek to seek any away (or idle for over than 30m) user in channel and if there is one, it'll deop the user.

use !seek auto to auto seek every 60mins

i had this lying around and user@the forums asked for something like this and i cant, god knows why, answer in forums.

THIS IS A BOT SCRIPT.

on *:text:!seek*:#:{
  if ($timer(seekandestroy).secs) { 
    if (!%awarn) {
      msg $chan !seek is in Auto-Pilot :) next check in $duration($timer(seekandestroy).secs),1)
      set %awarn 1
timerawarn 1 60 unset %awarn
    }
  }
else {
  if ($2 == auto) { who $chan | timerseekandestroy 0 3600 who $chan }
 if (!$2) { who $chan }
}
}
alias who {
  set %chan $1
  who $1-
}
#352 on
;raw *:*:{ echo -s $numeric $1- }
raw 352:*:{
  if ($6 != $me) {
    if (G isin $7) || ($nick(%chan,$6).idle > 1800) { write awayu.sys $6 }
  }
}
raw 315:*:{ 
  var %y = 1
  var %z = 0
  while (%y <= $lines(awayu.sys)) {
    if ($read(awayu.sys,%y) isop %chan) { 
      set %awayu $addtok(%awayu,$read(awayu.sys,%y),32)
      inc %z
    }
    inc %y
  }
  mode %chan -o $+ $str(o,$numtok(%awayu,32)) %awayu
  if (%z) { msg %chan These nicks are set as away or were idling for more than $duration(1800,2) }
  ;unset %awayu
}
#352 end

Comments

Sign in to comment.
Jethro   -  Jan 31, 2011

I still find the use of $modespl to be ideal. Besides, every network's protocols are vary from one to another.

 Respond  
MoshMage   -  Jan 31, 2011

Also, idk if it's like that in every network, but in PTnet when your mode string surpass modespl it'll just do another mode # $1- automaticaly without the need to see if $modespl > $calc($0 -1)

 Respond  
MoshMage   -  Jan 31, 2011

Tomato Tomato :)

 Respond  
Jethro   -  Jan 31, 2011

Just making a review since not much is going on here at Hawkee at the moment. I'm just demonstrating another way of looping through the awayu.sys with mIRC's file handling:

raw 315:*:{ 
  var %y = 1
  var %z = 0
  while (%y <= $lines(awayu.sys)) {
    if ($read(awayu.sys,%y) isop %chan) { 
      set %awayu $addtok(%awayu,$read(awayu.sys,%y),32)
      inc %z
    }
    inc %y
  }
  mode %chan -o $+ $str(o,$numtok(%awayu,32)) %awayu
  if (%z) { msg %chan These nicks are set as away or were idling for more than $duration(1800,2) }
}

can be done as:

raw 315:*:{
  .fopen op awayu.sys
  while (!$feof) && (!$ferr) { 
    if ($fread(op) isop %chan) { 
      set %awayu $addtok(%awayu,$v1,32) 
    }
  }
  .fclose op
  mode %chan $+(-,$str(o,$numtok(%awayu,32)) %awayu)
  if (%z) { msg %chan These nicks are set as away or were idling for more than $duration(1800,2) }
}
 Respond  
Jethro   -  Jan 30, 2011

You may take advantage of $modespl for moding multiple targets.

 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.