mIRC Home    About    Download    Register    News    Help

Print Thread
#3916 29/12/02 11:37 AM
Joined: Dec 2002
Posts: 40
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2002
Posts: 40
I'd like to know how to get a script to read how many users are currently in channel (for the purpose of setting a channel limit on users entering the channel and then adjusting the limit). If someone could give me a start in the right direction for doing this, it would be greatly appreciated, thanks smile


~ @#FunFactory / @#WorldChat ~ on DALnet ~
#3917 29/12/02 11:41 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
on @*:join:#:{
mode # +k $calc($nick(#,0) + 1)
}

The above code would set the user limit to the number of users on the channel + 1 every time someone joined (pretty pointless, I know).

#3918 29/12/02 01:29 PM
Joined: Dec 2002
Posts: 21
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 21
Erm, perhaps better "mode +l $calc($nick(#,0) + 1)" and not +k... wink

Make sure you don't get flooded if too many people join at once. I do recommend that you set a member limit about 10 or 15 above the number of channel users, then let the script check it everytime someone joins the channel, then, if number of users is 15 (for instance) and your user limit is 16, let the script add another 10 or 15 users to the limit...

Not sure if you can understand what I'm writing (funny english, lol) but you can ask more help I guess smile


DNWT.net Coalition of irc networks
#3919 29/12/02 02:26 PM
Joined: Dec 2002
Posts: 40
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2002
Posts: 40
Thanks Collective and Saturne .. I had noticed the +k was the wrong mode and put in the +l instead for what I'm working on.
Code:
on me:1:join:#:{ .timerlimitcheck 0 180 /limitcheck #channel }


alias limitcheck {
  .set %LimCheck $calc($nick(#,0))
  goto next
  :next
  if ( $me isop #channel ) && ( nickhere !isop #channel ) { .set %AdjLim %LimCheck + 5 | /mode #channel +l %AdjLim | goto end }
  else goto end
  :end
}

For some reason the above isn't reading how many people are in channel. Can anyone see what's wrong?


~ @#FunFactory / @#WorldChat ~ on DALnet ~
#3920 29/12/02 02:52 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Bah goddamn typos...anyway what exactly are you trying to do with that script?

#3921 29/12/02 03:04 PM
Joined: Dec 2002
Posts: 40
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2002
Posts: 40
Well after joining the channel I want the script to check how many users are in channel every 3 minutes and if another bot isn't opped in channel, to increase the channel limit by 5 more than how many users are currently in channel. I hope that makes since - it's just after 4am here lol


~ @#FunFactory / @#WorldChat ~ on DALnet ~
#3922 29/12/02 03:07 PM
Joined: Dec 2002
Posts: 21
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 21
I think the problem comes from $calc($nick(#,0)).

Firstly, you don't need $calc to check the number of users, and secondly, you're using an alias so it doesn't know what channel # is.

I have also noticed that you used the command /limitcheck #Channel, so I suggest you use a local variable to store the channel name, i.e.
Code:
alias limitcheck { 
 var %tmpchan $1
 .set %LimCheck $nick(%tmpchan,0)
goto next  
:next 
 if ($me isop %tmpchan) && ( nickofyourbots !isop %tmpchan) { 
.set %AdjLim %LimCheck + 5 
mode %tmpchan +l %AdjLim 
 goto end 
} 
 else { goto end }
:end
}
  


Edit : I saw your last post after I posted that one...

Last edited by Saturne; 29/12/02 03:08 PM.

DNWT.net Coalition of irc networks
#3923 29/12/02 03:09 PM
Joined: Dec 2002
Posts: 21
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 21
I do think that code should work, although I didn't test it.

Edit : 4am ? ! Shoudl't you be into your bed ? lol, it's about 4pm here !

Last edited by Saturne; 29/12/02 03:11 PM.

DNWT.net Coalition of irc networks
#3924 29/12/02 03:13 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Saturne got the right code, although it would save you having to send the mode +l etc every 3 mintues if you did:

Code:
on @*:JOIN:#channelname:{
  if ( botname !isop # ) {
    mode # +l $calc($nick(#,0) + 5)
  }
}


Edit: Said +k again, ffs

#3925 29/12/02 03:19 PM
Joined: Dec 2002
Posts: 21
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 21
that prevent from using the timer, but I'm not sure whether it's very safe, what if two hundred or bots suddently joined ? crazy


DNWT.net Coalition of irc networks
#3926 29/12/02 03:22 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Somewhat unlikely, don't ya think? smile, besides, sending a line every 3 minutes isn't very good, since every line you send which isn't needed is just a waste of bandwidth..

#3927 29/12/02 03:25 PM
Joined: Dec 2002
Posts: 21
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 21
Well, I kinda don't trust huge networks such as DALnet... I've spent a lot of time there at the very beggining, then on the ircx server irc.msn.com and it could happen any moment. Now with that user limit, it's unlikely, but you never know, some *intelligent* lamer could make their bots to join with a 1sec timer, just to annoy the channel owners... Okok, I'm paranoïd, lol


DNWT.net Coalition of irc networks
#3928 29/12/02 03:30 PM
Joined: Dec 2002
Posts: 40
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Dec 2002
Posts: 40
woohooooooo thanks Collective and Saturne .. I finally got it to work!! laugh

lol yeah I guess I should be in bed at 4:30am lol but I don't have any work at the moment (unless the temp agency phones me) so my sleep time is not always when it should be lol


~ @#FunFactory / @#WorldChat ~ on DALnet ~
#3929 29/12/02 03:48 PM
Joined: Dec 2002
Posts: 21
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 21
I'm glad you got it to work Time4aholiday (what a nice nick cool) laugh


DNWT.net Coalition of irc networks
#3930 31/12/02 03:16 AM
Joined: Dec 2002
Posts: 76
A
Babel fish
Offline
Babel fish
A
Joined: Dec 2002
Posts: 76
Code:
on @*:JOIN:#channelname:{
  if ( botname !isop # ) { 
    mode # +l $calc($nick(#,0) + 5)
  }
}

If 10 clones join to channel in 3 secs, i want stoped set limit to channel, can u help me ?

#3931 31/12/02 04:57 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Code:
  
;  This script will automatically set the limit of the channel to 10 more than the
;  current nick compliment of the channel at the time the timer fires.
;
;  It will do this for any channel you get opped in, so make sure that the ops
;  in that channel don't mind you running it (i.e., if they already have a bot
;  that does so).
  
on *:OP:#: if ($opnick == $me) $+(.timer,$chan) 0 600 SetLimit $chan
on *:DEOP:#: if ($opnick == $me) $+(.timer,$chan) off
on *:PART:#: if ($opnick == $me) $+(.timer,$chan) off
alias SetLimit .raw MODE $1 +l $calc($nick($1,0) + 10)


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard