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 

Bot should response to spoken word from user

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
Jagg
Halfop


Joined: 24 Jan 2004
Posts: 53

PostPosted: Tue Sep 06, 2005 7:35 am    Post subject: Bot should response to spoken word from user Reply with quote

Hi,

how to do a little script that response a simple text if a user says a word which has a [ in front of the word and a ] after (like [help])

For example:

<user>please look for [help]
<eggdrop>www.testurl.com/<the_word_from_the_user>

Thanks
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Sep 06, 2005 8:18 am    Post subject: Reply with quote

Code:
bind pubm - * response

proc response {nick uhost hand chan arg} {
 set i 0
 foreach w [split $arg] {
  if {[string match \[*\] $w]} { set in $i ; break}
  incr i
 }
 if {[info exists in]} {
  puthelp "privmsg $chan :www.testurl.com/[string map {[ "" ] ""} [lindex [split $arg] $in]]"
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Jagg
Halfop


Joined: 24 Jan 2004
Posts: 53

PostPosted: Tue Sep 06, 2005 9:23 am    Post subject: Reply with quote

Sir_Fz wrote:
Code:
bind pubm - * response

proc response {nick uhost hand chan arg} {
 set i 0
 foreach w [split $arg] {
  if {[string match \[*\] $w]} { set in $i ; break}
  incr i
 }
 if {[info exists in]} {
  puthelp "privmsg $chan :www.testurl.com/[string map {[ "" ] ""} [lindex [split $arg] $in]]"
 }
}


Thanks

First one didn't work then I done a refresh of this site and the code changed but also didn't work.

I have now edit
Code:
[string match \[*\] $w]

to
Code:
[string match {\[*\]} $w]

Then it works Smile

THANKS YOU!
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Sep 06, 2005 9:29 am    Post subject: Reply with quote

Yeah my bad, that's because \[*\] will only match the character "*".
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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