This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Join Flood Protection (need help)

Old posts that have not been replied to for several years.
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Join Flood Protection (need help)

Post by Gothic-Angel »

I'm trying to figure out how I could start writting join flood protection, I want it to be pretty simple if 8 users join i want the bot to set mode "MR" then remove in a set time prolly 15-30 secs. If there is already one around that I couldn't find I'd be greatful if someone would point me towards it so I could look off it to see how its setup.

If not, I could use some help starting this tcl.
t
tainted
Master
Posts: 239
Joined: Sun May 12, 2002 8:00 pm
Location: chicago
Contact:

Post by tainted »

I am pretty sure either netbots or another script here supports this, almost. The only thing you may need to edit is the actual mode that is set, most set +i and sometimes +m that I have seen.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I've did one exactly like you've asked a time ago and can be found here. :)
Once the game is over, the king and the pawn go back in the same box.
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Post by Gothic-Angel »

I see, one problem with that is he mode floods. Set's MR like 7 times. I tried changing the proc around to.

Code: Select all

if {$nick == $botnick || ![botisop $chan]} { return 0 }
if {![getchanmode $chan == +cMnRtl]} { return 0 }
set nojoins [lindex [split $jtu ":"] 0]
set insec [lindex [split $jtu ":"] 1]
set unlockin [lindex [split $jtu ":"] 2]
incr val($chan)
utimer $nojoins [list reset $chan]
if {$val($chan) >= $nojoins} {
putquick "MODE $chan +MR"
utimer $unlockin [list unlock $chan] }
}
I get an error though [7:41pm] (CustomerServ|ce): [19:41] Tcl error [njf:join]: wrong # args: should be "getchanmode channel"

I had it working last night, but I was drunk and can't figure out what I did so that doesn't help. I know it was working last night close to that or something.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Well, it should be: if {[getchanmode $chan] == "+scRtMn"} { return }

And how dose he the mode floods? Be more specific please.
Once the game is over, the king and the pawn go back in the same box.
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Post by Gothic-Angel »

If 15 bots on a botnet join, he set's mode +MR about 6 times.
so its

Blah has set mode +MR
Blah has set mode +MR
Blah has set mode +MR
etc...
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

He waits with the first +MR thing 60 seconds then removes them then put them back? Is this what are you talking about? I'm running it on two bots and haven't seen something like that. It's reacting on a masive join like after an netsplit or something and is doing the +m thing only once. I'll test myself with an large botnet on my private irc server.
Once the game is over, the king and the pawn go back in the same box.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Did some tests and he puts the modes only once. Also noticed something weird about that *array fix*, isn't working well, remove the ! from the "if {![string match..." line or remove the array fix, seems to be the same thing afterall. Humm..

Also, on what network or what tipe of irc server have you done your tests? I've did mine on an Unreal3.2-beta15 and is working fine.
Once the game is over, the king and the pawn go back in the same box.
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Post by Gothic-Angel »

All my test's were done ont he latest version of bahmaut, I figure this is pretty simple to solve. Just check the channel mode before he places the +MR ( i just made a small change from +m to +MR ) then he shoudn't mode flood.

Let's say bot is in channel #blah, then 15 people join.

bot has set mode +MR
bot has set mode +MR
bot has set mode +MR
Gothic-Angel says wtf
bot has set mode +MR
bot has set mode +MR

then 60 seconds later
bot has set mode -MR
bot has set mode -MR
bot has set mode -MR
bot has set mode -MR
bot has set mode -MR
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I've tested it on ircu and Unreal and haven't seen this mass modes, guess it's the server fault, it's called desync or something like this. Test it on another server, different than bahmaut. Btw, isn't this the irc server Dalnet uses?
Once the game is over, the king and the pawn go back in the same box.
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Post by Gothic-Angel »

Yes, there are a few other networks that use it too.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

An simple test should reveal who's fault is. Test this:

Code: Select all

bind pub o|o !bla pub:bla

proc pub:bla {nick host handle channel arg} {
if {![botisop $channe]} { return }
putserv "PRIVMSG $channel :placing mode 1"
pushmode $channel +m
putserv "PRIVMSG $channel :placing mode 2"
pushmode $channel +m
putserv "PRIVMSG $channel :placing mode 3"
pushmode $channel +m
}
If isn't server fault you should see something like:
placing mode 1
bot mode +m
placing mode 2
placing mode 3
else
placing mode 1
bot mode +m
placing mode 2
bot mode +m
placing mode 3
bot mode +m
Once the game is over, the king and the pawn go back in the same box.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

instead of checking the chanmodes you could unbind the whole proc after the channel has been locked, then use a utimer which binds it again when the channel is "reopened"
Elen sila lúmenn' omentielvo
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Code: Select all

if {[getchanmode $chan] == "+cMnRtl"} { return 0 }
This is after the corrections.

Note, this is invalid checking, if you don't want it to flood the channel with +MR.

This is saying return if it is EXACTLY them modes, and not if it contains them modes. Not just that, but "getchanmode" must also return them in the order above, and not out of place like "+cRnMtl".

Maybe you should use somthing like

Code: Select all

set cm [getchanmode $chan]
if {(([string match {+*[MR]*[MR]*} $cm]) && ([llength [split $cm]] == 1)) || (([string match {+*[MR]*[MR]* *} $cm]) && ([length [split $cm]] > 1))} { return }
The above needs splitting down into component portions.

The first string match, checks to see if there is no key or limit set on the channel, and if not, check to see if the M & R modes are there. The second does the same mode matching, but only if a key or limit is there.

If +MR is set, it returns.

I am presuming this is what you want. Because you script isn't returning, it is setting +MR continualy.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I've added an putlog "bla" and seems to be correct. It was tryng to put the modes again and again. Thanks for the getchanmode tip and for the correction.
Once the game is over, the king and the pawn go back in the same box.
Locked