mIRC Home    About    Download    Register    News    Help

Print Thread
L
Lettuce
Lettuce
L
Hello all.

I am using the code below in my Remote scripts to auto-op users when they join my channel. Some of the people who join are registered users and receive +o from ChanServ. I want ChanServ's +o event to happen before my script attempts to +o them. Is there any way to add a 2 second delay inbetween the user joining and my script attempting to give them +o? That way, ChanServ will be able to give them +o within the 2 second delay.

on *:JOIN:#channel:{
if ($nick == $me) { halt }
if ($me isop $chan) {
notice $nick 12Welcome to $chan $nick $+ !
mode $chan +o $nick }
}

Thanks,
Lettuce

*edit* I should add I am not a coder or have any coding knowledge. I found the above code by Googling. I am looking for someone to kindly tell me what the complete code should look like, with the addition (if possible) of a time delay. Thanks in advance.

Last edited by Lettuce; 03/05/13 08:46 AM.
Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
You can use a timer to delay a trigger. /help /timers

L
Lettuce
Lettuce
L
I have read through the timers help pages and although it makes some sense to me I do not know how to incorporate that into my script editor. As stated in my original post I would be grateful if someone could simply tell me what the code should be to include the 2 second delay. I'm hoping it's something very simple. I appreciate your reply but just saying "go read /help /timers" doesn't really get me any further. Trust me if it was as simple as going to /help /timers (to me) then I would not be posting here would I?

Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
I guess this would do the trick.
Code:
on *:JOIN:#channel:{
 if ($nick == $me) { halt }
 if ($me isop $chan) {
 ; timer that delay the op event 10 sec, then send it to a alias.
 timer 1 10 op-user $chan $nick
  notice $nick 12Welcome to $chan $nick $+ !
 }
}
alias op-user {
  ; $1 = channel. $2 = nick of user.
  if ($2 !isop $1) { mode $1 +o $2 }
}

Replace 10 with what delay you like, if you dont want to see the timer start put a . inffront of timer (like this: .timer)
Same goes for the "notice" part. .notice

; edit

Added explanation.

Last edited by sparta; 03/05/13 09:22 AM.
Joined: Mar 2010
Posts: 144
Vogon poet
Offline
Vogon poet
Joined: Mar 2010
Posts: 144
Code:
/help /pop


So the event would be:

Code:
on !@*:Join:#:{
  notice $nick 12Welcome to $chan $nick $+ !
  pop 2 $chan $nick
}


Nothing...
L
Lettuce
Lettuce
L
Masoud and Sparta thank you for your contributions, this is now solved!

Thanks again,
Lettuce


Link Copied to Clipboard