mIRC Home    About    Download    Register    News    Help

Print Thread
#81558 01/05/04 05:35 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
OP Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Hi smile I dont know if this subject has been discusede before, but i couldnt find anything with the Search function..

I'd like to have a channel limiter script. For example, if 5 ppl have joined/parted the channel, the script would set the +l mode to <number of ppl in the channel> +/- N

Or maybe if 10% or 20% of the ppl in the channel have left/joined. That depends..

Does this make sense lol? :P

Thanks, Zyzzy. smile


"All we are saying is give peace a chance" -- John Lennon
#81559 01/05/04 06:55 PM
Joined: Oct 2003
Posts: 34
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Oct 2003
Posts: 34
on *:join:#channel { dolimit }
on *:part:#channel { dolimit }
on *:quit:#channel { dolimit }
alias dolimit {
mode #channel +l $calc($nick(#channel,0) + 2)
}

that will set the limit of the room 2 more than how many people are there when they join/part/quit.. You can use a timer to make it delayed a bit too if you want.. And of course, you can do all sorts of things with $nick(#channel,0) and the $calc() function..

#81560 01/05/04 07:03 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
OP Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Code:
 $calc([color:Red]$nick[/color](#channel,0) + 2)

Why the $nick there? Shouldn't $calc(#chan,0)+2) work?

Ii'd like to have a certain margin of parts and joins, like, lets say, 5 joins/parts.. sth like:
Code:
on *:JOIN:#: {
 inc %limit.count
}
on *:PART:#: {
 inc %limit.count
}
on *:QUIT: {
 inc %limit.count
}

and when %limit.count got to 5, it would trigger the script. smile
Oh, and that the same person couldn't trigger that /inc event twice for the next 2 minutes. Like, if they just join, stay 5 seconds and part, it wouldnt count twice.. just the join.

Lol.. that's confusing :P

Thanks, Zyzzy smile


"All we are saying is give peace a chance" -- John Lennon
#81561 01/05/04 07:15 PM
Joined: Oct 2003
Posts: 34
S
Ameglian cow
Offline
Ameglian cow
S
Joined: Oct 2003
Posts: 34
Ok, I haven't tested this so I'm not sure if it'll work right. Let me know how it goes:

Code
on *:join:#channel { dolimit $nick }
on *:part:#channel { dolimit $nick }
on *:quit:#channel { dolimit $nick }
alias dolimit {
if (%limit. [ $+ [ $1 ] ] == $null) {
inc %count.limit 1
set -u120 $+(%,limit,.,$1) 1
if (%count.limit == 5) {
mode #channel +l $calc($nick(#channel,0) + 5)
}
}
}

BTW, it does have to have the $nick( .. type /help Nick and Address Identifiers and read up on it wink

Last edited by spling; 01/05/04 07:19 PM.
#81562 01/05/04 07:33 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
OP Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
It worked here, thanks!! laugh

Lol.. i realized the $nick thing later :P

Thanks for the help!

Zyzzy smile


"All we are saying is give peace a chance" -- John Lennon
#81563 01/05/04 10:47 PM
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
You may want to search to find a better method, because with that method, the room runs the risk of flooding, among other problems. I have a mode setter script which has a few features, such as a "mode lock", but needs a serious re-writing.

What I recommend is finding a limit setter that runs on an independant timer that is not based directly on when someone joins the room. If you do, someone who wants to attack the room can easily learn the fixed timing and start doing floods. But with a semingly random adjustment period, it's harder to get it going. Plus, if you happen to be in several rooms and multiple people join, you run the risk of flooding off depending on the server.

(I'm not really knocking the script that was given, but I have seen some serious stuff that would make the script a waste of time).

#81564 02/05/04 12:06 AM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
OP Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Yes, i realized that after a while of use. I adapted it to work with different channels independentely (if that's a word :P), since it is a general script.

I know its not a very quick or very effective system, but the bot (where the script is loaded) is only in 2 chans at the moment, so no big worries smile

I'd apreciate it, though, if a quicker and more safe script would pop up here, or if you could point one out for me.

Thanks, Zyzzy smile

EDIT: --> I'll ask this here just so i wont waste a post on it :P
Is there a way to do this:
Code:
if ($ulevel == 2,5)

meaning if $ulevel is 2 OR 5 without having to use the || ?

Last edited by Zyzzyx26; 02/05/04 12:41 AM.

"All we are saying is give peace a chance" -- John Lennon
#81565 02/05/04 12:59 AM
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
if ($istok(2 5,$ulevel,32)) { commands }

#81566 02/05/04 01:08 AM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
OP Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Great, thanks.. laugh

So if (!$istok(2 5,$$2,32)) would work too, right?

Thanks, Zyzzy smile


"All we are saying is give peace a chance" -- John Lennon
#81567 02/05/04 01:23 AM
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
if (!$istok(2 5,$ulevel,32)) { }
that will restrict access if it matches those levels

If you want to find out all the levels a person has, you shouldn't use $ulevel, as that returns user level that triggered the script. They may have other user levels that you wish for them to have access (or NOT have access) to something that $ulevel will still give to them.

Try $level - that may help some.

#81568 02/05/04 01:31 AM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
OP Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
This part im using in another script, one that adds a user to my bot's user list. Level 2 is blacklisted and level 5 cannot be opped.

This specific part tells the script that, if the level of the user that the $nick (the one who activated the command) set is 2 or 5, then it adds a = in front of it, to make sure it that lvl 5 wont activate the lvl 2.
Code:
if ($istok(2 5,$$2,32)) { var %level = $chr(61) $+ $$2 }


so if i add the user *!*@itsme.com with level 5, the in the bot's userlist will be:
=5:*!*@itsme.com

I need the (!$istok(2 5,$$2,32) into the elseif, that follows that if statement.

So.. does the ! in front of it will check if $$2 != 2 or 5?

Thanks, Zyzzy smile


"All we are saying is give peace a chance" -- John Lennon
#81569 02/05/04 01:46 AM
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
to update your code:
Code:
if ($istok(2 5,$2,32)) { var %level = $+(=,$2) }

If you do !$istok then it will only be "true" if there are no matches.. ie, if someone triggers with a level of 2 or 5, then $istok is true, and !$istok is false..

Andy triggers level 1, Bob triggers level 2, Charles triggers 3, David triggers 4 and Elmo triggers 5 (notice that the first letter corresponds with the value, as an example)..

The following people trigger $istok(2 5,$ulevel,32):
Bob and Elmo

The following people trigger !$istok(2 5,$ulevel,32):
Andy, Charles and David

Hope that clarifies and clears it up for you

#81570 02/05/04 01:56 AM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
OP Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Yes, all clear now! laugh

Thanks for the help wink

Zyzzy.


"All we are saying is give peace a chance" -- John Lennon

Link Copied to Clipboard