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 

MSG in a chan, MSG -> other chan

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Redento
Voice


Joined: 13 Jun 2007
Posts: 3

PostPosted: Wed Jun 13, 2007 9:03 am    Post subject: MSG in a chan, MSG -> other chan Reply with quote

Hi all Smile

I've been learning TCL for a few times, but not as much as i can complete my first little tcl of my own.

Aim is simple: when a *text* is typed in a chan, eggdrop has to report it, as it is, in another chan.

What i did so far is this:
Code:

bind pub - * procedura
proc procedura {nick host handle chan text} {
  set comando [lindex [split $text " "] 0]
  set comando2 [lindex [split $text " "] 0]
  if {($comando == "TEST") && ($nick == "mynick") && ($chan == "#mychan")} {
   set $comando2 == $text
    putquick "privmsg #otherchan: $comando2 $nick $text test123"
    return 0
    }


I've even tried creating a temporary txt file, but it's still too much for my actuals knowledge. If someone can point me out for a example tcl where i might learn from, or to help me with above one.

Thanks in advance.
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Wed Jun 13, 2007 12:22 pm    Post subject: Reply with quote

pub doesn't allow a wildcard, use pubm.
Back to top
View user's profile Send private message
Redento
Voice


Joined: 13 Jun 2007
Posts: 3

PostPosted: Sun Jun 17, 2007 1:35 pm    Post subject: Reply with quote

metroid wrote:
pub doesn't allow a wildcard, use pubm.

Well, i did that, but unluckily no luck yet.

Been searching in threads for more than a while, but no way. Smile

I did modify the proc many times, doing various test, though. What i did, or at least, one of the many tries.
Code:

bind pubm - "*word*" procedura
proc procedura { nick host hand keyword text} {
        if {[string match "*word*" $text]} {
         putserv "privmsg #mychan:test $text abc"
            }
         }


Still doesn't work. Sad
Back to top
View user's profile Send private message
r0t3n
Owner


Joined: 31 May 2005
Posts: 507
Location: UK

PostPosted: Mon Jun 18, 2007 1:48 pm    Post subject: Reply with quote

just to note, setting comando and comando2 to the same is wrong, and also why set comando2 to text when you can just use $text itself...
_________________
r0t3n @ #r0t3n @ Quakenet
Back to top
View user's profile Send private message MSN Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Jun 18, 2007 2:13 pm    Post subject: Reply with quote

Think you've missed a space between the target (channel), and the start of the message:
Code:
putserv "privmsg #mychan:test $text abc"

Most likely, it should be
Code:
putserv "privmsg #mychan :test $text abc"


Also, the if-statement within the proc is kinda pointless, as it will (almost) always match when the binding triggers (unless "word" is part of the channelname)
_________________
NML_375, idling at #eggdrop@IrcNET
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 -> Scripting Help 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