|
Joined: Dec 2002
Posts: 40
Ameglian cow
|
OP
Ameglian cow
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
~ @#FunFactory / @#WorldChat ~ on DALnet ~
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
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).
|
|
|
|
Joined: Dec 2002
Posts: 21
Ameglian cow
|
Ameglian cow
Joined: Dec 2002
Posts: 21 |
Erm, perhaps better "mode +l $calc($nick(#,0) + 1)" and not +k... 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
DNWT.net Coalition of irc networks
|
|
|
|
Joined: Dec 2002
Posts: 40
Ameglian cow
|
OP
Ameglian cow
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.
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 ~
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
Bah goddamn typos...anyway what exactly are you trying to do with that script?
|
|
|
|
Joined: Dec 2002
Posts: 40
Ameglian cow
|
OP
Ameglian cow
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 ~
|
|
|
|
Joined: Dec 2002
Posts: 21
Ameglian cow
|
Ameglian cow
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.
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
|
|
|
|
Joined: Dec 2002
Posts: 21
Ameglian cow
|
Ameglian cow
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
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
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: on @*:JOIN:#channelname:{
if ( botname !isop # ) {
mode # +l $calc($nick(#,0) + 5)
}
} Edit: Said +k again, ffs
|
|
|
|
Joined: Dec 2002
Posts: 21
Ameglian cow
|
Ameglian cow
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 ?
DNWT.net Coalition of irc networks
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
Somewhat unlikely, don't ya think? , 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..
|
|
|
|
Joined: Dec 2002
Posts: 21
Ameglian cow
|
Ameglian cow
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
|
|
|
|
Joined: Dec 2002
Posts: 40
Ameglian cow
|
OP
Ameglian cow
Joined: Dec 2002
Posts: 40 |
woohooooooo thanks Collective and Saturne .. I finally got it to work!! 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 ~
|
|
|
|
Joined: Dec 2002
Posts: 21
Ameglian cow
|
Ameglian cow
Joined: Dec 2002
Posts: 21 |
I'm glad you got it to work Time4aholiday (what a nice nick )
DNWT.net Coalition of irc networks
|
|
|
|
Joined: Dec 2002
Posts: 76
Babel fish
|
Babel fish
Joined: Dec 2002
Posts: 76 |
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 ?
|
|
|
|
Joined: Dec 2002
Posts: 1,321
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
; 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
|
|
|
|
|