View previous topic :: View next topic |
Author |
Message |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1145 Location: France
|
|
Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1193
|
Posted: Wed Dec 29, 2021 12:16 pm Post subject: |
|
|
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-commands.html#getuser-handle-entry-type-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:
Modifying that for your current experimental script, would be something like:
Code: |
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 ! |
|
Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1193
|
Posted: Wed Dec 29, 2021 12:24 pm Post subject: |
|
|
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 ! |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1051
|
Posted: Wed Dec 29, 2021 2:36 pm Post subject: |
|
|
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 |
|
Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1193
|
Posted: Wed Dec 29, 2021 2:50 pm Post subject: |
|
|
I'm glad you got something going.
simo wrote: |
...
this one outputs blanks not sure why
putserv "privmsg $chan :[getuser $uhandle INFO] "
...
|
_________________ 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: Thu Dec 30, 2021 9:52 am Post subject: |
|
|
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 |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1051
|
Posted: Thu Dec 30, 2021 10:01 am Post subject: |
|
|
i tried this but got error: Tcl error [pub:userinfo]: expected integer but got ""
Quote: |
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 "
|
|
|
Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1193
|
Posted: Thu Dec 30, 2021 10:32 am Post subject: |
|
|
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:
Quote: |
<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 ! |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1051
|
Posted: Thu Dec 30, 2021 11:13 am Post subject: |
|
|
yes thats the proper date |
|
Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 831 Location: Tennessee, USA
|
Posted: Thu Dec 30, 2021 11:15 am Post subject: |
|
|
Code: |
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
. |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1051
|
Posted: Thu Dec 30, 2021 11:34 am Post subject: |
|
|
thanks Spike^^ that seems to get the proper date and time |
|
Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 831 Location: Tennessee, USA
|
Posted: Fri Dec 31, 2021 10:35 pm Post subject: |
|
|
Code: |
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
. |
|
Back to top |
|
 |
simo Revered One
Joined: 22 Mar 2015 Posts: 1051
|
Posted: Sat Jan 01, 2022 9:07 am Post subject: |
|
|
excellent thanks Spike^^ |
|
Back to top |
|
 |
|