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 

OpList with Chanserv
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Mabus4444
Halfop


Joined: 30 Oct 2006
Posts: 51

PostPosted: Mon Feb 14, 2011 3:11 pm    Post subject: OpList with Chanserv Reply with quote

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?
_________________
http://www.dalnetdebates.com/
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Wed Feb 16, 2011 8:53 am    Post subject: Reply with quote

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 Smile
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Mabus4444
Halfop


Joined: 30 Oct 2006
Posts: 51

PostPosted: Wed Feb 16, 2011 5:02 pm    Post subject: Reply with quote

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.
_________________
http://www.dalnetdebates.com/
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Wed Feb 16, 2011 5:43 pm    Post subject: Reply with quote

kewl Smile what about the output from ChanServ when you do
Code:
/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 Smile only need the first nickname too, not the whole list
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Mabus4444
Halfop


Joined: 30 Oct 2006
Posts: 51

PostPosted: Wed Feb 16, 2011 6:10 pm    Post subject: Reply with quote

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.
_________________
http://www.dalnetdebates.com/
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Sat Feb 19, 2011 3:44 am    Post subject: Reply with quote

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:
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:
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:
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:
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 Razz and therfor have to request it all again)

http://tcl.pastebin.com/Kv0DGnsM (hopefully the link should work)
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Mabus4444
Halfop


Joined: 30 Oct 2006
Posts: 51

PostPosted: Sat Feb 19, 2011 12:38 pm    Post subject: Reply with quote

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?
_________________
http://www.dalnetdebates.com/
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Sat Feb 19, 2011 3:56 pm    Post subject: Reply with quote

Quote:
I am not getting any error messages at all, it simply does not seem to react to the trigger. Here are my binds;
Embarassed I'll take a look at it! Smile thanks to sum great tips from @nml375 will rework one of procs i used.
Quote:
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 Very Happy sounds like it would be better too Wink
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Mabus4444
Halfop


Joined: 30 Oct 2006
Posts: 51

PostPosted: Sat Feb 19, 2011 4:43 pm    Post subject: Reply with quote

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.
_________________
http://www.dalnetdebates.com/
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Sat Feb 19, 2011 9:47 pm    Post subject: Reply with quote

Quote:
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. Cool 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) Very Happy
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Mabus4444
Halfop


Joined: 30 Oct 2006
Posts: 51

PostPosted: Sun Feb 20, 2011 1:07 pm    Post subject: Reply with quote

Think I found a bug Smile

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 Smile
_________________
http://www.dalnetdebates.com/
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Sun Feb 20, 2011 1:27 pm    Post subject: Reply with quote

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. Smile let us know how u get on
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Mabus4444
Halfop


Joined: 30 Oct 2006
Posts: 51

PostPosted: Sun Feb 20, 2011 4:11 pm    Post subject: Reply with quote

It's definately coming along nicely Smile

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
_________________
http://www.dalnetdebates.com/
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Sun Feb 20, 2011 4:35 pm    Post subject: Reply with quote

Code:
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 Smile sorry, will do that also.

Code:
<@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.
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Mabus4444
Halfop


Joined: 30 Oct 2006
Posts: 51

PostPosted: Sun Feb 20, 2011 5:46 pm    Post subject: Reply with quote

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 Smile
_________________
http://www.dalnetdebates.com/
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
Goto page 1, 2  Next
Page 1 of 2

 
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