mIRC Home    About    Download    Register    News    Help

Print Thread
Voice a person for 60 seconds #204131 09/09/08 11:17 AM
Joined: Sep 2008
Posts: 13
M
MonkeyMan1988 Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Sep 2008
Posts: 13
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?

Re: Voice a person for 60 seconds [Re: MonkeyMan1988] #204136 09/09/08 02:11 PM
Joined: Mar 2007
Posts: 139
S
Solo1 Offline
Vogon poet
Offline
Vogon poet
S
Joined: Mar 2007
Posts: 139
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

Re: Voice a person for 60 seconds [Re: Solo1] #204144 09/09/08 07:21 PM
Joined: Sep 2008
Posts: 13
M
MonkeyMan1988 Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Sep 2008
Posts: 13
That Seems like alot of useless code to do a simple thing.. isnt there a better, cleaner way to do it?

Re: Voice a person for 60 seconds [Re: MonkeyMan1988] #204145 09/09/08 07:40 PM
Joined: Dec 2002
Posts: 2,025
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,025

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
  }
}


Last edited by RoCk; 09/09/08 07:53 PM.
Re: Voice a person for 60 seconds [Re: RoCk] #204146 09/09/08 07:53 PM
Joined: Feb 2006
Posts: 181
C
Crinul Offline
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2006
Posts: 181
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

Re: Voice a person for 60 seconds [Re: Crinul] #204147 09/09/08 07:54 PM
Joined: Dec 2002
Posts: 2,025
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,025

Indeed. Good catch. Fixed it.

Re: Voice a person for 60 seconds [Re: RoCk] #204149 09/09/08 08:05 PM
Joined: Sep 2008
Posts: 13
M
MonkeyMan1988 Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Sep 2008
Posts: 13
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
}