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 

User level - based on time spent

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
crymsun
Voice


Joined: 13 Nov 2018
Posts: 31

PostPosted: Sun Mar 17, 2019 12:32 pm    Post subject: User level - based on time spent Reply with quote

I found this: http://forum.egghelp.org/viewtopic.php?t=19314&highlight=track+user and thought it was super interesting. I'd love to see if it could be modified to reflect the following:

Level 1 - achieved after user has spent X (X=1) hours in channel
Level 2 - X + 20 hours
Level 3 - X + 40 hours
Level 4 - X + 60 hours
Level 5 - X + 80 hours
... and so on

Upon entering the channel, the bot would announce:

"<nick> has earned a <level> user rating. Thank you for your commitment to <channel name>"

The purposes of the script:
- acknowledge/recognize users for the time they commit to the channel
- tracking how many are new, how many are "regulars", etc.
- provide a recognition incentive to be in channel more

I can test the code & report back quite quickly... but testing thorough functionality may take time.
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1042

PostPosted: Sat Apr 20, 2019 1:32 am    Post subject: Re: User level - based on time spent Reply with quote

crymsun wrote:
I found this: http://forum.egghelp.org/viewtopic.php?t=19314&highlight=track+user and thought it was super interesting.


Have you loaded it, tested it, and learned how to work it as -is ?
If not, do that first.
Need to be sure it works as expected, before doing any additions / modifications.
This way, you've established a known starting point.

Quote:

I'd love to see if it could be modified to reflect the following:

Level 1 - achieved after user has spent X (X=1) hours in channel
Level 2 - X + 20 hours
Level 3 - X + 40 hours
Level 4 - X + 60 hours
Level 5 - X + 80 hours
... and so on

Upon entering the channel, the bot would announce:

"<nick> has earned a <level> user rating. Thank you for your commitment to <channel name>"


Now that you have it working as expected :

Go to the bottom of the script, and add these lines

Code:


####  additions start here #######

bind join - "* *" announce_level

proc announce_level {nick uhost handle chan} {
global timespent

        if {![channel get $chan timespent]} {
                return 0
        }

         set host [lindex [split $uhost @] 1]

        if {![info exists timespent($chan,$host)]} {
                return 0
        }

        set num_seconds [lindex [split $timespent($chan,$host) ] 0 ]
        set level [expr (($num_seconds /20 ) / 3600) + 1]

        putserv "privmsg $chan :$nick has earned a \0031,15Level $level\003 user rating. Thank you for your commitment to $chan"

}

### end addtions ###
###



Quote:

I can test the code


Good. Test it. A lot. Smile
Because I have tested it only briefly.

Quote:

... ... but testing thorough functionality may take time.


Find me on irc, and I'll explain how you can fake it out, with any amount of time you want, for testing. Wink
_________________
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
Dominatez
Voice


Joined: 14 Jan 2019
Posts: 28
Location: United Kingdom

PostPosted: Sun Apr 21, 2019 6:19 pm    Post subject: Reply with quote

Works fine until you do !timespent

It returns the following.

!timespent

Dominatez - Nickname has no info on this channel

It is not returning any information for whomever does !timespent

It gives info for !timespent NICKNAME
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
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