mIRC Homepage
Posted By: MonkeyMan1988 Voice a person for 60 seconds - 09/09/08 11:17 AM
ok, its me again.. got a new command im trying to figure out
i want to have a command that gives a person voice in the room for 60 seconds, then removes voice
so far i have this command

Code:
on 2:TEXT:*!allow *:#monkeyman1988: { /mode #monkeyman1988 +v $2
  /msg $chan $2 is now voiced
}


i know there has to be some kind of delay command, that allows me to put the "remove voice" on after 60 seconds can someone help me out?
Posted By: Solo1 Re: Voice a person for 60 seconds - 09/09/08 02:11 PM
Code:
on 2:text:!allow*:#monkeyman1988: { 
  if ($2 ison $chan) && ($2 !isvoice $chan) {
    mode $chan +v $2
    msg $chan $2 is now voiced
    $+(.timervoice,$network,$chan,$2) 1 60 mode $safe($chan) -v $safe($2) 
  }
}
on *:disconnect: $+(.timervoice,$network) $+ * off
alias safe return $!decode( $encode($1,m) ,m)


I use the $safe alias so qwerty won't kill me when he sees this post. mad
Posted By: MonkeyMan1988 Re: Voice a person for 60 seconds - 09/09/08 07:21 PM
That Seems like alot of useless code to do a simple thing.. isnt there a better, cleaner way to do it?
Posted By: RoCk Re: Voice a person for 60 seconds - 09/09/08 07:40 PM

I would say there is no need to worry about the contents of the channel name because the channel name is specified in the location section. Also, there's no need for the DISCONNECT event since the timer(s) will already be stopped unless the -o switch is used. Also, no need to message the channel that the user has been voiced because it will be seen, but add that part back if you want.

Code:

on @2:TEXT:!allow &:#monkeyman1988: { 
  if ($2 isreg #) {
    mode # +v $2
    $+(.timervoice,$cid,#,$2) 1 60 mode # -v $2
  }
}

Posted By: Crinul Re: Voice a person for 60 seconds - 09/09/08 07:53 PM
Originally Posted By: RoCk

...
Code:

on @2:TEXT:!allow &:#monkeyman1988: { 
  if ($2 isreg #) {
    mode # +v $2
    $+(.timervoice,$cid,#,$2) 1 60 mode # -v # $2
  }
}



There is an error in your code:

Code:
$+(.timervoice,$cid,#,$2) 1 60 mode # -v # $2


Should be:

Code:
$+(.timervoice,$cid,#,$2) 1 60 mode # -v $2
Posted By: RoCk Re: Voice a person for 60 seconds - 09/09/08 07:54 PM

Indeed. Good catch. Fixed it.
Posted By: MonkeyMan1988 Re: Voice a person for 60 seconds - 09/09/08 08:05 PM
actually, rock i appreciate your help again.. but i found a way to do it now
This command is so that people can have temporaty permission to post a link without my bot going apeshit on them for posting it.

i think this is perfect.. it worked great for me, and its much simpler syntax

on 2:TEXT:*!allow *:#monkeyman1988: { /mode #monkeyman1988 +v $2
/msg $chan $2 has temporary link permission
/timer 1 30 /msg $chan $2's link permission has expired
/timer 1 31 /mode #monkeyman1988 -v $2
}
© mIRC Discussion Forums