egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

no version tcl
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Thu Mar 10, 2016 5:52 pm    Post subject: Add time in minutes here... Reply with quote

MrBeta: Try this....


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


New Code:
Code:
   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
.
Back to top
View user's profile Send private message Visit poster's website
MrBeta
Voice


Joined: 28 Dec 2013
Posts: 35

PostPosted: Fri Mar 11, 2016 6:07 am    Post subject: Reply with quote

Thank you SpiKe^^, works perfectly.
Back to top
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Sat Mar 12, 2016 10:22 am    Post subject: Reply with quote

for some reason this tcl returns this error when i use it :

Quote:
Tcl error [foo]: can't set "::ver(NICK)": variable isn't array
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sat Mar 12, 2016 1:02 pm    Post subject: Reply with quote

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:
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
.
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Sun Mar 13, 2016 4:11 am    Post subject: Reply with quote

This is one of the reasons why i love namespaces. Smile
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sun Mar 13, 2016 9:52 am    Post subject: Reply with quote

caesar wrote:
This is one of the reasons why i love namespaces. Smile


Too bad we don't have a "Like" button to click on posts. This post deserves it.

Smile
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Mon Mar 14, 2016 6:00 pm    Post subject: Reply with quote

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

Code:
 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
            }
         }
      }
   }}
}
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Mon Mar 14, 2016 6:21 pm    Post subject: Reply with quote

now having error:

Quote:
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:
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
            }
         }
      }
   }}
}
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Tue Mar 15, 2016 3:07 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Tue Mar 15, 2016 11:38 am    Post subject: Reply with quote

the channel module was and is loaded
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Tue Mar 15, 2016 1:14 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Tue Mar 15, 2016 1:28 pm    Post subject: Reply with quote

Module: channels, v 1.1
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Wed Mar 16, 2016 2:11 am    Post subject: Reply with quote

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. Rolling Eyes
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Wed Mar 16, 2016 11:52 am    Post subject: Reply with quote

tried that nothing happens no error tho
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber