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

Post by CrazyCat »

Peharps the INFO field is empty for users.

Have a look @ https://github.com/eggheads/eggdrop/blo ... s.doc#L265 to know what does getuser.

If you can't have what you want with that, try other things as (as willyw said) putserv "PRIVMSG $nick :$handle as following global flags: [chattr $uhandle]"
w
willyw
Revered One
Posts: 1197
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

simo wrote:tested but it seems to output empty content
For each user, *IS* there anything to output for INFO ? ;)

Look up just what that INFO is, here:
https://docs.eggheads.org/mainDocs/tcl- ... extra-info

Perhaps the script is returning just what it finds ... which is nothing. :)

So go look at some user's account in bot with .whois .
Figure out how to add something to that user's INFO line. Add it. ( You can remove it later)
Test your script again.
Does it find it and report it?


To further explore and test - try other things. I mentioned this, above:
$n - [chattr $n]"
Modifying that for your current experimental script, would be something like:

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] "
                    putserv "privmsg $chan :$uhandle - [chattr $uhandle] "

                  # Experiment! you can try outputting a variety of things, here

        }
 } 

For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
w
willyw
Revered One
Posts: 1197
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

CrazyCat wrote:... try other things ...
willyw wrote: ...
To further explore and test - try other things.
...
willyw wrote: ...
Experiment!
...


Those are probably THE most important things that we've said. ;)

They apply - always. No matter what the project is.

I try to keep a spare bot running - just for playing with tcl. Because I KNOW that I'm going to make a mistake or a typo and crash it. :)
Then ... I just find the mistake, edit it, start the bot, and move on to the next mistake, until I get them all out. And re-arranging and re-coding, adding things, etc.

Fun stuff....

:)
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: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

oh nice this one seems to work well outputting user and flags

putserv "privmsg $chan :$uhandle - [chattr $uhandle] "


this one outputs blanks not sure why

putserv "privmsg $chan :[getuser $uhandle INFO] "


i will work with that thanks willyw
w
willyw
Revered One
Posts: 1197
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

I'm glad you got something going. :)

simo wrote: ...
this one outputs blanks not sure why

putserv "privmsg $chan :[getuser $uhandle INFO] "
...
willyw wrote: ...
For each user, *IS* there anything to output for INFO ? ;)

Look up just what that INFO is, here:
https://docs.eggheads.org/mainDocs/tcl- ... extra-info

Perhaps the script is returning just what it finds ... which is nothing.
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: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

nice thanks willyw that helps a lot

i managed to have this

putserv "NOTICE $nick :$uhandle - [chattr $uhandle] [getuser $uhandle HOSTS] [getuser $uhandle XTRA] "


only it outputs the time of created user in like

{created 1640809963} unlike a more readable date
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i tried this but got error: Tcl error [pub:userinfo]: expected integer but got ""

set created1 [getuser $uhandle XTRA]
set createds [string trimleft created1 "{"]
set createda [string trimright createds "}"]
set created2 [lindex [split $createda] 1]
set createdtime [clock format $created2 -format "%d.%m.%Y - %H:%M:%S"]
putserv "NOTICE $nick :$uhandle - [chattr $uhandle] [getuser $uhandle HOSTS] $createdtime "
w
willyw
Revered One
Posts: 1197
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

simo wrote: ...

only it outputs the time of created user in like

{created 1640809963} unlike a more readable date
I'm having trouble finding exactly what that is. I have a guess, but I wanted to be sure.

Maybe you can tell me.

Have a look at this:
<jack3> .tcl ctime 1640809963
<botnick> Tcl: Wed Dec 29 20:32:43 2021
Is that the correct date and time ?

If it is, then we know that [ctime] is the command that you want, and we can proceed with discussing how to apply 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: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

yes thats the proper date
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Code: Select all

set created [lindex [getuser $uhandle XTRA] 0 1]
set createdtime [clock format $created -format "%d.%m.%Y - %H:%M:%S"]
putserv "NOTICE $nick :$uhandle - [chattr $uhandle] [getuser $uhandle HOSTS] $createdtime"


That will only work if the created info is the only data in the EXTRA field.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

thanks Spike^^ that seems to get the proper date and time
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Code: Select all

set created [getuser $uhandle XTRA created]
set createdtime [clock format $created -format "%d.%m.%Y - %H:%M:%S"]
putserv "NOTICE $nick :$uhandle - [chattr $uhandle] [getuser $uhandle HOSTS] $createdtime"


I believe this is the more correct way to use the getuser XTRA command.
This method should work even if there is also other data added to the XTRA field.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
simo
Revered One
Posts: 1078
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

excellent thanks Spike^^
Post Reply