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.

Please someone help me....

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
S
Source
Voice
Posts: 2
Joined: Sat Dec 17, 2005 1:00 am

Please someone help me....

Post by Source »

Hello all,
I need a little help.. I hope someone will help me with that..
I trying to edit respond.tcl to make him to answer if the word not match but I dont have success yet.. so I need a help
there is the code...

Code: Select all

set mc_resp(somethin) { answer }
set mc_resp(something) { answer }
etc...
set mc_resp(what to put here?) { answer if all word not match }


set mc_re(chan) [string tolower $mc_re(chan)]
bind pubm - * mc:resp
proc mc:resp {nick uhost hand chan args} {
 global mc_resp mc_re ; set args [string tolower [lindex $args 0]]
 if {[lsearch -exact $mc_re(chan) [string tolower $chan]] == "-1"} {return 0}
 foreach search [string tolower [array names mc_resp]] {
  if {[string match $search $args]} {
   if {[string match *\n* $mc_resp($search)]} {
    foreach post [mc:resp:rep $mc_resp($search) $nick $uhost $hand $chan] {
     puthelp "PRIVMSG $chan :$post"
    } ; break
   } {
    puthelp "PRIVMSG $chan :[mc:resp:rep $mc_resp($search) $nick $uhost $hand $chan]"
   }
  }
 }
}

proc mc:resp:rep {data nick uhost hand chan} {
 global botnick
 regsub -all -- %nick $data $nick data ; regsub -all -- %uhost $data $uhost data
 regsub -all -- %botnick $data $botnick data
 regsub -all -- %hand $data $hand data ; regsub -all -- %chan $data $chan data
 regsub -all -- %b $data  data ; regsub -all -- %r $data  data
 regsub -all -- %u $data  data ; regsub -all -- %c $data  data
 return $data
}
I hope that someone will respond to my topic..

P.S.: sorry for my bad english....
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

This helps:

Code: Select all

if {[string match $this $that]} {
 # match
}

if {![string match $this $that]} {
 # NO match
}
S
Source
Voice
Posts: 2
Joined: Sat Dec 17, 2005 1:00 am

Post by Source »

sorry abt this but.. can I get a more help .. cuz I dont know what "$that $this" is..:(
thanks..
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

so what makes you think you can edit software (script) when you obviously don't know a sh*t about programming (scripting)?

that's equivalent to trying to edit text in Chinese, not knowing Chinese alphabet... good luck
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
Post Reply