| View previous topic :: View next topic |
| Author |
Message |
[_-S1L3NC3-_] Voice
Joined: 23 Dec 2012 Posts: 3
|
Posted: Sun Dec 23, 2012 6:49 pm Post subject: (Custom Triggers Script) |
|
|
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 |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Sun Dec 23, 2012 8:15 pm Post subject: |
|
|
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 |
|
 |
[_-S1L3NC3-_] Voice
Joined: 23 Dec 2012 Posts: 3
|
Posted: Sun Dec 23, 2012 10:24 pm Post subject: Another Request |
|
|
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 |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 792 Location: Tennessee, USA
|
Posted: Sun Dec 23, 2012 10:49 pm Post subject: |
|
|
| 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 |
|
 |
[_-S1L3NC3-_] Voice
Joined: 23 Dec 2012 Posts: 3
|
Posted: Sun Dec 23, 2012 11:14 pm Post subject: What I Wanted |
|
|
| Yup It works as expected thanks |
|
| Back to top |
|
 |
|