| View previous topic :: View next topic |
| Author |
Message |
raven Voice
Joined: 08 Aug 2011 Posts: 6
|
Posted: Tue Nov 01, 2011 9:44 am Post subject: Existing script addedbots.tcl |
|
|
Hi!
I downloaded a script that is supposed to look at the botnet, and let me know wich bots isn't linked in. It works on one bot, a leaf, but I want to have it on the hub. But it gives me a error.
SCRIPT:
| Code: | bind pub m \?bots pub_list_bots
proc pub_list_bots {nick host hand chan arg} {
global botnick
set msg ""
set added_bot 0
set on_chan 0
set not_on_chan 0
set linked 0
set linked_msg ""
set misslink ""
set missonchan ""
foreach hand [userlist] {
set leave 1
if {[matchattr $hand b] == 1} {incr added_bot; set leave 0}
if {($leave == 0) && ([onchan [hand2nick $hand] $chan])} {incr
on_chan}
if {($leave == 0) && (![onchan [hand2nick $hand] $chan])} {incr
not_on_chan; append msg "$hand , "}
if {($leave == 0) && ([islinked $hand])} {incr linked}
if {($leave == 0) && (![islinked $hand]) && ($hand != "$botnick")}
{append linked_msg "$hand , "}
}
if {[string range $msg [expr [string length $msg] -1] end] != ", "} {
set msg "[string trimright $msg ", "]"
}
if {[string range $linked_msg [expr [string length $linked_msg] -1]
end] != ", "} {
set linked_msg "[string trimright $linked_msg ", "]"
}
set plah ""
set linked [expr $linked + 1]
set misslink [expr $added_bot - $linked]
set missonchan [expr $added_bot - $on_chan]
if {$added_bot != "$on_chan"} {
set plah "Added Bots\: [b]$added_bot[b]... But only [b]$on_chan[b]
are here."
if {$linked != $on_chan} {append plah " Linked Bots\:
[b]$linked[b]."}
putserv "PRIVMSG $chan :--\> $plah"
if {$linked == $on_chan} {
putserv "PRIVMSG $chan :--\> Missing ([b]$missonchan[b])\:
$msg"
} else {
putserv "PRIVMSG $chan :--\> Missing on Channel
([b]$missonchan[b])\: $msg"
if {$misslink != "0"} {
putserv "PRIVMSG $chan :--\> Missing Linked
([b]$misslink[b])\: $linked_msg"
}
}
} else {
putserv "PRIVMSG $chan :--\> All [b]$added_bot[b] Bots are here."
}
}
proc b {} {return \002}
proc u {} {return \037} |
And the error is:
[13:31] Tcl error [pub_list_bots]: wrong # args: should be "incr varName ?increment?" |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Nov 01, 2011 1:58 pm Post subject: |
|
|
You've got a few newlines in this post in inappropriate positions, that would cause this error. Could you check if these newlines are present in the scripts on your eggdrops?
| Code: | #############################################################################################################
if {($leave == 0) && ([onchan [hand2nick $hand] $chan])} {incr
on_chan}
if {($leave == 0) && (![onchan [hand2nick $hand] $chan])} {incr
not_on_chan; append msg "$hand , "}
if {($leave == 0) && ([islinked $hand])} {incr linked}
if {($leave == 0) && (![islinked $hand]) && ($hand != "$botnick")}
{append linked_msg "$hand , "}
#############################################################################################################
# Should be:
if {($leave == 0) && ([onchan [hand2nick $hand] $chan])} {incr on_chan}
if {($leave == 0) && (![onchan [hand2nick $hand] $chan])} {incr not_on_chan; append msg "$hand , "}
if {($leave == 0) && ([islinked $hand])} {incr linked}
if {($leave == 0) && (![islinked $hand]) && ($hand != "$botnick")} {append linked_msg "$hand , "}
#############################################################################################################
# Or, for proper postings on the board:
if {($leave == 0) && ([onchan [hand2nick $hand] $chan])} {
incr on_chan
}
if {($leave == 0) && (![onchan [hand2nick $hand] $chan])} {
incr not_on_chan
append msg "$hand , "
}
if {($leave == 0) && ([islinked $hand])} {
incr linked
}
if {($leave == 0) && (![islinked $hand]) && ($hand != "$botnick")} {
append linked_msg "$hand , "
}
|
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
raven Voice
Joined: 08 Aug 2011 Posts: 6
|
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Nov 01, 2011 2:36 pm Post subject: |
|
|
Unfortunately, those are the only four lines within that script that contains the incr function, and thus are the only reasonable sources for the error you posted.
When editing the script, make sure you are using an editor that does not use word-wrapping. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
raven Voice
Joined: 08 Aug 2011 Posts: 6
|
Posted: Tue Nov 01, 2011 3:32 pm Post subject: |
|
|
I re-downloaded the script and upzip'ed without opening in, to both shells..same error om hub bot but working on a leaf!
Can it be outdated TCL on the box? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Nov 01, 2011 4:08 pm Post subject: |
|
|
I doubt that (would have to be an improper tcl parser, not able to handle ; as a command separator).
Regardless, the last version in my earlier post should work for any version of tcl (though I missed to include the following line):
| Code: | if {[matchattr $hand b] == 1} {incr added_bot; set leave 0}
#### Change into
if {[matchattr $hand b] == 1} {
incr added_bot
set leave 0
}
|
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|