egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

display all created users and their flags with pub or pm msg
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1145
Location: France

PostPosted: Wed Dec 29, 2021 12:15 pm    Post subject: Reply with quote

Peharps the INFO field is empty for users.

Have a look @ https://github.com/eggheads/eggdrop/blob/003b270a52db0a61c6ce17b460fe2af5f555e89c/doc/tcl-commands.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]"
_________________
Eggdrop community - French IRC network
Back to top
View user's profile Send private message Visit poster's website
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1193

PostPosted: Wed Dec 29, 2021 12:16 pm    Post subject: Reply with quote

simo wrote:
tested but it seems to output empty content


For each user, *IS* there anything to output for INFO ? Wink

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. Smile

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:
Quote:
$n - [chattr $n]"


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
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1193

PostPosted: Wed Dec 29, 2021 12:24 pm    Post subject: Reply with quote

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. Wink

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. Smile
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....

Smile
_________________
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
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Wed Dec 29, 2021 2:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1193

PostPosted: Wed Dec 29, 2021 2:50 pm    Post subject: Reply with quote

I'm glad you got something going. Smile


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 ? Wink

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.

_________________
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
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Thu Dec 30, 2021 9:52 am    Post subject: Reply with quote

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
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Thu Dec 30, 2021 10:01 am    Post subject: Reply with quote

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
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1193

PostPosted: Thu Dec 30, 2021 10:32 am    Post subject: Reply with quote

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
View user's profile Send private message
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Thu Dec 30, 2021 11:13 am    Post subject: Reply with quote

yes thats the proper date
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 831
Location: Tennessee, USA

PostPosted: Thu Dec 30, 2021 11:15 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Thu Dec 30, 2021 11:34 am    Post subject: Reply with quote

thanks Spike^^ that seems to get the proper date and time
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 831
Location: Tennessee, USA

PostPosted: Fri Dec 31, 2021 10:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
simo
Revered One


Joined: 22 Mar 2015
Posts: 1051

PostPosted: Sat Jan 01, 2022 9:07 am    Post subject: Reply with quote

excellent thanks Spike^^
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber