Code: Select all
** snipped, no longer relevant, use code provided below **
That can happen, but only if there are nicks in your channel using There and Everyone and both those nicks are away with those messages. The script replaces %nick with the wildcard symbol * when matching. The problem is if you want to match just "hey nick", as two words, this method will do that but will also match for anything using "hey nick" even "hey nick what are you doing this thursday?". Both of those will match using this script because nick is evaluated as a wildcard, and since it ends what we are checking for, it will end matching anything after it. Your asking the eggdrop to self distinguish which words are nicknames within the context of an entire sentence, which it just cannot do without being told how. This is the best approach to doing something like you desire using a check list.<nick> hey there everybody, what's up?
<bot> There is away: Doing stuff not related at all to irc.
<nick> hello everyone in the channel!
<bot> Everyone is away: Does anyone even read these messages?
Code: Select all
# this setting configures on which sentences your bot should
# attempt to do an ai-seen. Each of them is a simple wildcard
# mask. Set this to "" if you want to deactivate ai-seens or
# create more precise masks if the bots reacts too often.
set ai-seen-binds {
"${nick}*seen*"
"${botnet-nick}*seen*"
"${nick}*gesehen*"
"${botnet-nick}*gesehen*"
}
Yes, that was what I was looking for.Your asking the eggdrop to self distinguish which words are nicknames within the context of an entire sentence, which it just cannot do without being told how.
What are the errors? Can't help get rid of them without knowing what they are...holycrap wrote:Yes, that was what I was looking for.Your asking the eggdrop to self distinguish which words are nicknames within the context of an entire sentence, which it just cannot do without being told how.
I've seen most of your work, speechles, I know you can find a way to make this work. I would be very greatful if you can. And where do i go to donate to "slennox"?
Oh, the script didn't run, it had some errors.
Thanks for all your time!
Code: Select all
[01:32] invalid command name "}"
while executing
"} "
(file "script1/away.tcl" line 42)
invoked from within
"source script1/away.tcl"
Code: Select all
if {[onchan $::checknick $chan]}
Code: Select all
if {[onchan $::checknick $chan]} {
Code: Select all
[02:35] missing close-brace
while executing
"proc check:away {from key text} {
if {![string match -nocase [lindex [split $text] 1] $::checknick] { return }
putserv "privmsg $::checkchan :..."
(file "script1/Away.tcl" line 47)
invoked from within
"source script1/Away.tcl"
guess it doesn't like those colons in the proc names.holycrap wrote:Scripts loads... but the bot doesn't do anything.
Code: Select all
# Automated Away Detection by speechles
# Egghelp version v1.0 - tested and working.. yay!!
# Donate to slennox @ egghelp.org if you like this script!
# CONFIG begins
# set your sentence triggers below. You MUST use %nick
# somewhere in each line. This setting configures on which
# sentences your bot should attempt to do an ai away. Each
# of them is a simple wildcard mask. Create more precise
# masks if the bot reacts too often.
variable checklist {
"hey %nick"
"hello %nick"
"%nick are you there?"
}
# SCRIPT begins
# initialize the global variables
variable checknick ""
variable checkchan ""
# flag to control behavior per channel
setudef flag checknames
# bind to raw reply concerning away status of whois
bind RAW -|- 301 checkaway
# bind to everything said in channel
bind pubm -|- * checkcriteria
# check checklist against user input
# if we have a match, discern which token to evaluate as nick
# and if they are indeed on the channel issue a whois request
proc checkcriteria {nick uhost hand chan text} {
if {[lsearch -exact [channel info $chan] +checknames] == -1} { return }
set ::checkchan $chan
foreach entry $::checklist {
if {[string match -nocase [string map {"%nick" "*"} $entry] $text]} {
set ::checknick [lindex [split $text] [lsearch -exact [split $entry] "%nick"]]
if {[onchan $::checknick $chan]} {
putserv "WHOIS $::checknick"
}
break
}
}
}
# interpret the whois request and make sure the nick requested matches
# the whois reply we are searching for. If the person is not away, a 301
# will not be sent, and the whois will be ignored as per requested.
proc checkaway {from key text} {
if {![string match -nocase [lindex [split $text] 1] $::checknick]} { return }
putserv "privmsg $::checkchan :[lindex [split $text] 1] is away: [string trim [join [lrange [split $text] 2 end]] ":"]"
set ::checknick ""
}
putlog "Automated away detection loaded."
Tested and fully working, if you have any questions feel free to ask. Notice the script is not case sensitive, and will correct the nickname in it's reply to the proper case when reporting.<test123> /away this is an away test for egghelp
<speechles> tESt123 are you there?
<sp33chy> test123 is away: this is an away test for egghelp
<speechles> hey TEST123 are you here?
<sp33chy> test123 is away: this is an away test for egghelp
Assuming you have already .chanset #yourchan +checknames I'm stumped why it doesn't work. Message me on irc.efnet.net, because it works perfectly there. speechles @ efnet.holycrap wrote:Do I have to do something extra? Or maybe the server that i'm running disabled something that prevented it to function? Cause the bot is not doing anything still.
<speechles> hey freymor where are ya?
<sp33chy> Freymor is away: offline, leave a msg!!!
<speechles> hello cyberfoxx you dead?
<sp33chy> CyberFoxx is away: Auto Away
<speechles> |shadow| are you there?
<sp33chy> |Shadow| is away: Sleeping
It is limited, because having the bot check every single word within every single line said against the nick list would seriously drain the resources of your bot and slow it down to a crawl. You can add as many triggers as you want with as many different phrases as you need to compensate. This is exactly how the ai-seen within the gseen module works.holycrap wrote:Cool, it works now! Didn't have .chanset #yourchan +checknames, that's why it didn't work.
So, it's not possible to make the bot distinguish within the context of a sentence which is a nick? It would be very cool if you can get this to work! Please?
This seems very limited... that the bot only reply on those triggers.
Ok.. gonna go to donate now.