This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

(Custom Triggers Script)

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
[
[_-S1L3NC3-_]
Voice
Posts: 3
Joined: Sun Dec 23, 2012 6:37 pm

(Custom Triggers Script)

Post by [_-S1L3NC3-_] »

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
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

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

Code: Select all

# 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
.
[
[_-S1L3NC3-_]
Voice
Posts: 3
Joined: Sun Dec 23, 2012 6:37 pm

Another Request

Post by [_-S1L3NC3-_] »

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
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Code: Select all

# 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
.
[
[_-S1L3NC3-_]
Voice
Posts: 3
Joined: Sun Dec 23, 2012 6:37 pm

What I Wanted

Post by [_-S1L3NC3-_] »

Yup It works as expected thanks
Post Reply