mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2008
Posts: 13
M
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?

Joined: Mar 2007
Posts: 139
S
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

Joined: Sep 2008
Posts: 13
M
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?

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

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.
Joined: Feb 2006
Posts: 181
C
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

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

Indeed. Good catch. Fixed it.

Joined: Sep 2008
Posts: 13
M
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
}


Link Copied to Clipboard