mIRC Homepage
Posted By: Vinniej On join, set mode +L - 11/09/05 10:32 PM
How to do this. I dont want joinflooding in my chan, so i want to block it. Even i need on part and on quit. smile
Posted By: Lpfix5 Re: On join, set mode +L - 11/09/05 11:10 PM
oh i c you want to limit users...

on *:JOIN:#: {
%users = $nick(#,0)
inc %users 3
if ($me isop #) { timer 1 20 //mode # +l %users }
}
;when someone joins the channel it reads how many nicks are in ;channel then increments it by 3 more and sets a timer only if your op
;so that within 20 seconds if 3 nicks or less joins then they are safe
;but that fourth nick will have to wait.

now on to remove the limit when users part or quit
we use the same kinda method here almost

on *:PART:#: {
%users = $nick(#,0)
dec %users
if ($me isop #) { timer 1 20 //mode # +l %users }
}
;this removes 1 user from chan wink limit

same thing for quit
on *:QUIT:#: {
%users = $nick(#,0)
dec %users
if ($me isop #) { timer 1 20 //mode # +l %users }
}
Posted By: SladeKraven Re: On join, set mode +L - 12/09/05 01:47 AM
No dude it isn't the same thing the QUIT event takes no channel parameters. You would need to loop through the channels with $comchan().

-Andy
Posted By: Om3n Re: On join, set mode +L - 12/09/05 03:07 AM
No need to loop through comchan if the limit is running on just one channel, you can use an if statement to check if the quitter was on the channel. Note: since this is the simple version for just one channel, #chan can not be dynamic (ie $chan or #)

Code:
on ^*:quit: {
  if ($nick ison #chan) {
    %users = $nick(#chan,0)
    dec %users
    if ($me isop #chan) { timer 1 20 //mode #chan +l %users }
  }
}
Posted By: SladeKraven Re: On join, set mode +L - 12/09/05 03:13 AM
Well yes but I was adapting from Lpfix5's code where it would trigger on all channels, but you are right there is a way for just one channel.. smile

-Andy
© mIRC Discussion Forums