mIRC Home    About    Download    Register    News    Help

Print Thread
#95684 26/08/04 02:31 PM
Joined: Aug 2004
Posts: 43
C
Crosz Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Aug 2004
Posts: 43
Hi again to everyone,

Looking for a code so my bot reads the channel limit and sets it up 3 users more than it is everytime someone joins or parts the channel to stop join floods

Thanks again to all who reply

my bots coming along nicely thanks to you all.

Last edited by Crosz; 26/08/04 02:32 PM.
#95685 26/08/04 02:43 PM
Joined: Aug 2004
Posts: 16
I
Pikka bird
Offline
Pikka bird
I
Joined: Aug 2004
Posts: 16
Hi!

Are you looking for something like this?
Code:
on 1:JOIN:#channel:/mode $chan +l $gettok($chan($chan).mode,2,32)


Regards,
KathY
#95686 26/08/04 02:59 PM
Joined: Aug 2004
Posts: 43
C
Crosz Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Aug 2004
Posts: 43
I cant seem to get it to work

should i change #channel to mine and if so that dont work but its not showing any errors which is good and what numbers do what?

Cause an tring to learn mirc coding.
how many have to be in the channel to get this to work?

#95687 26/08/04 03:11 PM
Joined: Aug 2004
Posts: 43
C
Crosz Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Aug 2004
Posts: 43
Once again your code has helped and i have what i need now. dont know why i never though of it before


on 1:JOIN:#:{ .mode $chan +l 1 }
on 1:PART:#:{ .mode $chan -l 1 }

would that stop a mass floood join?

#95688 26/08/04 03:11 PM
Joined: Aug 2004
Posts: 16
I
Pikka bird
Offline
Pikka bird
I
Joined: Aug 2004
Posts: 16
Hi!

I made a silly mistake (I should test it befor showing it here..;))

Code:
on 1:JOIN:#channel:/mode $chan +l $calc($nick($chan,0) + 3)
on 1:PART:#channel:/mode $chan +l $calc($nick($chan,0) + 3)

This script (I tested it one time) sets the limit up, when someone joins "#channel" (you can replace the channel)...


Regards,
KathY
#95689 26/08/04 03:11 PM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Quote:

on 1:JOIN:#channel:/mode $chan +l $calc($nick($chan,0) + 3)
on 1:PART:#channel:/mode $chan +l $calc($nick($chan,0) + 3)

Using that method although it might work, It will flood everytime someone joins.

A "solution" would be to check every few minutes and adjust the limit accordingly, for example;

On me:*:OP:[color:red]#channel
:{
.timer $+ $chan 1 300 limitchk $chan
}

alias limitchk {
if ($me isop $1) { mode $$1 +l $calc($nick($1,0) + 3) }
else { .timer $+ $chan off }
}
[/color]

This will run on #channel, and set the limit every 5 minutes, 3 above what it already is, you can change the '300' in the above code, to increase or decrease the delay between limit changes (300 being 5 minutes).

Edit: If your trying to prevent a "flood" then download existing Join/Part flood scripts, if you look at your code it will, do the following (if only you are there for example).

* Username-1 has joined #channel
* You sets mode: +l 5
* Username-2 has joined #channel
* You sets mode: +l 6
* Username-3 has joined #channel
* You sets mode: +l 7
* Username-4 has joined #channel
* You sets mode: +l 8
* Username-5 has joined #channel
* You sets mode: +l 9
* Username-1 has left #channel
* You sets mode: +l 8
* Username-2 has left #channel
* You sets mode: +l 7
* Username-3 has left #channel
* You sets mode: +l 6
* Username-4 has left #channel
* You sets mode: +l 5
* Username-5 has left #channel
* You sets mode: +l 4

Undoubtably by the end of that you've done, 10 mode changes and the server will excess flood you off.

Eamonn.

#95690 26/08/04 04:10 PM
Joined: Aug 2004
Posts: 43
C
Crosz Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Aug 2004
Posts: 43
thanks all

Last edited by Crosz; 26/08/04 04:12 PM.
#95691 26/08/04 04:23 PM
Joined: Aug 2004
Posts: 43
C
Crosz Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Aug 2004
Posts: 43
Here is what i have. join works fine but part does nothing

on 1:JOIN:#:{ .mode $chan +l $calc($nick($chan,0) + 1) }
on 1:PART:#:{ .mode $chan +l $calc($nick($chan,0) + 1) }

when i part the channel the bot does not read the users and + one more why what have i missed?

on 1:PART:#:{ .mode $chan +l $calc($nick($chan,0) + 1) }

Last edited by Crosz; 26/08/04 04:45 PM.
#95692 26/08/04 08:19 PM
Joined: Aug 2004
Posts: 43
C
Crosz Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Aug 2004
Posts: 43
its ok i found exactly what i was looking for on yahoo

#95693 30/08/04 09:29 AM
Joined: Apr 2004
Posts: 16
A
Pikka bird
Offline
Pikka bird
A
Joined: Apr 2004
Posts: 16
I'm using my bot to count the users in my channel(s).

on @*:JOIN:#: .timerlimit_ [ $+ [ $chan ] ] 1 5 /mode $chan +l $calc($nick($chan, 0) + 10)
on @*:PART:#: .timerlimit_ [ $+ [ $chan ] ] 1 5 /mode $chan +l $calc($nick($chan, 0) + 10)
on @*:KICK:#: .timerlimit_ [ $+ [ $chan ] ] 1 5 /mode $chan +l $calc($nick($chan, 0) + 10)
on @*:QUIT: {
var %c = $comchan($nick, 0)
while (%c > 0) {
var %chan = $comchan($nick,%c)
.timerlimit_ [ $+ [ %chan ] ] 1 5 /mode %chan +l $calc($nick(%chan, 0) + 10)
/dec %c
}
}

The problem is that it stay at the same when a user leave a channel. Is the code wrong or do I need to change something?


Alex2
#95694 30/08/04 09:46 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
Im GUESSING it's because you evaluated the $calc function when you set the timer. What you need to do is delay the evaluation of it till the timer hits, so try this and see if it works:

on @*:JOIN:#: .timerlimit_ [ $+ [ $chan ] ] 1 5 /mode $chan +l $!calc($nick($chan, 0) + 10)
on @*:PART:#: .timerlimit_ [ $+ [ $chan ] ] 1 5 /mode $chan +l $!calc($nick($chan, 0) + 10)
on @*:KICK:#: .timerlimit_ [ $+ [ $chan ] ] 1 5 /mode $chan +l $!calc($nick($chan, 0) + 10)
on @*:QUIT: {
var %c = $comchan($nick, 0)
while (%c > 0) {
var %chan = $comchan($nick,%c)
.timerlimit_ [ $+ [ %chan ] ] 1 5 /mode %chan +l $!calc($nick(%chan, 0) + 10)
/dec %c
}
}

The ! in the $calc tells mirc NOT to evaluate it right there and then and would then make the timer command do this:


.timerlimit_ [ $+ [ %chan ] ] 1 5 /mode %chan +l $calc($nick(%chan, 0) + 10)

instead of (example):

.timerlimit_ [ $+ [ %chan ] ] 1 5 /mode %chan +l 25


Make sence?

EDIT

Something else you could do at that point is get rid of the ON KICK event since it wouldnt be needed anymore as well as you could change the ON PART so that if YOU part it stops the timer and same with the ON QUIT. With the use of the $!calc, the timer will only eval the $calc($nick(%chan, 0) + 10) when it fires and not beforehand so some of those events MIGHT BE (not necessarily tho) useless depending on what you're doing.

Last edited by landonsandor; 30/08/04 10:01 AM.

Those who fail history are doomed to repeat it

Link Copied to Clipboard