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 

ctcp version

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
MacDaddy
Voice


Joined: 20 Jan 2006
Posts: 9

PostPosted: Fri Jan 20, 2006 4:47 pm    Post subject: ctcp version Reply with quote

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Jan 20, 2006 7:04 pm    Post subject: Reply with quote

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


Joined: 20 Jan 2006
Posts: 9

PostPosted: Fri Jan 20, 2006 11:22 pm    Post subject: Reply with quote

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Jan 21, 2006 6:30 am    Post subject: Reply with quote

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


Joined: 20 Jan 2006
Posts: 9

PostPosted: Sat Jan 21, 2006 9:52 am    Post subject: Reply with quote

thanks Sir_Fz works perfect Laughing
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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