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.

need to convert mrc to tcl

Old posts that have not been replied to for several years.
Locked
c
canercan
Voice
Posts: 10
Joined: Wed Jun 29, 2005 7:54 am

need to convert mrc to tcl

Post by canercan »

on *:snotice:*:{
if $nick == $server {
if *clone alert* iswm $1- {
kline $+ (*@,$9) Clone Yapmayınız. 15
}
if *client connecting* iswm $1- {
fjoin $9 #chan
}
}
}

I am a novice I did it as below

bind notc - * ::ircd::notice

if $notc {
if $nick == $server {
}


if *client connecting* iswm $1- {
fjoin $9 #Sohbet
}

but it did not work can you do me a favour about converting it?
thanks
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Well, you could try searching the TCL Archive or learning TCL. If you looked at a TCL Guide, the first thing you would notice is the binds and the proc.

Code: Select all

bind notc - * ::ircd::notice 

That bind looks fine to me, now you need to make a proc for this.

Code: Select all

proc ::ircd::notice {nick host hand} {
if {($nick == $server)} {
blah
}

I think that will work

I dont understand what you want the other code to do, what is it looking for in $1-

r0t3n @ #r0t3n @ Quakenet
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

I wouldn't use double colons in proc names unless I really wanted to use namespaces.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
c
canercan
Voice
Posts: 10
Joined: Wed Jun 29, 2005 7:54 am

Post by canercan »

I want to fjoin people on connect so I need help. The code I wrote at the beginning is its .mrc but tcl?
thanks
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

nope, you can't intercept server notices with [bind notc]

you need a raw bind:

Code: Select all

bind raw - NOTICE foo
proc foo {from keyword text} {
   scan $::server {%[^:]} server
   if {$from == $server} {
      set who [lindex [split $text] 9] ;# or whatever parameter number it is
      scan $who {%[^!]!%[^@]@%s} nick user host
      if {[string match -nocase "*clone alert*" $text]} {
         putserv "kline 300 *@$host :clones" ;# 300min temp kline
      } elseif {[string match -nocase "*client connecting*" $text]} {
         putserv "fjoin $nick #channel"
      }
   }
}
c
canercan
Voice
Posts: 10
Joined: Wed Jun 29, 2005 7:54 am

Post by canercan »

Thank you very much it does work
Locked