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 

mIRC script -> TCL script

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


Joined: 17 Aug 2009
Posts: 3

PostPosted: Mon Aug 17, 2009 6:16 pm    Post subject: mIRC script -> TCL script Reply with quote

I wrote a mIRC script awhile back and am now looking to add it to an eggdrop so I don't have to be online 24/7 for the script to be active.

I have no experience with TCL scripting so I was hoping someone could just translate this real quick.

Code:
On *:Text:*:#chan1:{
  if (phrase1 isin $1-) {
    if ($nick isop #chan1) {
      msg #chan2 $1-
    }
  }
}


Thanks.
Back to top
View user's profile Send private message
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Mon Aug 17, 2009 6:20 pm    Post subject: Reply with quote

mIRC scripting is complete jibberish. Wouldn't it be easier simply to tell us what it does?
_________________
I must have had nothing to do
Back to top
View user's profile Send private message
XndR
Voice


Joined: 17 Aug 2009
Posts: 3

PostPosted: Mon Aug 17, 2009 8:15 pm    Post subject: Reply with quote

It checks every line of text in chan1. If any part of it matches phrase1 and is said by an op then it will echo the text in chan2.
Back to top
View user's profile Send private message
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Tue Aug 18, 2009 1:58 am    Post subject: Reply with quote

Code:

# text input channel
set vRelayChanInput "#eggtcl"

# text output channel
set vRelayChanOutput "#tcl"

# text word/phrase to match
set vRelayText "myspace"

bind PUBM - * pRelayCheckText

proc pRelayCheckText {nick uhost hand chan text} {
    global vRelayChanInput vRelayChanOutput vRelayText
    if {[string equal -nocase $vRelayChanInput $chan]} {
        if {[string match -nocase *${vRelayText}* $text]} {
            if {[isop $nick $chan]} {
                if {[validchan $vRelayChanOutput]} {
                    if {[botonchan $vRelayChanOutput]} {
                        putserv "PRIVMSG $vRelayChanOutput :$nick said $text in $chan"
                    }
                }
            }
        }
    }
    return 0
}

_________________
I must have had nothing to do
Back to top
View user's profile Send private message
XndR
Voice


Joined: 17 Aug 2009
Posts: 3

PostPosted: Tue Aug 18, 2009 3:25 pm    Post subject: Reply with quote

Thanks, it works great. Only question I have is: does eggdrop support foreign characters or no? Sometimes the string will end early if it encounters specific characters.
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