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 

(Custom Triggers Script)

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


Joined: 23 Dec 2012
Posts: 3

PostPosted: Sun Dec 23, 2012 6:49 pm    Post subject: (Custom Triggers Script) Reply with quote

Hey Guys It's Me S1L3NC3 Im wondering if someone can make or help me make a custom trigger's script. By custom triggers I mean you program to set a value the bot responds, only to that value and you edit the output in which the bot responds with --- EX USER : user has quit) The Bot : See Ya Later Come Back! - - - - As you can see the user has quit the server the bot identifies that message it acknowledges that it's in the word list to " look for " and responds with an edited response in this case "See Ya Later Come Back!" So in other words i want a script that tell my eggdrop to look for a quit, when eggdrop see's that quit it sets a custom response I can edit
------ Thanks [_-S1L3NC3-0F-T4UTH-_] On FreeNode Eggdrops Help Channel
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sun Dec 23, 2012 8:15 pm    Post subject: Reply with quote

Try this and see if it's what yer lookin for:)
Code:

# leave this empty for all channels the bot is on
# or set the channel(s) for the script to run on
# Example:  set quitChans {#yourchannel}
# Example:  set quitChans {#chan #chan2 #chan3}
set quitChans {}

# set the trigger|reply text here. #
set quitText {
*Read error*|Ouch! That hurts.
*Bye*|See you later.
}

########## END SETTINGS ##########

bind sign - * quit:say

set quitChans [split [string tolower [string trim $quitChans]]]
set quitText [split [string trim $quitText] "\n"]

proc quit:say {nk uh hn ch rsn} {  set ch [string tolower $ch]

  if {$::quitChans ne "" && [lsearch -exact $::quitChans $ch]=="-1"} { return }
  if {[string equal -nocase $::botnick $nk] || $rsn eq ""} { return }

  foreach item $::quitText {  set item [split $item |]
    if {[string match -nocase [lindex $item 0] $rsn]} {
      puthelp "PRIVMSG $ch :[lindex $item 1]"  ;  break
    }
  }
  return
}


_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
[_-S1L3NC3-_]
Voice


Joined: 23 Dec 2012
Posts: 3

PostPosted: Sun Dec 23, 2012 10:24 pm    Post subject: Another Request Reply with quote

Great It works, but can you add a randomized option so it wont respond with the same output? EX - # set the trigger|reply text here. #
set quitText *Spark Out,Roger?*|Acknowledged, Echo Out.
*Quit: Spark Out,Roger?*|Confirmed, Catch Ya Later.
*Quit: Spark Out,Roger?*|Message Recieved| Until Next Time
}
So It one of those are randomly selected once at a time
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sun Dec 23, 2012 10:49 pm    Post subject: Reply with quote

Code:

# leave this empty for all channels the bot is on
# or set the channel(s) for the script to run on
# Example:  set quitChans {#yourchannel}
# Example:  set quitChans {#chan #chan2 #chan3}
set quitChans {}

# set the  trigger|reply|reply2|reply3|morereplies  text here. #
# put each different trigger on its own line.
# each trigger can have as many replies as you want.
set quitText {

*Spark Out,Roger?*|Confirmed, Catch Ya Later.|Message Recieved.|Until Next Time.

} ;# end of quitText #

########## END SETTINGS ##########

bind sign - * quit:say

set quitChans [split [string tolower [string trim $quitChans]]]
set quitText [split [string trim $quitText] "\n"]

proc quit:say {nk uh hn ch rsn} {  set ch [string tolower $ch]
  if {$::quitChans ne "" && [lsearch -exact $::quitChans $ch]=="-1"} { return }
  if {[string equal -nocase $::botnick $nk] || $rsn eq ""} { return }

  foreach item $::quitText {  set item [split $item |]
    if {[string match -nocase [string trim [lindex $item 0]] $rsn]} {
      set reply [lrange $item 1 end]
      puthelp "PRIVMSG $ch :[lindex $reply [rand [llength $reply]]]"  ;  break
    }
  }
  return
}


_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Back to top
View user's profile Send private message Visit poster's website
[_-S1L3NC3-_]
Voice


Joined: 23 Dec 2012
Posts: 3

PostPosted: Sun Dec 23, 2012 11:14 pm    Post subject: What I Wanted Reply with quote

Yup It works as expected thanks
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 -> 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