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.

Optimizing the output of putserv, putquick or putkick.

Old posts that have not been replied to for several years.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Optimizing the output of putserv, putquick or putkick.

Post by awyeah »

Okay the thing here which I encounter is:
I have a clone detection script. It detects mass clones/botnets joining a channel very fast, which bans and kicks them. It also detects clones and botnets doing channel cycles very fast and bans and kicks them out. :D

Currently I am using newchanban. The newchanban stacks the kicks properly, so if there are alot of clones the bot doesn't get excess flood while kicking the clones out. (if there are alot even!)

The thing is that channels I use, some people on them logon from cybercafes, universities, which have LAN and static IPs. Some of them are OPS as well which causes a greater problem. I can't use newchanban as it bans the ops even. Plus I cant add every op in the +o, or any user flag and make them exempt it like +dontkickops or even add it in the tcl to exempt them, as there are many, infact alot of ops! :)

So here I have a small solution to detect and kick the clones.
If someone can help me to optimize this in a better way it would be great.
Normally the bot gets excess flood after kicking 7-8 ops with this script, and with newchanban it can kick upto 15+ or more!

Code: Select all

proc clone:kick:remove {banmask nick host chan} {
 global botnick clonebantime
  set users [chanlist $chan]; set kicklist [list]
  foreach user $users {
   if {[string equal -nocase $user $nick]} { continue }
   if {([string match -nocase *$host* "${nick}![getchanhost $user $chan]"]) && (![isop $chan $user])} { lappend kicklist $user }
   }
  putquick "KICK $chan [join $kicklist {,}] :<my kick msg>"
 timer $clonebantime [list clone:unban $banmask $chan]
}
Is there any other faster, better way to do this?
If I add a foreach loop, 'foreach person $kicklist' instead of
joining $kicklist with {,} then would it be faster? 8)

I am using putquick with -next because it is currently the most
fastest way todo things as I want to kick the clones out of the channel
as fast as possible, so they dont flood. The others putserv, putkick are relatively slower.

If someone or anyone here has a better idea to do this in a faster,
efficient way, so the bot does not get excess flood, if it kicks many
users please let me know, how to implement this! :mrgreen:

I have set my max-queue and etc other send/queue sizes in the .conf file to a larger number as well, so that did not resolve it as well. :wink:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Well, I doubt you can have bouth speed and no excess flood if that's what you are looking for. Make your own queue for modes.. or use the pushmode, but is a bit slower.. btw, putquick -next is the fastest! :mrgreen:
spock wrote: To bypass the queue completely you could do something like:

Code: Select all

proc putnow { a } { 
  append a "\n" 
  putdccraw 0 [string length $a] $a 
} 
but you wont want to push too many lines at a time (excess flood / sendq exceeded / whatever else).

putnow "PRIVMSG #abc :test 1 2 3"
The search function can do miracles sometimes.. :mrgreen:
Once the game is over, the king and the pawn go back in the same box.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Umm thanks... for the reply caesar this a new command I am introduced too now. It is really helpful. :mrgreen:

Actually I tried to search, but I didn't know about this putdccraw. I had seen it some where in some post, but I ignored it, thought it might be in relation to something with a dcc bind or something with ssl. :P

Anyway thanks, I'll try it out. I searched 'putdccraw' and got lots of information about this queue on this forum yeah. Although I coundn't find any result related to this in the tcl-commands.doc or even on google.com. :wink:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

putdccraw idx size text
:mrgreen:
Once the game is over, the king and the pawn go back in the same box.
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Post by CoMMy »

Let me help!!!!


this is they way to do it.
AND ITS THE FASTEST EVER!!!!!!!!!!!!!!!!!!!

example.

Code: Select all

set q "MODE $chan :+o $nick"
putdccraw 0 [string len $q] $q
Done!!!

Btw msg me awyeah to send you an even faster way with putdccraw!!!!!
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

And what I've pasted above if not about putdccraw? :P
Once the game is over, the king and the pawn go back in the same box.
User avatar
CoolCold
Voice
Posts: 9
Joined: Thu Feb 27, 2003 11:29 pm
Location: Moscow,RU

Fast server queu

Post by CoolCold »

I've wrote my own putserv for max output speed
U may take a look at http://web.coolcold.org/scripts/putfast_vs_putserv.tcl
D
DayCuts
Voice
Posts: 37
Joined: Tue Jun 15, 2004 8:43 am

Post by DayCuts »

Code: Select all

proc putnow { a } { 
  append a "\n" 
  putdccraw 0 [string length $a] $a 
} 
Am i missing something with this, above was said this bypasses all msg queues, however when i use a loop to send 10 messages it still seems to kick into some sort of queue after the first 5. The first 5or6 will come instantly then the rest seem to come as if sent with putquick command.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Depends upon your ircd as well.
I have seen 'putdccraw' be more faster than 'putquick -next'.

As for the delay you are saying, well it is kinda good, if you send alot, the server will disconnect your bot (client) for sending too much data in less than the defined amount of secs (time).

Excess flood, happens both on the sending as well as the receiving side.
Sometimes my eggie, get excess flood while using, normal 'putquick', without the -next function even.

But I have a solution. Some undocumented variables you can set
not defined in the eggdrop .conf files, for stacking and etc.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Post by CoMMy »

DayCuts wrote:

Code: Select all

proc putnow { a } { 
  append a "\n" 
  putdccraw 0 [string length $a] $a 
} 
Am i missing something with this, above was said this bypasses all msg queues, however when i use a loop to send 10 messages it still seems to kick into some sort of queue after the first 5. The first 5or6 will come instantly then the rest seem to come as if sent with putquick command.
Yes you are right, It happens to me also. However when using putdccraw for mode changes it can make up to 30-40 mode changes in 1 second and then slow down. This happens because there is a flood protection acting in the eggdrops module.:D
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

However when using putdccraw for mode changes it can make up to 30-40 mode changes in 1 second and then slow down.
On which irc network?
Que?
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Post by CoMMy »

Undernet Of Course!!!!!!!!! :D

I made a proc and put it in a script like that and with 1 bot i can make up to 40 mode changes without the bot getting lag!!!

Nice :D
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

Eh, it is not possible on IRCnet, where you can set max 3 modes and only when you do this in one line (MODE #channel +bo-v *!he@* nick1 nick2).
Que?
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Post by CoMMy »

ircU PoWaH !!!!! :mrgreen:
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Most ircd's support 6. :P
Yeah, 6 is the common mode changes you can do in 1 go.
However, I've seen servermodes, do 8 - 9 on DALnet but for
users simply 6 is the limit! :mrgreen:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked