| View previous topic :: View next topic |
| Author |
Message |
Branden Halfop
Joined: 04 Aug 2007 Posts: 61
|
Posted: Tue Mar 25, 2008 4:43 pm Post subject: Relay Script. |
|
|
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;
| Quote: |
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"
}
|
|
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Tue Mar 25, 2008 9:08 pm Post subject: Re: Relay Script. |
|
|
| 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... |
|
| Back to top |
|
 |
Branden Halfop
Joined: 04 Aug 2007 Posts: 61
|
Posted: Wed Mar 26, 2008 5:23 am Post subject: |
|
|
| Ok..... But, can someone help me please? |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Wed Mar 26, 2008 6:19 am Post subject: Re: Relay Script. |
|
|
Read doc/tcl-commands.doc
| Quote: | 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"? |
|
| Back to top |
|
 |
Branden Halfop
Joined: 04 Aug 2007 Posts: 61
|
Posted: Wed Mar 26, 2008 3:28 pm Post subject: |
|
|
I tried putting what you put and it didn't work, then I tried this;
| Code: | 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;
| Quote: | | [15:30] Tcl error [NOTICE]: wrong # args: should be "NOTICE text" |
|
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Wed Mar 26, 2008 6:41 pm Post subject: |
|
|
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"? |
|
| Back to top |
|
 |
Branden Halfop
Joined: 04 Aug 2007 Posts: 61
|
Posted: Sat Mar 29, 2008 4:01 pm Post subject: |
|
|
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: |
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"
}
|
| Quote: |
[16:02] Tcl error [NOTICE]: wrong # args: should be "NOTICE text"
|
|
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Sat Mar 29, 2008 4:38 pm Post subject: |
|
|
| Code: | 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 |
|
| Back to top |
|
 |
Branden Halfop
Joined: 04 Aug 2007 Posts: 61
|
Posted: Sat Mar 29, 2008 5:09 pm Post subject: |
|
|
Works great! THANK YOU!  |
|
| Back to top |
|
 |
|