mIRC Home    About    Download    Register    News    Help

Print Thread
#71338 13/02/04 11:13 PM
M
mbot
mbot
M
Hey.

Trying to make a auto voice script. The code below is out of context but I do not think it matter.

Code:
on !*:JOIN:#:{
  if ($chan == #channel) && ($me isop $chan) && ($nick isreg $chan) { .timer 1 5 mode $chan +v $nick }
}


As far as I know this ought to work. It does but not the way it was intended to. It do auto voice but I added the ($nick isreg $chan) and the timer part in order not to voice users who is given +v or +o by L on quakenet or other users. For some reason this do not work. The script gives +v even if they are given +v or +o before the script timer is supposed to trigger. I am out of ideas. Anyone of You who knows what s wrong?

Regards

#71339 14/02/04 12:07 AM
M
MIMP
MIMP
M
Essentially the code is triggering when they join. It immediately determines if they're a regular user (they would be because the script runs before you see them get opped,) at which point it starts the timer. 5 seconds later the timer goes off and does what it's told, voices them.

You may want to look into the built in /avoice command instead.

#71340 14/02/04 01:33 AM
M
mbot
mbot
M
Hey again.

Posted the same question at hawkee and Tye came up with this:
Code:
on !*:JOIN:#:{
  if ($chan == #channel) && ($me isop $chan) { .timer 1 5 givevoice $chan $nick }
}
alias givevoice {
  if ($2 isreg $1) { mode $1 +v $2 }
}

Which works great. Besides that, he had basically same comments to the code in the first post as you. Been thinking about my own code and lol, I'm either stupid or way to tired to mess with scripts right now. blush All I had to do to make it work was change it into this:
Code:
on !*:JOIN:#:{
.timer 1 5 if ( $me isop $chan ) && ( $chan == #channel ) && ( $nick isreg $chan ) { mode $chan +v $nick }
}

But thanks anyway, MIMP, it's people like you and Tye, who cares to help out fatigued newbies like me, who are to worn out to think for themselves, that there might in fact be another way around. laugh

Regards.

#71341 14/02/04 07:31 AM
D
DaveC
DaveC
D
it would be better to do this.

on !*:JOIN:#channel:{
if ( $me isop $chan ) { .timer.if. $+ $nick $+.reg.then.voice 1 5 if ( $nick isreg $chan ) mode $chan +v $nick }
}

This way the event only goes off if its a join on that channel
You only set a timer off if your oped
The timer is nick specific, so well only ever produce one timer per nick (join part flooders dont flood you off)

#71342 14/02/04 09:08 AM
Joined: Dec 2002
Posts: 191
N
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
Thought this would do.

on @*:JOIN:#channel:{ pvoice 5 # $nick }

#71343 14/02/04 10:17 PM
D
DaveC
DaveC
D
he did not wich to invoke a +v unless the user was still a plain user, I havent tested it but would assume that command is just a time delayed +v, so well trigger regardless of user state at the time.


Link Copied to Clipboard