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 

generate a list of users with certain flag.

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Thu Aug 21, 2008 6:59 pm    Post subject: generate a list of users with certain flag. Reply with quote

hi a lot.

have a script that put chattr +T $chan.

so, can helpme with a code for generate a list only with flags +T in my channel. (can be added an accountant of minutes?)

maybe add other proc more with this functions.

ex:
if have 3 users with flag with +T. (user1, testuser, usertest)
!list
eggdrop say via notice: there are in the chan 3 users with +T, are: User1 (20min) - testuser (2hours 7min) - usertest (45seg).

the times are for knowing how long has user with flag +T in the channel.

here paste my code.

Code:
proc pub:flags {nick uhost hand chan text} {
   global simtemop
      if {![channel get $chan simtemop]} { return }
   set cnick [lindex [split $text] 0]
      set bnick [nick2hand $cnick]
          if {([string length $text]) > 0} {
         if {([matchattr $bnick "*" $chan])} {
            if {([onchan $cnick $chan])} {
                 chattr $cnick |+T $chan
               puthelp "privmsg $chan :Enhorabuena $cnick!! ahora eres Op-Temporal."
            if {([botisop $chan])} {
               putserv "MODE $chan +v $cnick"
               puthelp "notice $cnick :Ahora eres Op-Temporal, porfavor para que veas tus comandos, escribe: !comandos."
         } else {  putserv "privmsg X :voice $chan $cnick" }
         } else {  puthelp "NOTICE $nick :$cnick no se encuentra dentro de $chan." }
         } else {  puthelp "NOTICE $nick :$cnick Ya está como Op-Temporal, quizás no tenga voice, es necesário que lo tenga." }
         } else {  puthelp "NOTICE $nick :Usa !+optemp <nick>" }
}


thanks in advance. Wink
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
eXtremer
Op


Joined: 07 May 2008
Posts: 138

PostPosted: Fri Aug 22, 2008 3:00 am    Post subject: Re: generate a list of users with certain flag. Reply with quote

Nor7on wrote:
hi a lot.

have a script that put chattr +T $chan.

so, can helpme with a code for generate a list only with flags +T in my channel. (can be added an accountant of minutes?)

maybe add other proc more with this functions.

ex:
if have 3 users with flag with +T. (user1, testuser, usertest)
!list
eggdrop say via notice: there are in the chan 3 users with +T, are: User1 (20min) - testuser (2hours 7min) - usertest (45seg).

the times are for knowing how long has user with flag +T in the channel.

here paste my code.

Code:
proc pub:flags {nick uhost hand chan text} {
   global simtemop
      if {![channel get $chan simtemop]} { return }
   set cnick [lindex [split $text] 0]
      set bnick [nick2hand $cnick]
          if {([string length $text]) > 0} {
         if {([matchattr $bnick "*" $chan])} {
            if {([onchan $cnick $chan])} {
                 chattr $cnick |+T $chan
               puthelp "privmsg $chan :Enhorabuena $cnick!! ahora eres Op-Temporal."
            if {([botisop $chan])} {
               putserv "MODE $chan +v $cnick"
               puthelp "notice $cnick :Ahora eres Op-Temporal, porfavor para que veas tus comandos, escribe: !comandos."
         } else {  putserv "privmsg X :voice $chan $cnick" }
         } else {  puthelp "NOTICE $nick :$cnick no se encuentra dentro de $chan." }
         } else {  puthelp "NOTICE $nick :$cnick Ya está como Op-Temporal, quizás no tenga voice, es necesário que lo tenga." }
         } else {  puthelp "NOTICE $nick :Usa !+optemp <nick>" }
}


thanks in advance. Wink


Usage : .userlist flags <#chan>
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri Aug 22, 2008 12:53 pm    Post subject: Reply with quote

Nor7ton:
First off, you'd have to store a timestamp with the user record whenever T is set... I'd suggest using some XTRA-field for this ("setuser handle XTRA Ttime [clock seconds]" should do the trick). This would make it trivial retrieving the timestamp later on.

For your user listing, create a list of handles using the userlist command (userlist &+T channel) and iterate through this using foreach. To generate the time, retrieve the stored timestamp (getuser handle XTRA Ttime), gather the time delta from now, and use the duration command to convert it to human readable form.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Fri Aug 22, 2008 7:04 pm    Post subject: Reply with quote

thanks nml375.

but can make the code pls.?


thanks again.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri Aug 22, 2008 7:47 pm    Post subject: Reply with quote

This is "Scripting Help", not "Script Request"...
_________________
NML_375, idling at #eggdrop@IrcNET
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 -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
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