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.

OpList with Chanserv

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
M
Mabus4444
Halfop
Posts: 51
Joined: Mon Oct 30, 2006 7:40 pm

OpList with Chanserv

Post by Mabus4444 »

Hi there,

I was wondering if anyone is aware of any script that has a public trigger to list the ops in the channel (through chanserv). So a user for example could type;

!Opslist or !Sopslist

and the bot would then query chanserv in the channel it was typed in, and reply with the list of channel aops or sops respectively. Does that exist?
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

I think there is a few scripts, simlar to this, nothing that really works this way with services notices.

if you post what the output of these commands is? and the syntax, from /msg chanserv help <commands>
i'll take a look :)
M
Mabus4444
Halfop
Posts: 51
Joined: Mon Oct 30, 2006 7:40 pm

Post by Mabus4444 »

Yeah I've scoured the archive for something, but couldn't find anything that did this.

What I'm envisioning is something fairly simple, basically;

<+User>!Oplist
<@Bot> #Channelname - Founder: TCL_no_TK | Sops: BobA, Larry_K, Tom^, Bart | Aops: Kenny, Ladybird, Nitewings, Gary

Something simple like that, which would simply query chanserv and spit out the results. I imagine it would need to query chanserv for both the aops and sops as it seems to keep those lists seperate.

It would also be good if there was a second command, for Sops only, like !Soplist which would only list the sops.

Think such a script would probably find use on lots of bots.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

kewl :) what about the output from ChanServ when you do

Code: Select all

/msg chanserv sop #channel list
/msg chanserv aop #channel list
*please include the "End of AOP list" or "End of SOP" list if ChanServ gives it :) only need the first nickname too, not the whole list
M
Mabus4444
Halfop
Posts: 51
Joined: Mon Oct 30, 2006 7:40 pm

Post by Mabus4444 »

Let's see, when i type in the command you suggested i get an error message from chanserv saying that command is no longer supported, and to instead use /chanserv. Here's the output when I type that in (I use /cs instead of /chanserv)

/cs aop #lamers list

-
-ChanServ- AOP list for #Lamest
-
-ChanServ- 1 - EarlGrey (~Abydos@24-247.charter.com)
-
-ChanServ- End of list.
-

The SOP list is identical except that it lists the sops and uses the word SOP instead of AOP on the first line. Neither of them list the founder; For the founder, you have to type /cs info #Channel and the output there is...

-ChanServ- Info for #Lamest:
-
-ChanServ- Founder : TCL_noTK (earth@424.233-pacifica.us)

[bunch of channel info and then ends with]

-
-ChanServ- *** End of Info ***
-

It would work to just spit out the text from cs unprocessed. It would probably be cleaner (and flood the channel a lot less however) if the script could just pull out the nicks (without the masks) and put them in a line like the output I pasted earlier. So rather than 50 lines, it would be one or two listing all the ops, like;

<@Bot> #Channelname - Founder: TCL_no_TK | Sops: BobA, Larry_K, Tom^, Bart | Aops: Kenny, Ladybird, Nitewings, Gary

Otherwise it would probably seriously flood the channel.

As a side note, I'm wondering also about the size of the list, some channels probably have a lot of ops, so it may need to split the output into several lines.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Security Tip You need to add ChanServ (just chanserv) via its full address ChanServ!CS@dal.net or whatever its address is. To your eggdrop's userfile (read this for help on add users). I would recommend giving it the +f (friend) flag and possibly a custom flag i.e +S (see here for help on this). +f (friend) to prevent eggdrop from ignoring ChanServ notices, and the custom flag so only ChanServ can trigger the notc binds in the script.
-- Change

Code: Select all

bind notc -|- "*Info* for*" cs:info:notc
bind notc -|- "*SOP list for*" cs:soplist:notc
bind notc -|- "*End of list*" cs:listend:notc
bind notc -|- "*AOP list for*" cs:aoplist:notc
to

Code: Select all

bind notc fS|- "*Info* for*" cs:info:notc
bind notc fS|- "*SOP list for*" cs:soplist:notc
bind notc fS|- "*End of list*" cs:listend:notc
bind notc fS|- "*AOP list for*" cs:aoplist:notc
or just f (if have decided not to use a custom flag)
for None services security - Change the following

Code: Select all

bind pubm -|- * cs:cmd:pubm
to include a user flag. Example: (making it so only Global +o (Ops) and Channel +o (Ops) can use !opslist !soplist !aoplist)

Code: Select all

bind pubm o|o * cs:cmd:pubm
General Notes I wouldn't recommend changing the timers used in the script, Yes, it takes 3 mins per get (i.e to get channel information, SOp list and Aop list it should take over 9 mins, 3 mins each) this is to prevent services flooding and also your eggdrop from being flooded. After its got the information (i.e SOp, AOp and Chan Info) its alot faster.

Other This script dosen't keep requesting SOp, SOp and Channel Information if its already got it. (if you restart the bot, it will lose all the information for all channels :P and therfor have to request it all again)

http://tcl.pastebin.com/Kv0DGnsM (hopefully the link should work)
M
Mabus4444
Halfop
Posts: 51
Joined: Mon Oct 30, 2006 7:40 pm

Post by Mabus4444 »

The link works fine and the scripting looks awesome, but the script does not seem to work yet. Have you been able to make it work on your own bot?

I am not getting any error messages at all, it simply does not seem to react to the trigger. Here are my binds;

bind notc fS|- "*Info* for*" cs:info:notc
bind notc fS|- "*SOP list for*" cs:soplist:notc
bind notc fS|- "*End of list*" cs:listend:notc
bind notc fS|- "*AOP list for*" cs:aoplist:notc
bind pubm o|o * cs:cmd:pubm

Some random thoughts based on how you wrote it;

Since it takes a few minutes to load the data (And then relies on the loaded data from then on, and dumps the data on a reboot), how about making it so it automatically loads the data on booting up?

That way whenever someone calls for the data, it's already loaded.

Another thought would be to have it automatically reload the data whenever you add or remove a user from the bot itself. Naturally if a channel adds an op, or removes an op, they tend to also add or remove them from the bot. So that could be an opportunity to refresh the database.

Thoughts?
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

I am not getting any error messages at all, it simply does not seem to react to the trigger. Here are my binds;
:oops: I'll take a look at it! :) thanks to sum great tips from @nml375 will rework one of procs i used.
Since it takes a few minutes to load the data (And then relies on the loaded data from then on, and dumps the data on a reboot), how about making it so it automatically loads the data on booting up?

That way whenever someone calls for the data, it's already loaded.

Another thought would be to have it automatically reload the data whenever you add or remove a user from the bot itself. Naturally if a channel adds an op, or removes an op, they tend to also add or remove them from the bot. So that could be an opportunity to refresh the database.
Yeah, i wasnt sure how/if you would want a fresh copy of the /cs sop /cs aop and /cs info each time or not, was more worried about flooding services/bots. It mite make more sense for me to write to so it will update the list when it changes, if thats what your aiming for :D sounds like it would be better too :wink:
M
Mabus4444
Halfop
Posts: 51
Joined: Mon Oct 30, 2006 7:40 pm

Post by Mabus4444 »

Agreed, that does seem like the best way to go about it. There's no need to update the list every time it logs on, just whenever a user is added or removed from the bot I would think.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

for None services security
I would still recommend changing the binds as shown here. Ive tryed not to change the whole 3 minuets if it has to request new information after being called from the public channel (i.e via !opslist). But i have speeded up the information gets for when the bot first joins a channel, or when a possible user changes has been made.
Gave this a good test run on a few channels, one with a larger access list than the others, and vice versa. 8) http://tcl.pastebin.com/UUBJyq1v Oh, ive also added more verbose output, via console level 1 (you can see it via .console <#channel> +1 in dcc/telnet) :D
M
Mabus4444
Halfop
Posts: 51
Joined: Mon Oct 30, 2006 7:40 pm

Post by Mabus4444 »

Think I found a bug :)

When I tried it, I forgot to put the channel name in, putting JUST !aoplist

The result was that it IMMEDIATELY tried to get the aop list for every channel the bot is in. Services ended up placing the bot on ignore. When I did a .restart it came back online and did it again, for every channel all at once.

I'd imagine the script as written right now would result in bots which are in multiple channels being klined pretty quickly that way. Think there should be something to stagger the channels like say one every 5 minutes or something, if the channel is not specified.

It's looking awesome otherwise though :)
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

http://tcl.pastebin.com/Mmn0Jf64 Done, added more of penalty to timers now, so will take alot when getting information for multipul channels.
!oplist (or !aopslist) if you dont give a channel, it will use the current channel.
same for !soplist (!sopslist) and !aoplist (!aopslist).
I would even before loading the script just add level 1 (via .console * +1) in dcc/telnet. and watch what the bot says its doing. It will say, what triggered it to get information for all channels or what triggered it to get it from one channel. :) let us know how u get on
M
Mabus4444
Halfop
Posts: 51
Joined: Mon Oct 30, 2006 7:40 pm

Post by Mabus4444 »

It's definately coming along nicely :)

A few bugs.... but it's definately working. Here's my output with; !Oplist #Channelname

Note that there is no info in the founder field.

<@Debates> #debates - Founder: : | SOps: Godric, Shamrock, Zotnix, Ozymandias, EnglishGent, Elduran,
Debates, ragle, NiteOwl, Kiron, Fundamenta|ist
<@Debates> AOps: Cappadocia, Jarus, freethought, BlackXanthus, rylin, DragnFlye, goomba,
ProfessorWeed, joseph, Kropotkin, Shirakawasuna, TigerMatic, karstensrage
<@Debates> insomniac_cat, kokaine, napster, [Shoegazer], C`estmoi, xsnlx, Chesire_Cat_In_The_Hat,
LloydJupiter, Sardaukar, floydfp, Beauclerc, Alysa, bnyfoofoo

At this point.... something happens ...

<@Debates> Kelligirl, Info, Founder, Mode, Last, Description:, URL, Options, Memo, Registered, Last,
***, Cappadocia

After this is seems to go backwards and start repeating some of the names starting with freethought. Note, the *** are not me censoring data, that is what it outputs, so that may be a clue as to whats going wrong there.

<@Debates> freethought, BlackXanthus, rylin, DragnFlye, goomba, ProfessorWeed, joseph, Kelligirl,
Kropotkin, Shirakawasuna, insomniac_cat, karstensrage, [Shoegazer]
<@Debates> C`estmoi, xsnlx, Chesire_Cat_In_The_Hat, Sardaukar, LloydJupiter, floydfp, Beauclerc,
Alysa, bnyfoofoo, Info, Founder, Mode, Last
<@Debates> Description:, Options, Memo, Registered, Last, ***, Info, Founder, Mode, Last,
Description:, Options, Memo
<@Debates> Registered, Last, ***, Info, Founder, Mode, Description:, Options, Memo, Registered, Last,
***, Cappadocia
<@Debates> freethought, BlackXanthus, rylin, DragnFlye, goomba, ProfessorWeed, joseph, Kelligirl,
Kropotkin, Shirakawasuna, insomniac_cat, TigerMatic, karstensrage
<@Debates> napster, kokaine, [Shoegazer], C`estmoi, xsnlx, Chesire_Cat_In_The_Hat, Sardaukar,
LloydJupiter, floydfp, Beauclerc, Alysa, bnyfoofoo, Godric
<@Debates> Shamrock, Zotnix, Ozymandias, EnglishGent, Elduran, Debates, ragle, NiteOwl, Kiron,
Fundamenta|ist
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Code: Select all

Note that there is no info in the founder field.
<@Debates> #debates - Founder: : | 
The services on the network i use sent "Founder: %nick (%ident@%hostmask)" where as i think from your post Its "Founder : %nick (%ident@%hostmask)" forgot to change that back :) sorry, will do that also.

Code: Select all

<@Debates> Description:, Options, Memo, Registered, Last, ***, Info, Founder, Mode, Last,
Description:, Options, Memo
<@Debates> Registered, Last, ***, Info, Founder, Mode, Description:, Options, Memo, Registered, Last,
***,
I came across this in testing, when i reduced the time it waits before requesting something else for an other channel while its getting SOP/AOP list's, since SOP and AOP list accept pretty much everything from ChanServ as someone on that list, If eggdrop recives chanserv information for a channel. Eggdrop will think ChanServ is giving it people's nickname from an SOP/AOP list :S its PITA. but hopefully, just adding a check to stop it from requesting someone thing else, if its already doing so. But this could also depends on :arrow: did you notice if it recieved "End of List" or something like that from ChanServ at all? the way it works is:
  • @someone requests !soplist for #channel
    -> eggdrop sends Chanserv a request for the SOP #channel LIST
    ! Eggdrop binds a notice for "SOP list for #channel"
    -> Chanserv sends SOP list for #channel to eggdrop.
    ! Eggdrop then ubinds the "SOP list for channel" notice
    ! Eggdrop binds "*" all notices (since everything from ChanServ at this point should be the SOP list for the channel)
    ! Eggdrop binds "*End of List*".
    -> ChanServ sends SOP list for #channel
    ! eggdrop adds everything its reciving from chanserv to the soplist for #channel (untill it recives "End of List")
    * wait for End of list to be recived from ChanServ
    --> recived "End of list"
    ! remove the "*" bind. since we are no longer getting SOP list.
If eggdrop dosen't receive the "End of list" this would mean that every other notice from ChanServ eggdrop would think is just part of the SOP list for that channel.
M
Mabus4444
Halfop
Posts: 51
Joined: Mon Oct 30, 2006 7:40 pm

Post by Mabus4444 »

Nope I've run it again to make sure, it does not say "end of list" either on the channel nor in the console.

As for networks, thats a good point. If you will be releasing this script publicly, you may need to have a bind there that people can change depending on their network, be it efnet dalnet or unet.

Maybe a variable with a 1 2 or 3 and they can select the network they use perhaps. I testing this on Dalnet btw :)
Post Reply