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.

Putnow / Putquick

Help for those learning Tcl or writing their own scripts.
Post Reply
i
intel
Halfop
Posts: 57
Joined: Tue Feb 26, 2008 11:51 pm

Putnow / Putquick

Post by intel »

I have a tcl script the announces releases when someone does !pre

I noticed my bot is delayed and I have putquick. I changed that to putnow and when someone does !pre the bot no longer responds. I am running eggdrop 1.8

Once I have it back to putquick it responds.

Any help is appreciated.
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Re: Putnow / Putquick

Post by willyw »

It would be helpful to see both.
It might be enough to see just both lines of tcl.
Best would be to pastebin the whole script.


Is the output more than just a couple lines?
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
i
intel
Halfop
Posts: 57
Joined: Tue Feb 26, 2008 11:51 pm

Post by intel »

putquick "PRIVMSG $chan :\[\002\00314PRE\002\003 in \00310$type\003] - $rls ( [clock format $timestamp -format %m.%d.%Y] ) ( [clock format $timestamp -format %H:%M:%S] ) ( $size\00310MB\003 $files\00310F\003 $genre ) -- pred $ago ago" -next
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

intel wrote:putquick "PRIVMSG $chan :\[\002\00314PRE\002\003 in \00310$type\003] - $rls ( [clock format $timestamp -format %m.%d.%Y] ) ( [clock format $timestamp -format %H:%M:%S] ) ( $size\00310MB\003 $files\00310F\003 $genre ) -- pred $ago ago" -next
Is that line wrapped? Because it ends with a $ as if in the middle of a variable name.

That line also does not have an ending double quote.


Then... there were my other requests for info, too.


edit: Ok. Apparently you were editing your post at the same time as I was replying. :)
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
i
intel
Halfop
Posts: 57
Joined: Tue Feb 26, 2008 11:51 pm

Post by intel »

yup....I was editing it :D
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

intel wrote:yup....I was editing it :D
Ok.
I'll wait for the rest of the info.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
i
intel
Halfop
Posts: 57
Joined: Tue Feb 26, 2008 11:51 pm

Post by intel »

that is the line....
s
simo
Revered One
Posts: 1069
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

most ircds have throttle feature to prevent text floods perhaps ur bot is caught in that and therefore sending with a bit of delay

putnow sends directly to server wich might trigger anti throttle ( if massive text send and possibly might get disconnected )
i
intel
Halfop
Posts: 57
Joined: Tue Feb 26, 2008 11:51 pm

Post by intel »

simo,
Don't think so cause someone else who has a bot can do it with no issues on the same ircd
When I am in the partyline for the and do !pre if there is a problem shouldn't I see something there? I don't see any issue. It just doesnt respond
j
juanamores
Master
Posts: 317
Joined: Sun Mar 15, 2015 9:59 am

Post by juanamores »

intel, could you copy the complete script so you can look at it and try to find the problem?

By chance, do you connect the BoT through a ZNC, bouncer or BNC?
If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks :)
i
intel
Halfop
Posts: 57
Joined: Tue Feb 26, 2008 11:51 pm

Post by intel »

Code: Select all

proc ms:pre {nick uhost hand chan arg} {
  set chan [string tolower $chan]
  if {[channel get $chan search]} {
      global mysql_ db_
        set handle [mysqlconnect -host $mysql_(host) -user $mysql_(user) -pass $mysql_(password) -db $mysql_(db)];
        set before [clock clicks -milliseconds]
        set sea1 [string map [list "*" "%" " " "%" "" "%"] $arg];
        set sea2 [string map [list "%" "*"] $sea1];
        set query1 [mysqlsel $handle "SELECT $db_(rlsname),$db_(section),$db_(status),$db_(nukereason),$db_(ctime),$db_(files),$db_(size),$db_(genre) FROM $mysql_(table) WHERE $db_(rlsname) LIKE '%$sea1%' ORDER BY $db_(ctime) DESC LIMIT 5 " -flatlist];
        	if {$query1 == ""} {
                putquick "PRIVMSG $chan : Nothing found for \037 $arg \037"
            } else {
              foreach {rls type nuke reason timestamp files size genre} $query1 {
              set sea1 [string map [list "*" "%" " " "%" "" "%"] $arg];
              set sea2 [string map [list "%" "*"] $sea1];
              set query1 [mysqlsel $handle "SELECT $db_(rlsname),$db_(section),$db_(status),$db_(nukereason),$db_(ctime),$db_(files),$db_(size),$db_(genre) FROM $mysql_(table) WHERE $db_(rlsname) LIKE '%$sea1%' ORDER BY $db_(ctime) DESC LIMIT 5 " -flatlist];
            if {$query1 == ""} {
                putquick "PRIVMSG $chan : Nothing found for \037 $arg \037"
            } else {
            foreach {rls type nuke reason timestamp files size} $query1 {
            set time1 [unixtime]
            incr time1 -$timestamp
            set ago [duration $time1]
            set after [clock clicks -milliseconds]
            if {$size != 0} {
		if {$files != 0} {
	      if {$nuke == "0"} {
                  putquick "PRIVMSG $chan :\[\002\00314PRE\002\003 in \00310$type\003] - $rls ( [clock format $timestamp -format %m.%d.%Y] ) ( [clock format $timestamp -format %H:%M:%S] ) ( $size\00310MB\003 $files\00310F\003 $genre ) -- pred $ago ago"
              } elseif {$nuke == "1"} {
                  putquick "PRIVMSG $chan :\[\0034NUKE\003\] ( \00310$type\003 ) -- $rls  \002(\002 \037\0034$reason\037\003 \002)\002 was pred \0030::\003 ( [clock format $timestamp -format %m.%d.%Y] )\002 \002( [clock format $timestamp -format %H:%M:%S] ) ( $size\00310MB\003 $files\00310F\003 $genre ) -- pred $ago ago"
              } else {
        putlog "ERROR in (PRESEARCH)"
    }
  }
}
  set ms "MS"
  mysqlclose $handle
      }
    }
  }
}
}
}
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

That won't trigger with any command, because there is no bind .
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
i
intel
Halfop
Posts: 57
Joined: Tue Feb 26, 2008 11:51 pm

Post by intel »

sorry there is a bind statement

bind pub -|- !pre ms:pre
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

willyw wrote: ...
Best would be to pastebin the whole script.
...
juanamores wrote: ...
could you copy the complete script
...
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Post Reply