| View previous topic :: View next topic |
| Author |
Message |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Fri Aug 13, 2021 4:16 pm Post subject: gseen limited to chanops and users with certain flags |
|
|
i was wondering how to edit gseen to give only certain users access to its commands like chanops and users with certain flags.
Should it be edited in the conf or elsewhere:
Code:
| Code: |
######
#####
### General Settings
#####
######
# the file where the seen data will be backuped.
# WARNING: set this _before_ the module is loaded.
set gseenfile "gseen.dat"
# now load the module
loadmodule gseen
# load the English language file
loadseenslang "en" "English" language/gseen.en.lang
# load the German language file
loadseenslang "de" "Deutsch" language/gseen.de.lang
# set the default language to english...
set default-slang "en"
# ... but let #xwp use the german langfile
setchanseenlang #xwp "de"
# the char that marks public commands (!seen, etc...)
# "" is a valid option
set cmdchar "!"
# delete data sets that are older than x days
set expire-seens 60
# only answer x seen requests in y seconds to prevent flooding
set max-seens 1:20
# tell users if someone was !seen'ing for them
set tell-seens 1
# check if the user was online under a different nick
set fuzzy-search 1
# allow user to include wildcards in the search?
set wildcard-search 1
# break search if there are more than x matches
set max-matches 250
# forward a request to other bots, if a !seen returned no result?
set botnet-seens 1
# store channels, which are +secret on the bot as [secret]?
set hide-secret-chans 1
# backup the seen data every x minutes
set save-seens 60
######
#####
### AI Settings
#####
######
# 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*"
}
# this is just the same as above, but if triggered it will
# not do an ai-seen, but display its seen-stats.
set ai-seenstats-binds {
"${nick}*seenstats*"
"${botnet-nick}*seenstats*"
}
# when doing an AI seen, ignore the following words (otherwise
# the bot might give weird answers like "<bot> nick, bot was last seen..." :)
set ai-seen-ignore "$nick ${botnet-nick} seen"
######
#####
### special stuff (can be ignored in most cases)
#####
######
# Maximum length of requested nick that will still be processed.
# (by default this is eggdrop's configured nick-length)
set seen-nick-len ${nick-len}
# if the user is known by the bot, log their handle instead of the nick
# (not recommended, might cause confusion by the users)
set use-handles 0
######
#####
### outdated settings (only important for eggdropv1.4 users)
#####
######
# channels where you do not want your bot to reply to public queries
set no-pub-seens "#help"
# channels where you want your bot to send replies via notice to the user and
# not to the channel
set quiet-seens ""
# same as quiet-seens but for AI seen
set quiet-ai-seens ""
# channels where you do not want your bot to log seen data
set no-seendata "#help"
###############################################################################
# end of configuration
# just ignore everything below ^_^
###############################################################################
bind chjn - * *chjn:gseen
bind chpt - * *chpt:gseen
catch "unbind pub - !seen *pub:!seen"
catch "unbind pub - !seennick *pub:!seennick"
catch "unbind pub - !seenstats *pub:!seenstats"
bind pub - ${cmdchar}seen *pub:!seen
bind pub - ${cmdchar}seennick *pub:!seennick
bind pub - ${cmdchar}seenstats *pub:!seenstats
foreach bnd [binds pubm] {
if {([lindex $bnd 2] == "*pubm:seen") || ([lindex $bnd 2] == "*pub:!seenstats")} {
unbind [lindex $bnd 0] [lindex $bnd 1] [lindex $bnd 2] [lindex $bnd 4]
}
}
if {${ai-seen-binds} != ""} {
foreach mask ${ai-seen-binds} {
bind pubm -|- "% [subst $mask]" *pubm:seen
}
}
if {${ai-seenstats-binds} != ""} {
foreach mask ${ai-seenstats-binds} {
bind pubm -|- "% [subst $mask]" *pub:!seenstats
}
}
|
i see the pub bind for the commands but cant find the process for it |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Fri Aug 13, 2021 11:17 pm Post subject: Re: gseen limited to chanops and users with certain flags |
|
|
| simo wrote: | i was wondering how to edit gseen to give only certain users access to its commands like chanops and users with certain flags.
Should it be edited in the conf or elsewhere:
...
| Code: |
bind pub - ${cmdchar}seen *pub:!seen
bind pub - ${cmdchar}seennick *pub:!seennick
bind pub - ${cmdchar}seenstats *pub:!seenstats
...
|
i see the pub bind for the commands but cant find the process for it
|
I don't know what you mean by, "... the process for it" .
Please elaborate.
In the meantime :
Experiment with the bind lines that you found, and are quoted above.
If you are unfamiliar with the use of
bind pub
then visit: https://docs.eggheads.org/mainDocs/tcl-commands.html
and text search for: bind pub
and read.
Also see: http://suninet.the-demon.de/041.htm
And to get a list of flags, in partyline do: .help whois
or visit: http://www.egghelp.org/commands/core.htm#whois
Remember! - when editing bind lines, a simple .rehash is not good enough.
If you use .rehash to implement your edit, you might get unexpected (and confusing ) results.
The simple way to be sure, after editing a bind line, is to use .restart .
(There are other ways, but that is the simple way. )
I hope this helps. _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sat Aug 14, 2021 12:10 am Post subject: |
|
|
| CrazyCat wrote: | Peharps you miss the line:
loadmodule gseen
gseen is a module, the tcl file is just for some configuration. |
Thanks crazycat im aware it's a module and loaded fine i just wanted to have like chanops isop and users with flag o to have access to the public command and no one else if that's possible |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sat Aug 14, 2021 12:13 am Post subject: Re: gseen limited to chanops and users with certain flags |
|
|
| Thanks willyw i already experimented with that but needed to find s way to check for like isop and ishalfop as well |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Sat Aug 14, 2021 4:58 am Post subject: |
|
|
| simo wrote: | | CrazyCat wrote: | Peharps you miss the line:
loadmodule gseen
gseen is a module, the tcl file is just for some configuration. |
Thanks crazycat im aware it's a module and loaded fine i just wanted to have like chanops isop and users with flag o to have access to the public command and no one else if that's possible |
The only way you have, it's to modify binds to call your own procedure which will check user and then call the original procedure.
Example:
| Code: | # bind pub - ${cmdchar}seen *pub:!seen
bind pub - ${cmdchar}seen mypub:seen
proc mypub:seen {nick uhost handle chan text} {
if {[isop $nick $chan] || [ishalfop $nick $chan]} {
*pub:!seen $nick $uhost $handle $chan $text
}
} |
This is only an example, you can add any check you want in the mypub:seen proc. _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Sat Aug 14, 2021 5:37 am Post subject: |
|
|
| thank you CrazyCat that seems to work well |
|
| Back to top |
|
 |
|