| View previous topic :: View next topic |
| Author |
Message |
cryptic Voice
Joined: 25 Apr 2007 Posts: 5
|
Posted: Wed Apr 25, 2007 9:05 pm Post subject: need a professionals help with a monitoring script :) |
|
|
hello!
I have this script that allows me to monitor all activity and send the echo to another room to view without having to actually be in the room.
However, though it works ok, I keep receiving errors such as:
<MonitorBot> [20:52] Tcl error [pmsg]: invalid command name "pmsg"
<MonitorBot> [20:52] Tcl error [pmsg]: invalid command name "pmsg"
<MonitorBot> [20:52] Tcl error [pmsg]: invalid command name "pmsg"
<MonitorBot> [20:52] Tcl error [pmsg]: invalid command name "pmsg"
<MonitorBot> [20:52] Tcl error [joined]: invalid command name "![$chan == "#channelservices" || $chan == "#channelservices1""
<MonitorBot> [20:52] Tcl error [mode]: invalid command name "mode"
<MonitorBot> [20:52] Tcl error [pmsg]: invalid command name "pmsg"
Would someone please look over this code and tell me where its going wrong? I'd greatly appreciate it.
| Code: | bind JOIN - * joined
bind PART - * part
bind SIGN - * quit
bind MODE - * mode
bind KICK - * kick
bind NICK - * nick
bind TOPC - * topic
bind PUBM - * pmsg
#SETTINGS#
#the channel you would like all msgs sent to#"
set ss "#channelservices"
#dont touch this is the version number#
set ver "7.1.1"
set lastauthor "PlayDough"
set alert "#channelservices"
#TCL CODE DONT EDIT!#
proc putnow { a } {
append a "\n"
putdccraw 0 [string length $a] $a
}
proc joined { nick uhost hand chan args } {
set uhost [getchanhost $nick]
{![$chan == "#channelservices" || $chan == "#channelservices1"}
{
putnow "PRIVMSG #channelservices : -\002\0033JOINS\003\002- \[$chan\] $nick \[$nick!$uhost\]"
}
proc part { nick uhost hand chan args} {
set uhost [getchanhost $nick]
{![$chan == "#channelservices" || $chan == "#freeservices"}
{
putnow "PRIVMSG #channelservices : -\002\0033JOINS\003\002- \[$chan\] $nick \[$nick!$uhost\]"
}
proc part { nick uhost hand chan args} {
putnow "PRIVMSG #channelservices : -\0033\002Parts\002\003-\[$chan\] $nick"
}
proc quit { nick uhost hand chan reason } {
putnow "PRIVMSG #channelservices : -\002\0033QUITS\003\002- $nick has quit ($reason)"
}
proc mode { nick uhost handle chan mode target } {
putnow "PRIVMSG #channelservices : -MODES- $nick set to $mode $target on $chan"
}
proc kick { nick uhost handle chan target reason } {
putnow "PRIVMSG #channelservices : -\0033KICK\0033- $nick kicked $target \002\0034$reason\003\002 - $chan" }
proc nick { nick uhost handle chan newnick } {
putnow "PRIVMSG #channelservices : -NICK- $nick changed their nick to $newnick"
}
proc topic { nick uhost hand chan topic } {
putnow "PRIVMSG #channelservices : -TOPIC- $nick changed the topic on $chan to: $topic"
}
}
|
if anyone knows of a better channel monitoring script that will send, or do, what the above is trying to do, all suggestions would be extremely helpful.
Thanks in advance!
[/code] |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Thu Apr 26, 2007 9:27 am Post subject: |
|
|
all i can say is alot of errors, you have missing if's, a missing proc etc
Try:
| Code: | namespace eval monitor {
# Author / Version / Script info
variable author "r0t3n"
variable version "1.00"
variable script "[lindex [split [info script] /] end]"
# The channel(s) you want to monitor
variable channels "[list #chan1 #chan2 #chan3]"
# The channel you want to relay/send the messages to
variable alert "#channel"
# The bind(s)
bind join - {*} [namespace current]::onjoin
bind part - {*} [namespace current]::onpart
bind sign - {*} [namespace current]::onquit
bind mode - {*} [namespace current]::onmode
bind kick - {*} [namespace current]::onkick
bind nick - {*} [namespace current]::onnick
bind topc - {*} [namespace current]::ontopc
bind pubm - {*} [namespace current]::onpubm
}
proc monitor::checkchan {channel} {
if {[lsearch -exact [string tolower $monitor::channels] [string tolower $channel]] == -1} {
return 0
} else {
return 1
}
}
proc monitor::onjoin {nickname hostname handle channel} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033JOINS\003\002- \[$channel\] $nickname \[$nickname!$hostname\]"
}
}
proc monitor::onpart {nickname hostname handle channel {reason ""}} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033PARTS\003\002- \[$channel\] $nickname"
}
}
proc monitor::onsign {nickname hostname handle channel reason} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033QUITS\003\002- $nickname has quit \($reason\)"
}
}
proc monitor::onmode {nickname hostname handle channel mode target} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033MODES\003\002- $nickname set mode(s) $mode $target on $channel"
}
}
proc monitor::onkick {nickname hostname handle target reason} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033KICK\003\002- $nickname kicked $target \002\0034$reason\003\002 - $channel"
}
}
proc monitor::onnick {nickname hostname handle channel newnick} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033NICK\003\002- $nickname changed their nickname to $newnick"
}
}
proc monitor::ontopc {nickname hostname handle topic} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033TOPIC\003\002- $nickname changed the topic on $channel to: [join $topic]"
}
}
proc monitor::onpubm {nickname hostname handle channel text} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033PUBM\003\002- $nickname said \002\0034$text\003\002 - $channel"
}
}
putlog "Channel Monitor ($monitor::script) v$monitor::version by $monitor::author loaded. |
Bare in mind, this is not tested, but should work nicely  _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
cryptic Voice
Joined: 25 Apr 2007 Posts: 5
|
Posted: Thu Apr 26, 2007 2:58 pm Post subject: |
|
|
thank you tosser!!
Works like a dream. I did have to place an end quote after the putlog script information at the bottom because it was unclosed. But after fixing that, works exactly as I wanted it to.
Thank you so much! |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Thu Apr 26, 2007 3:02 pm Post subject: |
|
|
sorry about missing that end quote, but np  _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
cryptic Voice
Joined: 25 Apr 2007 Posts: 5
|
Posted: Thu Apr 26, 2007 3:12 pm Post subject: |
|
|
ok, the script works like a dream tosser.
However, I think we found our first cockroachs lmao
<MonitorBot> [15:09] Tcl error [::monitor::onquit]: invalid command name "::monitor::onquit"
<MonitorBot> [15:27] Tcl error [::monitor::ontopc]: wrong # args: should be "::monitor::ontopc nickname hostname handle topic"
Its receiving this error when someone quits and not sure what the other one is about I tried fiddling with but I'm lost to the error.
You have any ideas?
PS: would there be a way to make this script read channel notices as well? I have alot of teens that love doing channel notices to spam. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Apr 26, 2007 4:13 pm Post subject: |
|
|
It's time to learn how .set errorInfo works, and how to debug simple tcl errors!
When reporting bugs, PLEASE include the .set errorInfo debug info!
Read: http://forum.egghelp.org/viewtopic.php?t=10215 |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Apr 26, 2007 4:23 pm Post subject: |
|
|
bind sign - {*} [namespace current]::onquit
proc monitor::onsign {nickname hostname handle channel reason} {
There's your invalid command/proc name. It has the wrong name..
And obviously the error mentioned invalid number of args being passed to ontopc, so go read the tcl-commands.doc and look at the bind/proc in question to see what args the bind is passing to the proc. |
|
| Back to top |
|
 |
cryptic Voice
Joined: 25 Apr 2007 Posts: 5
|
Posted: Thu Apr 26, 2007 7:25 pm Post subject: |
|
|
| rosc2112 wrote: | bind sign - {*} [namespace current]::onquit
proc monitor::onsign {nickname hostname handle channel reason} {
There's your invalid command/proc name. It has the wrong name..
And obviously the error mentioned invalid number of args being passed to ontopc, so go read the tcl-commands.doc and look at the bind/proc in question to see what args the bind is passing to the proc. |
Thank you rosc2112.
I fixed the onquit error problem. I just changed the proc onsign to onquit in the script. But I'm still getting the wrong # args error and I looked it up but cant find what the proper # of args or what should be sent through.
Here is the .set bug info that is coming back. How it says it should be here is the way the arguments are already set so I'm lost.
| Code: |
<MonitorBot> Currently: wrong # args: should be "::monitor::onkick nickname hostname handle target reason"
<MonitorBot> Currently: while executing
<MonitorBot> Currently: "::monitor::onkick $_kick1 $_kick2 $_kick3 $_kick4 $_kick5 $_kick6"
|
Slowly but surely making this sript work without the bugs  |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Apr 26, 2007 10:41 pm Post subject: |
|
|
| If you'd looked at the tcl-commands.doc again, you'd have noticed that "bind kick" requires 6 arguments, not 5. |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Fri Apr 27, 2007 4:42 am Post subject: |
|
|
Here is a fixed version:
| Code: | namespace eval monitor {
# Author / Version / Script info
variable author "r0t3n"
variable version "1.01"
variable script "[lindex [split [info script] /] end]"
# The channel(s) you want to monitor
variable channels "[list #chan1 #chan2 #chan3]"
# The channel you want to relay/send the messages to
variable alert "#channel"
# The bind(s)
bind join - {*} [namespace current]::onjoin
bind part - {*} [namespace current]::onpart
bind sign - {*} [namespace current]::onquit
bind mode - {*} [namespace current]::onmode
bind kick - {*} [namespace current]::onkick
bind nick - {*} [namespace current]::onnick
bind topc - {*} [namespace current]::ontopc
bind pubm - {*} [namespace current]::onpubm
}
proc monitor::checkchan {channel} {
if {[lsearch -exact [string tolower $monitor::channels] [string tolower $channel]] == -1} {
return 0
} else {
return 1
}
}
proc monitor::onjoin {nickname hostname handle channel} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033JOINS\003\002- \[$channel\] $nickname \[$nickname!$hostname\]"
}
}
proc monitor::onpart {nickname hostname handle channel {reason ""}} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033PARTS\003\002- \[$channel\] $nickname"
}
}
proc monitor::onquit {nickname hostname handle channel reason} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033QUITS\003\002- $nickname has quit \($reason\)"
}
}
proc monitor::onmode {nickname hostname handle channel mode target} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033MODES\003\002- $nickname set mode(s) $mode $target on $channel"
}
}
proc monitor::onkick {nickname hostname handle channel target reason} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033KICK\003\002- $nickname kicked $target \002\0034$reason\003\002 - $channel"
}
}
proc monitor::onnick {nickname hostname handle channel newnick} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033NICK\003\002- $nickname changed their nickname to $newnick"
}
}
proc monitor::ontopc {nickname hostname handle channel topic} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033TOPIC\003\002- $nickname changed the topic on $channel to: [join $topic]"
}
}
proc monitor::onpubm {nickname hostname handle channel text} {
if {[monitor::checkchan $channel]} {
putserv "PRIVMSG $monitor::alert : -\002\0033PUBM\003\002- $nickname said \002\0034$text\003\002 - $channel"
}
}
putlog "Channel Monitor ($monitor::script) v$monitor::version by $monitor::author loaded." |
Sorry about the errors, i must of been half awake when i was writing it. _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
cryptic Voice
Joined: 25 Apr 2007 Posts: 5
|
Posted: Fri Apr 27, 2007 10:35 am Post subject: |
|
|
| rosc2112 wrote: | | If you'd looked at the tcl-commands.doc again, you'd have noticed that "bind kick" requires 6 arguments, not 5. |
Dang it you're right lol. I looked and looked and it was as plain as the nose on my face...probably why I kept missing it. Thanks rosc2112. Sorry to be a pain there
Thank you tosser for all your help as well. Don't worry about all the errors Im extremely greatful. Gotta remember my original script lol If life didnt have bugs, we wouldnt need Raid lmao.
Thanks rosc and tosser! You both have been a extremely great help! |
|
| Back to top |
|
 |
|