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.

no version tcl

Support & discussion of released scripts, and announcements of new releases.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Add time in minutes here...

Post by SpiKe^^ »

MrBeta: Try this....


Old Code:

Code: Select all

   newban "*!*[string range $u [string first "@" $u] end]" $::nick $::r 
New Code:

Code: Select all

   newban "*!*[string range $u [string first "@" $u] end]" $::nick $::r 5 
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
MrBeta
Voice
Posts: 35
Joined: Sat Dec 28, 2013 2:16 pm
Contact:

Post by MrBeta »

Thank you SpiKe^^, works perfectly.
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

for some reason this tcl returns this error when i use it :
Tcl error [foo]: can't set "::ver(NICK)": variable isn't array
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

simo: That is a global variable name collision between this script, and another one already loaded.

Try changing the variable name everywhere it's used in this script...
Search and replace all ::ver( with ::verNick(

Example:

Code: Select all

proc foo {n u h c} { 
   if {[matchattr $h ovf|ovf]} return 
   set ::verNick($n) [list [unixtime] $u] 
   puthelp "privmsg $n :\001VERSION\001" 
} 
Continue replacing the variable name everywhere else in the script.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

This is one of the reasons why i love namespaces. :)
Once the game is over, the king and the pawn go back in the same box.
w
willyw
Revered One
Posts: 1205
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

caesar wrote:This is one of the reasons why i love namespaces. :)
Too bad we don't have a "Like" button to click on posts. This post deserves it.

:)
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

so far this is what i got and the error is gone but nothing really happens

Code: Select all

 set r "No client version reply!"
bind join - * foo
bind ctcr - VERSION bar
bind time - * moo

proc foo {n u h c} {
   if {[matchattr $h ovf|ovf]} return
   set ::verNick($n) [list [unixtime] $u]
   puthelp "privmsg $n :\001VERSION\001"
} 

proc bar {n u h d k t} {
   if {[isbotnick $d] && [info exists ::ver($n)]} {
      unset ::verNick($n)
   }
}
proc moo {m h d mo y} {
   if {[info exists ::ver]} {
   foreach {n e} [array get ::ver] {
      set t [lindex $e 0]
      set u [lindex $e 1]
      if {[unixtime] - $t > 30} {
         unset ::verNick($n)
         newban "*!*[string range $u [string first "@" $u] end]" $::nick $::r 1
         foreach c [channels] {
            if {[botisop $c] && [onchan $n $c]} {
               putkick $c $n $::r
            }
         }
      }
   }} 
}
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

now having error:
bad type, should be one of: act, away, bcst, bot, chat, chjn, chof, chon, chpt, cron, dcc, disc, evnt, filt, link, load, log, nkch, note, time, unld
while executing
"bind join - * foo"

using this script:

Code: Select all

set r "no version reply"
bind join - * foo
bind ctcr - VERSION bar
bind time - * moo

proc foo {n u h c} {
   if {[matchattr $h of|of]} return
   set ::verNick($n) [list [unixtime] $u]
   puthelp "privmsg $n :\001VERSION\001"
}
 

proc bar {n u h d k t} {
   if {[isbotnick $d] && [info exists ::verNick($n)]} {
      unset ::verNick($n)
   }
}
proc moo {m h d mo y} {
   if {[info exists ::ver]} {
   foreach {n e} [array get ::ver] {
      set t [lindex $e 0]
      set u [lindex $e 1]
      if {[unixtime] - $t > 30} {
         unset ::verNick($n)
         newban "*!*[string range $u [string first "@" $u] end]" $::nick $::r 1
         foreach c [channels] {
            if {[botisop $c] && [onchan $n $c]} {
               putkick $c $n $::r
            }
         }
      }
   }} 
}
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Check out your eggdrop.conf file and make sure you haven't unloaded the channels module.

You should have loadmodule channels in there and if you have a # in front of the line then the module isn't loaded.
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

the channel module was and is loaded
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Based on that error you don't.

Unload this script (if it's causing problems) and get on Telnet/DCC Chat with the bot and do .module and report back what you get.
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

Module: channels, v 1.1
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

The bind join line is correct so this means that you are either missing a module or have something that is messing something up.

Either way unload all scripts and load just this one and see if that works on it's own. If it dose, then load one by one the previously unloaded scripts until you find the culprit. :roll:
Once the game is over, the king and the pawn go back in the same box.
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

tried that nothing happens no error tho
Post Reply