egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Auto & trigger voice/devoice

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
crymsun
Voice


Joined: 13 Nov 2018
Posts: 31

PostPosted: Mon Dec 17, 2018 9:43 am    Post subject: Auto & trigger voice/devoice Reply with quote

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.
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1046

PostPosted: Mon Dec 17, 2018 2:37 pm    Post subject: Re: Auto & trigger voice/devoice Reply with quote

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


Code:

# 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 !
Back to top
View user's profile Send private message
crymsun
Voice


Joined: 13 Nov 2018
Posts: 31

PostPosted: Mon Dec 17, 2018 5:23 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
crymsun
Voice


Joined: 13 Nov 2018
Posts: 31

PostPosted: Mon Dec 17, 2018 5:51 pm    Post subject: Reply with quote

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. Sad "
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1046

PostPosted: Mon Dec 17, 2018 5:53 pm    Post subject: Reply with quote

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?
Smile

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

# 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. ( @ ) Smile

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
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1046

PostPosted: Mon Dec 17, 2018 5:56 pm    Post subject: Reply with quote

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. Sad "


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 !
Back to top
View user's profile Send private message
crymsun
Voice


Joined: 13 Nov 2018
Posts: 31

PostPosted: Mon Dec 17, 2018 6:20 pm    Post subject: Reply with quote

Totally works now!!! Thank you Smile

It was the config file... working beautifully... thank you SO much!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber