| View previous topic :: View next topic |
| Author |
Message |
MacDaddy Voice
Joined: 20 Jan 2006 Posts: 9
|
Posted: Fri Jan 20, 2006 4:47 pm Post subject: ctcp version |
|
|
hey all i got a mIRC script that i use and i tryed to convert it into tcl
this is the mirc scrpt.
| Code: |
ON !*:JOIN:#: {
ctcp $nick version
}
ON *:CTCPREPLY:VERSION*: {
if (!$window(@version)) window -ne @version
aline @version $nick $1-
if (*version here* iswm $1-) {
/notice $nick $nick message here
}
}
|
and this is what i have for tcl.
| Code: |
bind join - * verjoin
proc verjoin {nick uhost hand chan} {
if {([onchan $nick $chan]) && ("[getchanhost $nick $chan]" == "$uhost")} {
if {([string match -nocase *version here* $nick])} {
putserv "NOTICE $nick message here"
}
}
}
|
i dont get any errors and i dont send the notice can anyone help ?
thanks  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Jan 20, 2006 7:04 pm Post subject: |
|
|
| Code: | bind ctcr - VERSION version:reply
bind join - * check:version
proc check:version {nick uhost hand chan} {
global cversion
set cversion([string tolower $nick]) 1
putserv "privmsg $nick :\001VERSION\001"
}
proc version:reply {nick uhost hand dest kw arg} {
global cversion
if {[isbotnick $dest] && [info exists cversion([string tolower $nick])]} {
if {[string match -nocase "*version here*" $arg]} {
puthelp "notice $nick :message here"
unset cversion([string tolower $nick])
}
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
MacDaddy Voice
Joined: 20 Jan 2006 Posts: 9
|
Posted: Fri Jan 20, 2006 11:22 pm Post subject: |
|
|
Sir_Fz thanks testing it now ok that works well is there a way of putting the
| Code: | | if {[string match -nocase "*version*" $arg]} { |
into more than one version like
| Code: |
if {[string match -nocase "*version1*" $arg] || [string match -nocase "*version2*" $arg]} {
|
and so on add ing versions like that ?
thanks |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Jan 21, 2006 6:30 am Post subject: |
|
|
Yes, try it. Or you can do it like this:
| Code: | set bversions {"*version1*" "*version2*" "*version3*"}
foreach bversion $bversions {
if {[string match -nocase $version $arg]} {
# found match for one of the bad versions
break
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
MacDaddy Voice
Joined: 20 Jan 2006 Posts: 9
|
Posted: Sat Jan 21, 2006 9:52 am Post subject: |
|
|
thanks Sir_Fz works perfect  |
|
| Back to top |
|
 |
|