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.

utimer in putdccraw ?

Help for those learning Tcl or writing their own scripts.
Post Reply
E
Elfriede
Halfop
Posts: 67
Joined: Tue Aug 07, 2007 4:21 am

utimer in putdccraw ?

Post by Elfriede »

hey :)
is it possible to build in this proc an utimer, which delays 1s each line ?
i know , putquick.. but 2s delay is to much ^^

Code: Select all

proc "sendtext" { target message } {
 sputraw "PRIVMSG [string tolower $target] :$message"
}
proc "sputraw" { text } {
 set text [string trim $text]
 putdccraw 0 [string length $text\n] $text\n
}
r
raider2k
Op
Posts: 140
Joined: Tue Jan 01, 2008 10:42 am

Post by raider2k »

Code: Select all

utimer 1 [list sputraw "PRIVMSG [string tolower $target] :$message"]
where 1 is the value in seconds
E
Elfriede
Halfop
Posts: 67
Joined: Tue Aug 07, 2007 4:21 am

Post by Elfriede »

thx for helping, but that has no effect
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

If I understand your inqury right, you are looking for something sending one line of text every one second?

The current implementation of the queue in eggdrop honors the standard punishment-point system used in most, if not virtually all, ircd's. As such, it calculates an estimate of the current penalty-point, and only sends new commands to the server when there is still "room" (sending commands when you've spent your 10 points is pointless, as the command won't be executed until enough points have diminished anyway).

As the PRIVMSG command generally carries a 2s punishment, the first 5 messages would be sent in a rather fast manner. Any subsequent messages would then have to wait 2seconds for the penalty to drop below the 10s threshold, before being sent. Unless you have a customized private server, there would be no point in trying to override this queue, as the ircd would only parse the command when the penalty is low enough, queueing the command in a buffer meanwhile.

If you do have a private server that excludes your eggdrop from the punishment-system, you could implement a queue-system of your own.
I'd recommend using a global list as a queue, appending new messages to the end. Then, using an utimer, each second grab the first element in that list, send it, and remove it from the list. The commands you'd need for these operations would include: lappend, lindex, and lreplace.

Be adviced that the putdccraw command has been deprecated as of 1.6.20 in favor of putnow, and should not be relied on in the future.
NML_375
E
Elfriede
Halfop
Posts: 67
Joined: Tue Aug 07, 2007 4:21 am

Post by Elfriede »

thank you very much for answering that detailed :)
Post Reply