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.

display all created users and their flags with pub or pm msg

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
s
simo
Revered One
Posts: 1093
Joined: Sun Mar 22, 2015 2:41 pm

display all created users and their flags with pub or pm msg

Post by simo »

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: Select all


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"
}
}
 
w
willyw
Revered One
Posts: 1200
Joined: Thu Jan 15, 2009 12:55 am

Re: display all created users and their flags with pub or pm

Post by willyw »

simo wrote: ...

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

Code: Select all


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 !
s
simo
Revered One
Posts: 1093
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

how would we get all created users and have it output with notice
w
willyw
Revered One
Posts: 1200
Joined: Thu Jan 15, 2009 12:55 am

Re: display all created users and their flags with pub or pm

Post by willyw »

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- ... list-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- ... es-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- ... 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 !
s
simo
Revered One
Posts: 1093
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

hm ok

from the looks of it its not optional to do that with tcl only on the partyline
w
willyw
Revered One
Posts: 1200
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

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 !
s
simo
Revered One
Posts: 1093
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

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
w
willyw
Revered One
Posts: 1200
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

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: Select all

.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 !
User avatar
CrazyCat
Revered One
Posts: 1256
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Quite near of what I gave you on irc as example:

Code: Select all

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)
s
simo
Revered One
Posts: 1093
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

im not sure how to use that CrazyCat
s
simo
Revered One
Posts: 1093
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i tried this but im sure im not even close

Code: Select all


bind pub -|- !uinfo pub:userinfo


 proc pub:userinfo {nick host hand chan text} {
   foreach uhandle [userlist] { getuser $uhandle INFO }
 }
User avatar
CrazyCat
Revered One
Posts: 1256
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

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, ...
s
simo
Revered One
Posts: 1093
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

ok thanks
w
willyw
Revered One
Posts: 1200
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

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

Code: Select all


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: Select all


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 !
s
simo
Revered One
Posts: 1093
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

tested but it seems to output empty content
Post Reply