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.

queue system

Old posts that have not been replied to for several years.
Locked
B
Burke
Voice
Posts: 21
Joined: Mon Feb 07, 2005 9:33 pm

queue system

Post by Burke »

pushmode $channel +b $banmask

Works ok, it`s queued, won`t flood out the bot and sends much as possible in 1 line to the server.
Sut it`s a bit slow.

putquick is faster, but the bot will not send combined into one line as much as possible. and if to much putquck at 1 time will this lead into an anoying excess flood.

are their any useful scripts or modules which will change something on the queue system?
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

flushmode?
Have you ever read "The Manual"?
B
Burke
Voice
Posts: 21
Joined: Mon Feb 07, 2005 9:33 pm

Post by Burke »

i tryed it with and without. it will not bring a good effect.
are their any plugins for that what i discribe in my 1. post?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Flushmode works fine for me. You just use it in this format:

Code: Select all

...............
....................
.......................
pushmode $chan -o $nick1
pushmode $chan -v $nick2
pushmode $chan +b *!ident@mask2.com
pushmode $chan -b *!*@mask1.com
flushmode $chan
.......................
....................
...............
It will do something like this:

* bot sets mode: -ov+b-b nick1 nick2 *!ident@mask2.com *!*@mask1.com
Like here, when your done with all or suppose it is a loop then go ahead and "flushmode $chan" in the end, that is quite fast. Generally the same as compared to putquick.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
B
Burke
Voice
Posts: 21
Joined: Mon Feb 07, 2005 9:33 pm

Post by Burke »

thank you for this tips. basicly you`re right.

putquick is a bit faster, but it`s hard to collect the changes. i have seen this in a script, them create befor their own lists with changes (to 6) and send them with putquick. but you have to be code more (and it`s harder). and the disadventage of this is, that those lists in this proc only will collect the changes from 1 funktion. pushmode will collect all (internal botfunctions (like ban) and all procs who use pushmode at the same channel).

i hoped someone has done a function to make those availible for all procs at once. but it seams that there are not much scripts.

i found this one from BarkerJr
http://www.egghelp.org/tclhtml/3478-4-0-0-1-queue.htm
is it offtopic? i don`t have a clue for what those script is written, no idea how to use it. anyone tested?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Pushmode does like have a queue of 6 normally (fills up, or more) so when it fills up goes ahead and executes it, or if it is delayed alot then executes it after sometime even if the queue doesn't fill up full. Flushmode immediately calls pushmode. The current modes pending in the pushmode queue will be forcibly executed with flushmode.

If you want to use simulatenous ones try and use:

Code: Select all

putquick "MODE $chan +oo-v+b-b nick1 nick2 nick3 *!ident@mask *!*@mask" -next
Putquick still has a queue but a faster one than putserv, puthelp. The "-next" switch places the command to be executed at the topmost of the queue.

If you want it to be more faster, try searching the "putdccraw" function here on the forum, so you can get an idea about that. It has no queuing system, and it sends a string of text directly to the server.

Though I've heard people say putdccraw also looks like if it has a queue. If you send alot of data to the server with these in a less amout of time, generally 512 bytes in less than 2 seconds, it will disconnect you bot of the server for excessive transmission.

BarkerJr made a tweak for adding your own queues to eggdrops it is a tcl script as well. I remember pasting it on this forum. But the sad part is, you have to find it! :) Try searching "putquick, putdccraw and my nick along with it!"

Or you can even find it on the eggheads archive website in last years posts, somewhere in between june-sept if I remember correctly.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
B
Burke
Voice
Posts: 21
Joined: Mon Feb 07, 2005 9:33 pm

Post by Burke »

awyeah wrote:

Code: Select all

putquick "MODE $chan +oo-v+b-b nick1 nick2 nick3 *!ident@mask *!*@mask" -next
:)

i know that.

Code: Select all

proc punish:flood { nickname BUZAout channel abuse } {
	pushmode $channel +b $BUZAout
	utimer 10 [list badall:kick "$nickname" "$channel" "$abuse" ]
	return 0
}
this proc will be called if i detect a flood/badword.

if any lamer floods/adv with some floodbots, it will ban afer 2-3 seconds and collect the modes (+bbbbbb 1 2 3 4 5 6.....). no excess flood and the flood ends fast.

if only 1 user flood, the bot will set the ban after 2-3 seconds after the flood/badword is detected. the ugly thing is that the user normaly not stop and repeat some times. i think this can be a bit faster.

i can use putquick -next, and the bot will ban in the same second or 1 later. but, if to much bots flood the channel (3-...) then the bot will quit (excess flood) because he sends not the modes in combinations the server. but this should be possible.

that was reason to ask for a better solution.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Well, then thats it, if you're bot can operup on the network and gets the +F more then it should be okay.
# F Can use umode +F (no flood limits)
There are limitations for the eggdrop and also limitations server administrators have placed.

By the way I don't think you need to call a such long delayed kicking mechanism, 10 seconds especially.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

he is on quakenet and I doubt he will get a +F :D.
I don't know either, why pushmode is even with flushmode very slow. maybe we should make a request to eggheads bugzilla to make flushmode handle faster. I gave up using flushmode, because I really can't tell its any faster than without. maybe its even broken in the lastest versions :D (i currently can't confirm it, because of too much bandwith usage of other applications),
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

If you read the source code, pushmode is slower because it tries to sum up all modes in the queue then send them directly to the server. It does tend to wait for more modes (if the queue is not full) which can make it slow, else if the queue is full it flushes them, or when flushmode is called.

- pushmode is like gather-up modes, if queue is not full wait for sometime, (if full flush immediately) otherwise go ahead and flush current queue
- flushmode is more making forcing pushmode, like send all modes to the server whatever condition pushmode (full or not full) has.

While as putserv, putquick, putdccraw don't wait to send text msgs by summing them up, they go as whole (in a single line) so that's why they are faster.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
sKy
Op
Posts: 194
Joined: Thu Apr 14, 2005 5:58 pm
Location: Germany

Post by sKy »

[15:41:45] * haaaaaaaa2369 (Kimi96@pcp08025073pcs.dalect01.va.comcast.net) has joined #test22k
[15:41:45] * haaaaaaaa5635 (Carol60@pcp09279197pcs.eatntn01.nj.comcast.net) has joined #test22k
[15:41:45] * haaaaaaaa7347 (nobody@61.206.125.114.user.ip8.il24.net) has joined #test22k
[15:41:46] * Testdrop sets mode: +bbbb haaaaaaaa*!*@* *!*@pcp08025073pcs.dalect01.va.comcast.net *!*@pcp09279197pcs.eatntn01.nj.comcast.net *!*nobody@61.206.125.114.user.ip8.il24.net
Putquick will send every modechange in a singe line. Pushmode will take some seconds longer.

I have done this little code.

Code: Select all

#
# put:quick - version 0.1 by sKy\
#
# usage:
# put:quick channel what ?target?
#
#
#
# returns - nothing (might me changed in next version)
#
# supports only mode. use this command instand of: putquick "MODE $channel $what" or putquick "MODE $channel $what $target"
# does not support +k $key / -k $key
# or +l $limit  (might be changed in next version, but only maybe :P)
#
# - will not send any modechanges to the server if the bot isn`t opped
# - will not op people which are op / will not deop people which are allready deoped
# - will not set bans which are allready set / will not unban bans which are not set
#


set put_quick_refresh 201

proc putquick:op { channel target } {
	if {! [info exists ::aoped($channel,$target) ] } {
		set ::aoped($channel,$target) 1
		utimer 5 [list unset ::aoped($channel,$target)]
		if { ! [isop $target $channel] } {
			put:quick:input $channel +o $target
		}
	}
}

proc putquick:deop { channel target } {
	if {! [info exists ::adeoped($channel,$target) ] } {
		set ::adeoped($channel,$target) 1
		utimer 5 [list unset ::adeoped($channel,$target)]
		if { [isop $target $channel] } {
			put:quick:input $channel -o $target
		}
	}
}

proc putquick:ban { channel hostname } {
	if {! [info exists ::apushed($channel,$hostname) ] } {
		set ::apushed($channel,$hostname) 1
		utimer 5 [list unset ::apushed($channel,$hostname)]
		set resultISBAN [isban:test $hostname $channel]
		if { $resultISBAN == "ISNOTBAN" } {
			put:quick:input $channel +b $hostname
		}
	}
}

proc putquick:unban { channel hostname } {
	if {! [info exists ::aunbanned($channel,$hostname) ] } {
		set ::aunbanned($channel,$hostname) 1
		utimer 5 [list unset ::aunbanned($channel,$hostname)]
		set resultISBAN [isban:test $hostname $channel]
		if { $resultISBAN == "ISBAN" } {
			put:quick:input $channel -b $hostname
		}
	}
}

proc putquick:mode { channel what } {
	if {! [info exists ::amode($channel,$what) ] } {
		set ::amode($channel,$what) 1
		utimer 5 [list unset ::amode($channel,$what)]
		put:quick:input $channel $what
	}
}

proc put:quick { channel what {target ""} } {
	set plus_or_minus [string index $what 0]
	set modechange [string index $what 1]
	if { $plus_or_minus == "+" } {
		if { $modechange == "o" } {
			putquick:op $channel $target
			return
		}

		if { $modechange == "b" } {
			putquick:ban $channel $target
			return
		}
		putquick:mode $channel $what
		return
	}
	if { $plus_or_minus == "-" } {
		if { $modechange == "o" } {
			putquick:deop $channel $target
			return
		}

		if { $modechange == "b" } {
			putquick:unban $channel $target
			return
		}
		putquick:mode $channel $what
		return
	}
	return
}

proc put:quick:clearqueue { channel } {
	if { [info exists ::put_quick_list($channel) ] } {
		unset ::put_quick_list($channel)
	}
	if { [info exists ::put_quick_list_mode_plus($channel) ] } {
		unset ::put_quick_list_mode_plus($channel) 
	}
	if { [info exists ::put_quick_list_mode_minus($channel) ] } {
		unset ::put_quick_list_mode_minus($channel)
	}
	if { [info exists ::put_quick_list_bans_plus($channel) ] } {
		unset ::put_quick_list_bans_plus($channel)
	}
	if { [info exists ::put_quick_list_bans_minus($channel) ] } {
		unset ::put_quick_list_bans_minus($channel)
	}
	if { [info exists ::put_quick_list_op_plus($channel) ] } {
		set ::put_quick_list_op_plus($channel) ""
	}
	if { [info exists ::put_quick_list_op_minus($channel) ] } {
		set ::put_quick_list_op_minus($channel) ""
	}
	return
}

proc put:quick:input { channel what {target ""} } {

#	putlog "start. put:quick:input  - $channel - $what - $target"

	if { ! [info exists ::allreadystarted($channel)] } {
		set ::allreadystarted($channel) 1
		after 201 [list put:quick:pushnow $channel]
	}

	if { ! [info exists ::put_quick_list($channel) ] } {
		set ::put_quick_list($channel) ""
	}
	if { ! [info exists ::put_quick_list_mode_plus($channel) ] } {
		set ::put_quick_list_mode_plus($channel) ""
	}
	if { ! [info exists ::put_quick_list_mode_minus($channel) ] } {
		set ::put_quick_list_mode_minus($channel) ""
	}
	if { ! [info exists ::put_quick_list_bans_plus($channel) ] } {
		set ::put_quick_list_bans_plus($channel) ""
	}
	if { ! [info exists ::put_quick_list_bans_minus($channel) ] } {
		set ::put_quick_list_bans_minus($channel) ""
	}
	if { ! [info exists ::put_quick_list_op_plus($channel) ] } {
		set ::put_quick_list_op_plus($channel) ""
	}
	if { ! [info exists ::put_quick_list_op_minus($channel) ] } {
		set ::put_quick_list_op_minus($channel) ""
	}

	set plus_or_minus [string index $what 0]
	set modechange [string index $what 1]

	if { $plus_or_minus == "+" || $plus_or_minus == "-" } { 

		if { $plus_or_minus == "+" } {

#			putlog "plusmode $modechange"

			if { $modechange == "t" || $modechange == "n" ||
			$modechange == "i" || $modechange == "m" ||
			$modechange == "k" || $modechange == "l" ||
			$modechange == "p" || $modechange == "s" ||
			$modechange == "c" || $modechange == "C" ||
			$modechange == "N" || $modechange == "r" ||
			$modechange == "D" || $modechange == "u" } {
				append ::put_quick_list_mode_plus($channel) $modechange
#				putlog "put:quick - ::put_quick_list_mode_plus($channel): $::put_quick_list_mode_plus($channel) - modechange: $modechange "
				return
			}

			if { $modechange == "o" } {
				append ::put_quick_list_op_plus($channel) "$target "
#				putlog "put:quick - ::put_quick_list_op_plus($channel): $::put_quick_list_op_plus($channel) - modechange: $target "
			}

			if { $modechange == "b" } {
				append ::put_quick_list_bans_plus($channel) "$target "
#				putlog "put:quick - ::put_quick_list_bans_plus($channel): $::put_quick_list_bans_plus($channel) - modechange: $target "

			}

		}

		if { $plus_or_minus == "-" } {

			putlog "minusmode $modechange"

			if { $modechange == "t" || $modechange == "n" ||
			$modechange == "i" || $modechange == "m" ||
			$modechange == "k" || $modechange == "l" ||
			$modechange == "p" || $modechange == "s" ||
			$modechange == "c" || $modechange == "C" ||
			$modechange == "N" || $modechange == "r" ||
			$modechange == "D" || $modechange == "u" } {
				append ::put_quick_list_mode_minus($channel) $modechange
#				putlog "put:quick - ::put_quick_list_mode_minus($channel): $::put_quick_list_mode_minus($channel) - modechange: $modechange "
				return
			}

			if { $modechange == "o" } {
				append ::put_quick_list_op_minus($channel) "$target "
#				putlog "put:quick - ::put_quick_list_op_minus($channel): $::put_quick_list_op_minus($channel) - modechange: $target "
			}
	
			if { $modechange == "b" } {
				append ::put_quick_list_bans_minus($channel) "$target "
#				putlog "put:quick - ::put_quick_list_bans_minus($channel): $::put_quick_list_bans_minus($channel) - modechange: $target "

			}

		}

		set oplist_lenght_plus [llength $::put_quick_list_op_plus($channel)]
#		putlog "1. put:quick: - oplist_lenght_plus - $oplist_lenght_plus"

		set oplist_lenght_minus [llength $::put_quick_list_op_minus($channel)]
#		putlog "2. put:quick: - oplist_lenght_minus - $oplist_lenght_minus"

		set banlist_lenght_plus [llength $::put_quick_list_bans_plus($channel)]
#		putlog "3. put:quick: - banlist_lenght_plus - $banlist_lenght_plus"

		set banlist_lenght_minus [llength $::put_quick_list_bans_minus($channel)]
#		putlog "4. put:quick: - banlist_lenght_minus - $banlist_lenght_minus"

		set lenght [expr $banlist_lenght_plus + $banlist_lenght_minus + $oplist_lenght_plus + $oplist_lenght_minus]
#		putlog "END. put:quick - lenght - $lenght"

		if { $lenght == 6 } {
			putlog "6 there..."
			put:quick:pushnow $channel
		}

	} else {
		return "Error: illegal modechange"
	}

	return

}


proc put:quick:pushnow { channel } {

	global put_quick_refresh botnick

	if { ! [info exists ::put_quick_list($channel) ] } {
		set ::put_quick_list($channel) ""
	}
	if { ! [info exists ::put_quick_list_mode_plus($channel) ] } {
		set ::put_quick_list_mode_plus($channel) ""
	}
	if { ! [info exists ::put_quick_list_mode_minus($channel) ] } {
		set ::put_quick_list_mode_minus($channel) ""
	}
	if { ! [info exists ::put_quick_list_bans_plus($channel) ] } {
		set ::put_quick_list_bans_plus($channel) ""
	}
	if { ! [info exists ::put_quick_list_bans_minus($channel) ] } {
		set ::put_quick_list_bans_minus($channel) ""
	}
	if { ! [info exists ::put_quick_list_op_plus($channel) ] } {
		set ::put_quick_list_op_plus($channel) ""
	}
	if { ! [info exists ::put_quick_list_op_minus($channel) ] } {
		set ::put_quick_list_op_minus($channel) ""
	}

	set change_plus "+$::put_quick_list_mode_plus($channel)[string repeat "b" [llength $::put_quick_list_bans_plus($channel)]][string repeat "o" [llength $::put_quick_list_op_plus($channel)]]"
	set change_minus "-$::put_quick_list_mode_minus($channel)[string repeat "b" [llength $::put_quick_list_bans_minus($channel)]][string repeat "o" [llength $::put_quick_list_op_minus($channel)]]"

	set change "$change_minus$change_plus $::put_quick_list_bans_minus($channel) $::put_quick_list_op_minus($channel) $::put_quick_list_bans_plus($channel) $::put_quick_list_op_plus($channel)"

	set x [string map {" " ""} $change]

	if { $x != "-+" } {
		putlog "put:quick:pushnow - putquick MODE $channel $change"
		if { [isop $botnick $channel] } {
			putquick "MODE $channel $change" -next
		}
		put:quick:clearqueue $channel
		after $put_quick_refresh [list put:quick:pushnow $channel]
		return
	}

	after $put_quick_refresh [list put:quick:pushnow $channel]
	return

}

###################################################################################################################################
#					isban:test													#
###################################################################################################################################
# isban:test $banmask $channel
# returns: ISBAN or ISNOTBAN

# if ban is allready in banlist will be not pushed
proc isban:test { ISBANin channel } {
	foreach bans [chanbans $channel] { 
		set mask [lindex $bans 0] 
		set from [lindex $bans 1] 
		set since [lindex $bans 2]
		if {[string match $ISBANin $mask]} { 
			return "ISBAN"
		 } 
	}
	return "ISNOTBAN"
}
I am not sure, but the sever don`t send every 200 miliseconds some "news" to the bot. The bot will trigger all this events in the same moment. I think this is a nice solution.

Please tell me your opinion/bugs/suggestions.
Locked