View previous topic :: View next topic |
Author |
Message |
crymsun Voice
Joined: 13 Nov 2018 Posts: 31
|
Posted: Sun Mar 17, 2019 12:32 pm Post subject: User level - based on time spent |
|
|
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 |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1046
|
Posted: Sat Apr 20, 2019 1:32 am Post subject: Re: User level - based on time spent |
|
|
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.
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.  _________________ 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 |
|
 |
Dominatez Voice

Joined: 14 Jan 2019 Posts: 28 Location: United Kingdom
|
Posted: Sun Apr 21, 2019 6:19 pm Post subject: |
|
|
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 |
|
 |
|
|
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
|
|