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.

Auto & trigger voice/devoice

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
c
crymsun
Voice
Posts: 33
Joined: Tue Nov 13, 2018 8:24 pm

Auto & trigger voice/devoice

Post by crymsun »

Scrolled through a ton of scripts here... but none had this combination, and a few that were close, the person solved themselves without posting the finished script... IF you do find a script that matches, feel free to post the link... I may have missed it. Thanks in advance to all that help!

Need a script that does the following:

Auto-voice on join nicks that start with lowercase (needs to ignore any special characters, whether they are before or after the first lowercase letter)
- should auto voice nickNICK, 1nick, `nick, nick{N}... but not voice Nick{n}, `Nick, ^Nick, etc..

Add in user-initiated voice/devoice triggers:
!inuse = devoices
!useme = voices

Running Eggdrop 1.8, if that matters... on a network with Chanserv and Nickserv.
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Re: Auto & trigger voice/devoice

Post by willyw »

Load this and experiment with it. See if it does that which you described.

Code: Select all

# December 17 2018

#  http://forum.egghelp.org/viewtopic.php?t=20559

# Need a script that does the following:

# Auto-voice on join nicks that start with lowercase (needs to ignore any special characters, whether they are before or after the first lowercase letter)
# - should auto voice nickNICK, 1nick, `nick, nick{N}... but not voice Nick{n}, `Nick, ^Nick, etc..
#
# Add in user-initiated voice/devoice triggers:
# !inuse = devoices
# !useme = voices


#############
#############
#
# You need to set the channel that this script will work in, in this line below:  bind join - "#chan_name_here *" lowercasevoice
#
# Typing    !inuse    in #channel will cause bot to simply try to devoice the nick that typed that command.
#
# Typing    !useme    in #channel will use the same logic as joining #channel does, to decide if bot will try to voice the nick that typed that command.
#
#




###############################################################
###############################################################



bind join - "#willytest *" lowercasevoice
bind pub - "!inuse" do_devoice
bind pub - "!useme" do_voice



#####
proc do_devoice {nick uhost handle chan text} {
global botnick

        if {![botisop $chan]} {
                putserv "privmsg $chan :Auggghh!  I can't do de-voicing because $botnick isn't op'd in $chan right now.  :(  "
                return 0
        }

        pushmode $chan -v $nick
}
#####


#####
proc do_voice {nick uhost handle chan text} {
global botnick

        if {![botisop $chan]} {
                putserv "privmsg $chan :Auggghh!  I can't do voicing because $botnick isn't op'd in $chan right now.  :(  "
                return 0
        }

        lowercasevoice $nick $uhost $chan $chan
}
#####


#####
proc lowercasevoice {nick uhost handle chan } {
global botnick

        if {![botisop $chan]} {
                putserv "privmsg $chan :Auggghh!  I can't do voicing because $botnick isn't op'd in $chan right now.  :(  "
                return 0
        }


        set splitnick [split $nick ""]


        foreach c $splitnick {
                if {[string is alpha $c]} {
                        if {[string is upper $c]} {
                                return 0
                        } else {
                                pushmode $chan +v $nick
                                return 0
                        }
                }

        }
}
#####

For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
c
crymsun
Voice
Posts: 33
Joined: Tue Nov 13, 2018 8:24 pm

Post by crymsun »

Great script!

The bot is on a network that has Chanserv and Nickserv.. so different levels of op...

The bot is a super op (has the & symbol) - for some reason when tested, it claims it can't voice due to not being opped.

Any ideas?
c
crymsun
Voice
Posts: 33
Joined: Tue Nov 13, 2018 8:24 pm

Post by crymsun »

Update... downgraded the bot to regular op.. that helped with backend/dcc commands... but no matter what we do, the bot replies with that "botisop" statement:

"Auggghh! I can't do de-voicing because DsPbot isn't op'd in #Channel right now. :( "
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

crymsun wrote: ...
The bot is a super op (has the & symbol) - for some reason when tested, it claims it can't voice due to not being opped.

Any ideas?
First, do:
.channel #chanName
in partyline, to list all nicks in #chanName. You'll see them as the bot sees them, and you'll see who the bot thinks is op'd, etc.
Find the line that is the bot itself. It won't have an @ , according to what you've said, even though the bot is &. The bot will appear as a regular nick in channel.
Right?
:)

Next, open the working eggdrop.conf for editing.
Find this section:

Code: Select all

# Some IRC servers are using some non-standard op-like channel prefixes/modes.
 # Define them here so the bot can recognize them. Just "@" should be fine for
 # most networks. Un-comment the second line for some UnrealIRCds.
 
 set opchars "@"
 #set opchars "@&~"

Read those comments.
Sounds like your problem, eh?
In other words, right now your bot doesn't recognize the & as being op or greater.
So, make the change there in eggdrop.conf , and .rehash the bot.

Now do:
.channel #chanName
again. This time, on the bot's line, does the bot appear with @ ? I bet it does.
Don't worry that it is not & appearing. This is normal. The point is: now the bot sees itself as op'd. ( @ ) :)

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 !
w
willyw
Revered One
Posts: 1196
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

crymsun wrote:Update... downgraded the bot to regular op.. that helped with backend/dcc commands... but no matter what we do, the bot replies with that "botisop" statement:

"Auggghh! I can't do de-voicing because DsPbot isn't op'd in #Channel right now. :( "
What network are you on with the bot? I'll meet you there right now.

I only tested briefly, and it worked fine for me. (Forgot which network...I'd have to go look. )
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
c
crymsun
Voice
Posts: 33
Joined: Tue Nov 13, 2018 8:24 pm

Post by crymsun »

Totally works now!!! Thank you :)

It was the config file... working beautifully... thank you SO much!
Post Reply