egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Relay Script.

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Branden
Halfop


Joined: 04 Aug 2007
Posts: 61

PostPosted: Tue Mar 25, 2008 4:43 pm    Post subject: Relay Script. Reply with quote

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
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Tue Mar 25, 2008 9:08 pm    Post subject: Re: Relay Script. Reply with quote

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
View user's profile Send private message
Branden
Halfop


Joined: 04 Aug 2007
Posts: 61

PostPosted: Wed Mar 26, 2008 5:23 am    Post subject: Reply with quote

Ok..... But, can someone help me please?
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Wed Mar 26, 2008 6:19 am    Post subject: Re: Relay Script. Reply with quote

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
View user's profile Send private message
Branden
Halfop


Joined: 04 Aug 2007
Posts: 61

PostPosted: Wed Mar 26, 2008 3:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Wed Mar 26, 2008 6:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Branden
Halfop


Joined: 04 Aug 2007
Posts: 61

PostPosted: Sat Mar 29, 2008 4:01 pm    Post subject: Reply with quote

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
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Sat Mar 29, 2008 4:38 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Branden
Halfop


Joined: 04 Aug 2007
Posts: 61

PostPosted: Sat Mar 29, 2008 5:09 pm    Post subject: Reply with quote

Works great! THANK YOU! Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber