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 Oper

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
T
TheDevil
Voice
Posts: 8
Joined: Sat Mar 29, 2008 7:56 am

Auto Oper

Post by TheDevil »

I want a script so that when the bot connects to the network it will..

Oper up using a nick and password specified in the script.
Identify to nickserv (Using /msg nickserv identify password)
and finally set mode H on its self.

So that it hides its Oper status.

I want to make a voice bot that doesnt need channel operator status.

Thanks
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

Code: Select all

# This is a Tcl script to be run immediately after connecting to a server.
bind evnt - init-server evnt:init_server

proc evnt:init_server {type} {
  global botnick
  putquick "PRIVMSG NickServ :identify <password>"
  putquick "MODE $botnick +i-ws"
}
this is found in your conf file, alter it to suit your needs
T
TheDevil
Voice
Posts: 8
Joined: Sat Mar 29, 2008 7:56 am

Post by TheDevil »

YooHoo wrote:

Code: Select all

# This is a Tcl script to be run immediately after connecting to a server.
bind evnt - init-server evnt:init_server

proc evnt:init_server {type} {
  global botnick
  putquick "PRIVMSG NickServ :identify <password>"
  putquick "MODE $botnick +i-ws"
}
this is found in your conf file, alter it to suit your needs
I edited this and the bot fails to identify and oper.
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

it should look similar to:

Code: Select all

bind evnt - init-server oper
proc oper {type} {
  putserv "OPER <login> <password>"
}
T
TheDevil
Voice
Posts: 8
Joined: Sat Mar 29, 2008 7:56 am

Post by TheDevil »

DragnLord wrote:it should look similar to:

Code: Select all

bind evnt - init-server oper
proc oper {type} {
  putserv "OPER <login> <password>"
}
made sure it says putserv and it still fails to oper and fails to identify to nickserv as well.
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

TheDevil wrote:
DragnLord wrote:it should look similar to:

Code: Select all

bind evnt - init-server oper
proc oper {type} {
  putserv "OPER <login> <password>"
}
made sure it says putserv and it still fails to oper and fails to identify to nickserv as well.
Then you have other problems.
Start your bot with the -nt switches.
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

it was said like three times that you have to alter the script to suit your needs, I have no idea how or to whom your bot is supposed to ask for oper status on your network without more information. To make the bot oper-up, identify to nickserv, and then finally set itself mode +H, you just need to add all the parts together in the same procedure, something like this:

Code: Select all

proc evnt:init_server {type} {
  global botnick
  putquick "PRIVMSG NickServ :identify <password>"
  putquick "PRIVMSG OperOp :login <password>
  putquick "MODE $botnick +H"
}
Now you are expected to alter this procedure to suit your needs.
T
TheDevil
Voice
Posts: 8
Joined: Sat Mar 29, 2008 7:56 am

Post by TheDevil »

YooHoo wrote:it was said like three times that you have to alter the script to suit your needs, I have no idea how or to whom your bot is supposed to ask for oper status on your network without more information. To make the bot oper-up, identify to nickserv, and then finally set itself mode +H, you just need to add all the parts together in the same procedure, something like this:

Code: Select all

proc evnt:init_server {type} {
  global botnick
  putquick "PRIVMSG NickServ :identify <password>"
  putquick "PRIVMSG OperOp :login <password>
  putquick "MODE $botnick +H"
}
Now you are expected to alter this procedure to suit your needs.
to oper its /oper user pass

to identify its /nickserv identify password or /msg nickserv identify password

to set mode H its /mode me +H
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Code: Select all

set oper(user) "foo"
set oper(pass) "bar"
set oper(modes) "+H"; # Must be in format +-flags
set nickserv(host) "nickserv@some.network.org"
set nickserv(pass) "foobar"
set nickserv(modes) ""; # Must be in format +-flags

bind evnt - {init-server} evnt:auto

proc evnt:auto {event} {
    global botnick oper nickserv
    if {$oper(user) != "" && $oper(pass) != ""} {
        putquick "OPER :$oper(user) $oper(pass)"
        if {$oper(modes) != ""} {
            putquick "MODE $botnick $oper(modes)"
        }
    }
    if {$nickserv(host) != "" && $nickserv(pass) != ""} {
        putquick "PRIVMSG $nickserv(host) :identify $nickserv(pass)"
        if {$nickserv(modes) != ""} {
            putquick "MODE $botnick $nickserv(modes)"
        }
    }
}
Untested!
r0t3n @ #r0t3n @ Quakenet
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

Code: Select all

proc evnt:init_server {init-server} {
  global botnick
  putquick "PRIVMSG Nickserv :identify <nick password>"
  putquick "oper <oper nick> <oper password>"
  putquick "MODE $botnick +Hi"
}
Works, tested (quite often).
R
Ron-skY
Voice
Posts: 2
Joined: Sun Mar 15, 2009 8:09 pm

re: getting an IRC oper

Post by Ron-skY »

Hi,

I've done some reading about this, but I am a little bit confused about getting an IRC Operator status for my bot as it joins the designated server.

I am using eggdrop for my own irc server (running on newest ngircd) and I've set up eggdrop.conf like this:

Code: Select all

proc evnt:init_server {type} {
  global botnick

  putquick "OPER $botnick <my_superb_password>"
  putquick "MODE <desired_channel> +o $botnick"
  putquick "MODE $botnick +Hi"
  putquick "MODE $botnick -ws"
  putquick "MODE $botnick -o"
}
Note that values in lt/gt are replaced for the purposes of thread posting. Bot is also properly set as IRC Operator in ngircd.conf.

If I understand correctly, the proper way of setting up eggdrop as channel operator is this:
1) get an IRC operator status via /OPER
2) set +o for itself on that channel
3) (possibly for more security) de-op IRC operator status (via -o)

It's possible that I am wrong, the commands you see above are derived from my experiments as regular user (so I tried to oper up, give myself +o on channel, then de-op myself again).

Anyways, auto-oping for eggdrop does not work, so if anyone can come up with anything I might be/am doing wrong, I'd more than appreciate it.
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

for an irc-operator to be able to change modes for a channel, they must use the OPMODE command instead of MODE

Also dont use botnick for your oper username, just put the entery you entered as username for the eggdrop's oper block.
r0t3n @ #r0t3n @ Quakenet
R
Ron-skY
Voice
Posts: 2
Joined: Sun Mar 15, 2009 8:09 pm

re:

Post by Ron-skY »

Thank you for your response.

I've changed the command to OPMODE, but it seems to have no effect (also my irc server does not recognize that command, when I try it as a user/IRC operator).

I replaced the botnick variable with the bot username, as you suggested, so the config now looks like this:

Code: Select all

bind evnt - init-server evnt:init_server

proc evnt:init_server {type} {
  global botnick

  putquick "OPER mybot mightypassword"
  putquick "OPMODE #somechannel +o mybot"
  putquick "MODE mybot +Hi"
  putquick "MODE mybot -ws"
  putquick "MODE mybot -o"
}
This also didn't help.

The discussed channel is persistent and in eggdrop.conf, it's set with no parametres. I hope that does not collide with anything.

Any other suggestions, where to look?

Thank you
a
ali3n0
Voice
Posts: 5
Joined: Mon Oct 25, 2010 3:02 pm

Post by ali3n0 »

Hi folks. I'm new to eggdrop and I'm playing around a bit. I've got the same environment, ngircd and eggdrop.

Actually seems that OPER works fine (at least according to ngircd logs) but I can't get the need-op function to be called after #channel join.

This works to me:
bind evnt - init-server evnt:init_server

Code: Select all

proc evnt:init_server {type} {
  global botnick
  putquick "OPER <Oper> <Pass>"
}
but not this:

Code: Select all

channel add #somechannel {
      chanmode "+nt-likm"
      need-op { putquick "MODE #somechannel +o mybotnick" }
#somechannel is correctly joined at startup though. I've tried other need-op commands, such as putserv "PRIVMSG mynick ciao", but I get no messages to mynick...
Alexander Fortin
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

ali3n0 wrote: ...
#somechannel is correctly joined at startup though. I've tried other need-op commands, such as putserv "PRIVMSG mynick ciao", but I get no messages to mynick...

I'm not familiar with ngircd.

In the partyline, try:
.chaninfo #channel
and look for a line:
<botnick> To regain op's (need-op):
<botnick> putserv "privmsg chanserv :op #channel $botnick"

You may or may not have them now.

Here is a line I use, to set the above:

Code: Select all

.chanset #channel need-op  putserv "privmsg chanserv :op #channel $botnick"
You can read a little about it with:
.help chaninfo and you'll have to find it, in the long return.
or, check here: http://www.egghelp.org/commands/channels.htm
for need-op .

Sorry that I'm don't know ngircd, to be able to give you the exact command that you'd need to set it. With some experimenting though, you should be able to get it.

I hope this helps.
Post Reply