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.

Faster ?

Old posts that have not been replied to for several years.
Locked
User avatar
Rusher2K
Halfop
Posts: 88
Joined: Fri Apr 18, 2003 10:45 am
Location: Germany
Contact:

Faster ?

Post by Rusher2K »

How can i make this faster because need is very slow :


Code: Select all

bind need -|- "*" q:need

proc q:need {channel need} {
    global qscript
    set target ""
    if {[matchattr Q |o $channel]} {
        set target $qscript(qtarget)
    }
    if {[matchattr L |o $channel]} {
        set target $qscript(ltarget)
    }
    if {$target==""} { return 0 }
    switch -exact [string tolower $need] {
        "op" {
            putquick "PRIVMSG $target :OP $channel"
            return 1
        }
        "unban" {
            if {[matchattr L |o $channel]} {
            putquick "PRIVMSG $target :recover $channel"
            putquick "JOIN $chan"
utimer 1 "putquick \"JOIN $chan\""
            }
            if {[matchattr Q |o $channel]} {
            putquick "PRIVMSG $target :unbanall $channel"
            putquick "PRIVMSG $target :deopall $channel"
            putquick "JOIN $chan"
            utimer 1 "putquick \"JOIN $chan\""
            }
            return 1
        }
        "invite" {
            putquick "PRIVMSG $target :INVITE $channel"
            putquick "JOIN $chan"
            utimer 1 "putquick \"JOIN $chan\""
            return 1
        }
    }
    putquick "PRIVMSG $target :CLEARCHAN $channel"
    putquick "JOIN $chan"
    utimer 1 "putquick \"JOIN $chan\""
    return 1
}
[/code]
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

try using the -next switch with putquick
putquick <text> [options]
sends text to the server, like 'dump' (intended for direct server
commands); output is queued so that you won't flood yourself off
the server, using the MODE queue (should be a lot faster)
options are:
-next push messages to the front of the queue
returns: nothing
photon?
d
dun_dacil
Voice
Posts: 16
Joined: Wed Sep 04, 2002 3:36 pm
Location: Pisa, Italy

Re: Faster ?

Post by dun_dacil »

[quote="Rusher"]How can i make this faster because need is very slow :



My guess is that the script is overall "slow", and in particular the "unban" bit.It executes a few commands quickly, and then it bogs down.

If you really need to push that many instructions through to the server (I am referring to the putquick ones), you definitely need to hack the egg code.

The way the queues are built is such that the "quick" queue is executed really quickly only as far as the first 4 things in the queue are concerned. After that, the eggdrop slows down, and treats the other things in the quick queue putting some dealy (around a couple of seconds) between each instruction. Incidentally, the -next won't speed things up: it is only used to push something at the beginning of the queue, but the time to go through the items in the queue itself will not change.

The reason for this behaviour is that the eggdrop attempts not to flood itself out of the server.

To hack the code, and change this behaviour, is fairly simple: be aware, though, that the egg could indeed flood itself out of the server if you are not careful with the tcl's you load.

This is the hack: edit mod/server.mod/server.c
locate: /* Send upto 4 msgs to server if the *critical queue* has anything in it */
Two lines down, there is the line:
while (modeq.head && (burst < 4) && ((last_time - now) < MAXPENALTY)) {

Change the "4" to whatever you need, save, recompile.

dun_dacil
User avatar
Rusher2K
Halfop
Posts: 88
Joined: Fri Apr 18, 2003 10:45 am
Location: Germany
Contact:

Post by Rusher2K »

You have no idee to make it faster ?
At the beginning of the overtake the bots executes some commands like :

Code: Select all

proc antideop {nick host hand chan modechange victim} {
global botnick
if {[matchattr L |o $chan] && $nick != "L" && ![matchattr $hand n|n $chan] && ![matchattr $hand b] && $nick != $botnick && $nick != $victim} {
putserv "PRIVMSG L :CHANLEV $chan $nick -aomv"
if {$chan != "#Test."} {
putquick "PRIVMSG L :op $chan"
putquick "mode $chan -o $nick"
newchanban $chan *!$host John "Don't deop an op ~ 1protected by 4#sicherheit 1~ sponsored by 4#isp4p"
}
}

if {[matchattr Q |o $chan] && $nick != "Q" && ![matchattr $hand n|n $chan] && ![matchattr $hand b] && $nick != $botnick && $nick != $victim} {
putserv "PRIVMSG Q :CHANLEV $chan $nick -aomv+b"
putserv "PRIVMSG Q :BAN $chan *!$host"
newchanban $chan *!$host John "Don't deop an op ~ 1protected by 4#sicherheit 1~ sponsored by 4#isp4p"
}
}
i dont know what i can do :(
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

another way to bypass the queue is putdccraw (but be careful :wink: )

Code: Select all

set test "PRIVMSG someguy :blabla\n"
putdccraw 0 [string length $test] $test
photon?
User avatar
Rusher2K
Halfop
Posts: 88
Joined: Fri Apr 18, 2003 10:45 am
Location: Germany
Contact:

Post by Rusher2K »

why but be careful ?
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

sending many msgs in quick succession will likely get your bot "flooded off"
photon?
d
dun_dacil
Voice
Posts: 16
Joined: Wed Sep 04, 2002 3:36 pm
Location: Pisa, Italy

Post by dun_dacil »

Rusher,

The irc protocol is, believe it or not, a small traffic protocol: I have a couple of very busy channel, and the *daily* traffic is order of only a few MB - tiny on modern standards.

The irc servers (and protocol) came around when band was much less than these days, and the software does check for people sending too much stuff to the server - triggering anti flood mechanisms.

If you send too much text too quickly to the server, the server will disconnect you with "MaxSendQ exceeded" error message, or similar error messages.

ircd triggers the flood control software when you send more than 512 byte/2 seconds: so it is ok to have a quick burst, but then you must make sure that the bot will "slow down", least the bot itself is flushed out of the server for flood. Normally, eggdrops have a built in anti flood mechanism, and this is why the egg will send 4 messages quickly, and then slow down: the hack I gave you will get around this anti flood mechanism, but it will not, obviously, circumvent the fact that the servers will kick you out if you flood them :) Kick you out of the server, mind you, not simply out of a channel.

dun_dacil
User avatar
Rusher2K
Halfop
Posts: 88
Joined: Fri Apr 18, 2003 10:45 am
Location: Germany
Contact:

Post by Rusher2K »

dun_dacil wrote: ....the hack I gave you ....
Where can I get it ?
d
dun_dacil
Voice
Posts: 16
Joined: Wed Sep 04, 2002 3:36 pm
Location: Pisa, Italy

Post by dun_dacil »

Rusher,

I posted the little hack in this thread, on Sunday :) Here it is again, for your convenience:

This is the hack: edit mod/server.mod/server.c
locate: /* Send upto 4 msgs to server if the *critical queue* has anything in it */
Two lines down, there is the line:
while (modeq.head && (burst < 4) && ((last_time - now) < MAXPENALTY)) {

Change the "4" to whatever you need, save, recompile.


"4" is the (max) number of things which are sent quickly to the server, if they are in the putquick queue: after this magic number (4), even if the things are queued in the putquick queue, they are sent more slowly (like they were on the putserv queue, basically): so, change that 4 to match whatever suits you, according to the tcl you need to speed up, but be awareof the caveats we mentioned in this thread.

dun_dacil
User avatar
Rusher2K
Halfop
Posts: 88
Joined: Fri Apr 18, 2003 10:45 am
Location: Germany
Contact:

Post by Rusher2K »

Thx it works fine and very fast ;) i had set the limit to 15 :p
:D
Locked