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 

display all created users and their flags with pub or pm msg
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
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Wed Dec 29, 2021 8:27 am    Post subject: display all created users and their flags with pub or pm msg Reply with quote

i was wondering if it was possible to get the info from all ceated users and their flags and such and display to the requester from either a pub cmd or via pm to the bot

i got this from somewhere and edited it but it doesnt get all info of the created users

Code:


bind pub m !stats pub_statsx

proc pub_statsx {nick host hand chan arg} {
   global botnick
   set reco 0
   foreach nick [chanlist $chan] {
      if {[nick2hand $nick $chan] != "*"} {
         lappend accessusers $nick 
         incr reco
      }
   }
 
if {[info exists accessusers]} { 
  putserv "NOTICE $nick :\037*** $chan STATS !!! ***"
   putserv "NOTICE $nick :\002\Access users: \002\ $reco - $accessusers"
}
}
 
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1193

PostPosted: Wed Dec 29, 2021 9:59 am    Post subject: Re: display all created users and their flags with pub or pm Reply with quote

simo wrote:

...

i got this from somewhere and edited it but it doesnt get all info of the created users

Code:


bind pub m !stats pub_statsx

proc pub_statsx {nick host hand chan arg} {
   global botnick
   set reco 0
   foreach nick [chanlist $chan] {
...


It's not looking at all the users in the bot's user list. It's looking at the nicks on a channel. And from them it is counting the number of nicks that do have an entry in the bot's user list.
_________________
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
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Wed Dec 29, 2021 10:06 am    Post subject: Reply with quote

how would we get all created users and have it output with notice
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1193

PostPosted: Wed Dec 29, 2021 10:10 am    Post subject: Re: display all created users and their flags with pub or pm Reply with quote

simo wrote:
i was wondering if it was possible to get the info from all ceated users and their flags
...

[/code]


Let's think about it ...

First, have a look here:
https://docs.eggheads.org/mainDocs/tcl-commands.html#userlist-flags

That looks like it will get you a list of everybody in the bot, right?

Since it is a list, you can use the foreach command on it.
https://www.tcl.tk/man/tcl8.6/TclCmd/foreach.html

So now you're going through every user in the bot, one at a time.
How about the chattr command?
https://docs.eggheads.org/mainDocs/tcl-commands.html#chattr-handle-changes-channel
If you used that on each user, you can get their current flags.

So far, so good. Smile

You did say, "all the info" though. I'm not sure just what you want to retrieve, but you can have a look at:
https://docs.eggheads.org/mainDocs/tcl-commands.html#getuser-handle-entry-type-extra-info

I haven't scrolled up and down in tcl-commands.doc, looking for what else might apply to your question. What I've said here just came to mind. Wink
You might want to look and see if there is something else in that doc that interests you.

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
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Wed Dec 29, 2021 10:19 am    Post subject: Reply with quote

hm ok

from the looks of it its not optional to do that with tcl only on the partyline
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1193

PostPosted: Wed Dec 29, 2021 10:29 am    Post subject: Reply with quote

simo wrote:
hm ok

from the looks of it its not optional to do that with tcl only on the partyline


Lost me. Sorry.
What do you mean?
_________________
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
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Wed Dec 29, 2021 10:32 am    Post subject: Reply with quote

i mean i cant display all created users on channel or pm rather than in PL with

.match * 99

provided by CrazyCat on support channel
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1193

PostPosted: Wed Dec 29, 2021 10:47 am    Post subject: Reply with quote

simo wrote:
i mean i cant display all created users on channel or pm rather than in PL with

.match * 99

provided by CrazyCat on support channel


Sure you can.

Without even creating a script file and sourcing it ... just for a quick demo, you can do:
Code:

.tcl foreach n [userlist] {putserv "privmsg #somechannel :$n - [chattr $n]" }

in the partyline.
_________________
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
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1145
Location: France

PostPosted: Wed Dec 29, 2021 11:12 am    Post subject: Reply with quote

Quite near of what I gave you on irc as example:
Code:
14:52:32 <CrazyCat> foreach uhandle [userlit] { getuser $uhandle INFO }
14:53:02 <CrazyCat> (this is just an example on how to get the INFO field for each user in the userlist)

_________________
Eggdrop community - French IRC network
Back to top
View user's profile Send private message Visit poster's website
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Wed Dec 29, 2021 11:25 am    Post subject: Reply with quote

im not sure how to use that CrazyCat
Back to top
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Wed Dec 29, 2021 11:28 am    Post subject: Reply with quote

i tried this but im sure im not even close

Code:


bind pub -|- !uinfo pub:userinfo


 proc pub:userinfo {nick host hand chan text} {
   foreach uhandle [userlist] { getuser $uhandle INFO }
 }
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1145
Location: France

PostPosted: Wed Dec 29, 2021 11:35 am    Post subject: Reply with quote

It was an example on how to use userlist

Use the code given by willyw and make some tries, look at the tcl-command.doc file, ...
_________________
Eggdrop community - French IRC network
Back to top
View user's profile Send private message Visit poster's website
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Wed Dec 29, 2021 11:40 am    Post subject: Reply with quote

ok thanks
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1193

PostPosted: Wed Dec 29, 2021 11:50 am    Post subject: Reply with quote

simo wrote:
i tried this but im sure im not even close

Code:


bind pub -|- !uinfo pub:userinfo


 proc pub:userinfo {nick host hand chan text} {
   foreach uhandle [userlist] { getuser $uhandle INFO }
 }


The getuser command returns stuff. You want to see what that stuff is.
Tell it to say it to some channel.
Or to you in pm.
Or to you in a notice.
Up to you. Smile

For example:

Code:


bind pub -|- !uinfo pub:userinfo


 proc pub:userinfo {nick host hand chan text} {
        foreach uhandle [userlist] {
                  putserv "privmsg $chan :[getuser $uhandle INFO] "
        }
 }


Untested.
Try it.
Smile
_________________
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
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Wed Dec 29, 2021 12:01 pm    Post subject: Reply with quote

tested but it seems to output empty content
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