| View previous topic :: View next topic |
| Author |
Message |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Thu Mar 10, 2016 5:52 pm Post subject: Add time in minutes here... |
|
|
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 |
|
 |
MrBeta Voice
Joined: 28 Dec 2013 Posts: 35
|
Posted: Fri Mar 11, 2016 6:07 am Post subject: |
|
|
| Thank you SpiKe^^, works perfectly. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sat Mar 12, 2016 10:22 am Post subject: |
|
|
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 |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Sat Mar 12, 2016 1:02 pm Post subject: |
|
|
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 |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sun Mar 13, 2016 4:11 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sun Mar 13, 2016 9:52 am Post subject: |
|
|
| 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 ! |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon Mar 14, 2016 6:00 pm Post subject: |
|
|
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 |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon Mar 14, 2016 6:21 pm Post subject: |
|
|
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 |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Mar 15, 2016 3:07 am Post subject: |
|
|
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 |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Tue Mar 15, 2016 11:38 am Post subject: |
|
|
| the channel module was and is loaded |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Mar 15, 2016 1:14 pm Post subject: |
|
|
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 |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Tue Mar 15, 2016 1:28 pm Post subject: |
|
|
| Module: channels, v 1.1 |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed Mar 16, 2016 2:11 am Post subject: |
|
|
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.  _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Wed Mar 16, 2016 11:52 am Post subject: |
|
|
| tried that nothing happens no error tho |
|
| Back to top |
|
 |
|