| View previous topic :: View next topic |
| Author |
Message |
Source Voice
Joined: 17 Dec 2005 Posts: 2
|
Posted: Sat Dec 17, 2005 1:19 am Post subject: Please someone help me.... |
|
|
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: | 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.... |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Dec 17, 2005 12:33 pm Post subject: |
|
|
This helps:
| Code: | if {[string match $this $that]} {
# match
}
if {![string match $this $that]} {
# NO match
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Source Voice
Joined: 17 Dec 2005 Posts: 2
|
Posted: Sat Dec 17, 2005 10:19 pm Post subject: |
|
|
sorry abt this but.. can I get a more help .. cuz I dont know what "$that $this" is..
thanks.. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Sat Dec 17, 2005 10:38 pm Post subject: |
|
|
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] tag when posting logs, code |
|
| Back to top |
|
 |
|