View previous topic :: View next topic |
Author |
Message |
simo Revered One
Joined: 22 Mar 2015 Posts: 1051
|
Posted: Wed Dec 29, 2021 8:27 am Post subject: display all created users and their flags with pub or pm msg |
|
|
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 |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1193
|
Posted: Wed Dec 29, 2021 9:59 am Post subject: Re: display all created users and their flags with pub or pm |
|
|
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 |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1051
|
Posted: Wed Dec 29, 2021 10:06 am Post subject: |
|
|
how would we get all created users and have it output with notice |
|
Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1193
|
Posted: Wed Dec 29, 2021 10:10 am Post subject: Re: display all created users and their flags with pub or pm |
|
|
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.
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.
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 |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1051
|
Posted: Wed Dec 29, 2021 10:19 am Post subject: |
|
|
hm ok
from the looks of it its not optional to do that with tcl only on the partyline |
|
Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1193
|
Posted: Wed Dec 29, 2021 10:29 am Post subject: |
|
|
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 |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1051
|
Posted: Wed Dec 29, 2021 10:32 am Post subject: |
|
|
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 |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1193
|
Posted: Wed Dec 29, 2021 10:47 am Post subject: |
|
|
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 |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1145 Location: France
|
Posted: Wed Dec 29, 2021 11:12 am Post subject: |
|
|
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 |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1051
|
Posted: Wed Dec 29, 2021 11:25 am Post subject: |
|
|
im not sure how to use that CrazyCat |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1051
|
Posted: Wed Dec 29, 2021 11:28 am Post subject: |
|
|
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 |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1145 Location: France
|
Posted: Wed Dec 29, 2021 11:35 am Post subject: |
|
|
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 |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1051
|
Posted: Wed Dec 29, 2021 11:40 am Post subject: |
|
|
ok thanks |
|
Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1193
|
Posted: Wed Dec 29, 2021 11:50 am Post subject: |
|
|
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.
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.
 _________________ 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 |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1051
|
Posted: Wed Dec 29, 2021 12:01 pm Post subject: |
|
|
tested but it seems to output empty content |
|
Back to top |
|
 |
|