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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Wed Dec 29, 2021 8:27 am
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"
}
}
willyw
Revered One
Posts: 1203 Joined: Thu Jan 15, 2009 12:55 am
Post
by willyw » Wed Dec 29, 2021 9:59 am
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 !
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Wed Dec 29, 2021 10:06 am
how would we get all created users and have it output with notice
willyw
Revered One
Posts: 1203 Joined: Thu Jan 15, 2009 12:55 am
Post
by willyw » Wed Dec 29, 2021 10:10 am
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 !
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Wed Dec 29, 2021 10:19 am
hm ok
from the looks of it its not optional to do that with tcl only on the partyline
willyw
Revered One
Posts: 1203 Joined: Thu Jan 15, 2009 12:55 am
Post
by willyw » Wed Dec 29, 2021 10:29 am
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 !
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Wed Dec 29, 2021 10:32 am
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
willyw
Revered One
Posts: 1203 Joined: Thu Jan 15, 2009 12:55 am
Post
by willyw » Wed Dec 29, 2021 10:47 am
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 !
CrazyCat
Revered One
Posts: 1293 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Wed Dec 29, 2021 11:12 am
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)
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Wed Dec 29, 2021 11:25 am
im not sure how to use that CrazyCat
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Wed Dec 29, 2021 11:28 am
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 }
}
CrazyCat
Revered One
Posts: 1293 Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:
Post
by CrazyCat » Wed Dec 29, 2021 11:35 am
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, ...
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Wed Dec 29, 2021 11:40 am
ok thanks
willyw
Revered One
Posts: 1203 Joined: Thu Jan 15, 2009 12:55 am
Post
by willyw » Wed Dec 29, 2021 11:50 am
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 !
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Wed Dec 29, 2021 12:01 pm
tested but it seems to output empty content