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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Branden
Halfop
Posts: 61 Joined: Sat Aug 04, 2007 8:36 pm
Post
by Branden » Tue Mar 25, 2008 4:43 pm
I want the script to send all /msg's and /notice's messaged to a channel said by the bot, here is what I have, but fails to work, but no errors;
bind msgm - "*" PM
bind notc - "*" notice
proc PM { nick uhost handle chan text } {
set themessage [lrange $text 0 end]
putserv "PRIVMSG #Satanic :$themessage"
}
proc notic { nick uhost handle chan text dest } {
set themessage [lrange $text 0 end]
putserv "PRIVMSG #Satanic :$themessage"
}
speechles
Revered One
Posts: 1398 Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)
Post
by speechles » Tue Mar 25, 2008 9:08 pm
Branden wrote: putserv "PRIVMSG #Satanic :$themessage"
putserv "PRIVMSG #Satanic :$themessage"
It just doesn't seem right to help the devil..
Next time, for better effect.. and to show others you don't dance naked in chicken blood while chanting verses from the bible backwards, omit the channel your referencing and just call it #somechan...
Branden
Halfop
Posts: 61 Joined: Sat Aug 04, 2007 8:36 pm
Post
by Branden » Wed Mar 26, 2008 5:23 am
Ok..... But, can someone help me please?
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Wed Mar 26, 2008 6:19 am
Read doc/tcl-commands.doc
bind msgm <flags> <mask> <proc>
procname <nick> <user@host> <handle> <text>
bind notc <flags> <mask> <proc>
procname <nick> <user@host> <handle> <text> <dest>
...As you can see, there's no "chan". And keep in mind that the notc bind is triggered by public notices too, so you have to implement some sort of check to make sure you only relay notices sent to the bot. (Eg.: if {[isbotnick $dest]} {relay})
Have you ever read "The Manual"?
Branden
Halfop
Posts: 61 Joined: Sat Aug 04, 2007 8:36 pm
Post
by Branden » Wed Mar 26, 2008 3:28 pm
I tried putting what you put and it didn't work, then I tried this;
Code: Select all
proc notic { nick uhost handle text dest } {
global botnick
set themessage [lrange $text 0 end]
if {$botnick == $dest} {
putserv "PRIVMSG #Satanic :--- Recieved NOTICE --- $nick = $themessage"
}
}
and that didn't work, and I get this error now;
[15:30] Tcl error [NOTICE]: wrong # args: should be "NOTICE text"
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Wed Mar 26, 2008 6:41 pm
The command mentioned in your error message doesn't match the name of your proc. Maybe you need to restart to get rid of old binds? Also, you should split $text before you use lrange on it. (or remove that part entirely, as you probably don't need it)
Have you ever read "The Manual"?
Branden
Halfop
Posts: 61 Joined: Sat Aug 04, 2007 8:36 pm
Post
by Branden » Sat Mar 29, 2008 4:01 pm
Ok... I'm still getting the same error, and I've read the TCL commands file...
I do not understand what I'm doing wrong...
Code: Select all
bind notc - * notice
proc notice {nick uhost hand text {dest ""}} {
global botnick; if {$dest == ""} {set dest $botnick}
set themessage [lrange $text 0 end]
putserv "PRIVMSG #Satanic :--- Recieved NOTICE --- $nick = $themessage"
}
[16:02] Tcl error [NOTICE]: wrong # args: should be "NOTICE text"
r0t3n
Owner
Posts: 507 Joined: Tue May 31, 2005 6:56 pm
Location: UK
Post
by r0t3n » Sat Mar 29, 2008 4:38 pm
Code: Select all
bind msgm - {*} relay
bind notc - {*} relay
proc relay {nick host hand text {dest ""}} {
if {([info exists dest] || $dest != "") && [isbotnick $dest]} {
putserv "PRIVMSG #Satanic :--- Received NOTICE --- $nick ($nick!$host) = $text"
} else {
putserv "PRIVMSG #Satanic :--- Received PRIVMSG --- $nick ($nick!$host) = $text"
}
}
not tested!
r0t3n @ #r0t3n @ Quakenet
Branden
Halfop
Posts: 61 Joined: Sat Aug 04, 2007 8:36 pm
Post
by Branden » Sat Mar 29, 2008 5:09 pm
Works great! THANK YOU!