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 

Please someone help me....

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


Joined: 17 Dec 2005
Posts: 2

PostPosted: Sat Dec 17, 2005 1:19 am    Post subject: Please someone help me.... Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Dec 17, 2005 12:33 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Source
Voice


Joined: 17 Dec 2005
Posts: 2

PostPosted: Sat Dec 17, 2005 10:19 pm    Post subject: Reply with quote

sorry abt this but.. can I get a more help .. cuz I dont know what "$that $this" is..Sad
thanks..
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sat Dec 17, 2005 10:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
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