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.

Relay Script.

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Relay Script.

Post by Branden »

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"
}
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Re: Relay Script.

Post by speechles »

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...
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Post by Branden »

Ok..... But, can someone help me please?
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: Relay Script.

Post by user »

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"?
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Post by Branden »

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 avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

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"?
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Post by Branden »

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"
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

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
B
Branden
Halfop
Posts: 61
Joined: Sat Aug 04, 2007 8:36 pm

Post by Branden »

Works great! THANK YOU! :D
Post Reply