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.

mIRC script -> TCL script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
X
XndR
Voice
Posts: 3
Joined: Mon Aug 17, 2009 6:12 pm

mIRC script -> TCL script

Post by XndR »

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: Select all

On *:Text:*:#chan1:{
  if (phrase1 isin $1-) {
    if ($nick isop #chan1) {
      msg #chan2 $1-
    }
  }
}
Thanks.
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

mIRC scripting is complete jibberish. Wouldn't it be easier simply to tell us what it does?
I must have had nothing to do
X
XndR
Voice
Posts: 3
Joined: Mon Aug 17, 2009 6:12 pm

Post by XndR »

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.
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

Code: Select all

# 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
X
XndR
Voice
Posts: 3
Joined: Mon Aug 17, 2009 6:12 pm

Post by XndR »

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.
Post Reply