Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

idle devoice snippet

Recommended Posts

  • Administrators

This is another devoice on idle snippet
It works on multiple channels
Usage !idle on numberinsecondstodevoice
It wil even devoice nicks that have changed theire nickname

I know it could be better coded but it works :)
If some could make it work beter please comment so I can learn how to better code on mIRC cause i'm still a noob in coding mIRC

on *:TEXT:*:#: { if ($readini(channels.ini,$chan,idle) == on) { 
    if ($me ison $chan)  { 
      if ($regex($nick(#,$nick).pnick,/(!|~|&|@|%)/)) { halt }
      if ( power isin $1- ) { halt }
      else {
        set %devoicechan $readini(channels.ini,$chan,channeldevoice)
        mode # +v $nick
        timerdevoice. [ $+ [ $nick ] ] $+ . [ $+ [ $chan ] ] 1 $readini(channels.ini,$chan,idletime) mode $readini(channels.ini,$chan,channeldevoice) -v %devoice. $+ $nick | unset %devoice. $+ $nick
      }
    }
  }
}

on *:nick: {
  if $me isop %devoicechan && $newnick isvoice $v2 {
    timerdevoice. [ $+ [ $v1 ] ] 1 $readini(channels.ini,%devoicechan,idletime) .mode $v2 -v $v1
  }
}	

on *:text:!idle*:#: {
  if ($regex($nick(#,$nick).pnick,/(!|~|&|@)/)) {
    if ($2 == on || $2 == off) {
      /writeini channels.ini $chan idle $2
      /writeini channels.ini $chan channeldevoice $chan
      if ($3 !isnum) || (!$3) { /msg # devoicer for $chan is set: off | /writeini channels.ini $chan idle off | halt }
      if ($3 isnum) /writeini channels.ini $chan idletime $3
      /msg # devoice for $chan is set to: $2 on devoicetime: $3 secs.
    }
    else { notice $nick Syntax: !idle <on/off> <Time in seconds to devoice> }
  }
  else { notice $nick Access Denied }
}

Link to comment
Share on other sites



×
×
  • Create New...