[ECON/FUN] HeavenActivity v0.3.1 - Activity based iConomy income [1000]

Discussion in 'Inactive/Unsupported Plugins' started by Sevenos, May 5, 2011.

  1. Offline

    Sevenos

    HeavenActivity
    Track player activity and give iConomy income based on it.

    Download:
    v0.3.1 (iConomy 5): HeavenActivity.zip (including annotated config) or jar only
    v0.1-beta (iConomy 4.6): HeavenActivity.jar
    Source: GitHub

    HeavenActivity tracks the player's activity of the last minutes (default: 15) by tracking block place/break, movement, chat and command usage. Everything is configurable (points per event, delays, timeframe, notification cycle etc).
    It can give iConomy income based on activity AND player balance.

    Features:
    • Track player activity by block place/break, movement, chat and command usage
    • Extremely configurable
    • Individual activity modifiers per group/player (optional)
    • Give players iConomy income based on activity (optional)
    Commands:
    Code:
    /activity <target> - Your or <target>'s current activity ("activity.view.other" permission to show <target>'s activity)
    /activity list - Shows activity of all online players ("activity.view.list" permission)
    /activity admin <stats|reload|resetstats> - Admin commands to see stats, reload config or
     reset the stats ("activity.admin" permission)
    Dependencies:
    • iConomy 5
    • Permissions (optional, 2.7.2 - 3.1.6 should work)
    How does it work?

    The tracking is based on sequences, those sequences have a configurable length (in seconds) and a configurable max amount. By default, there are 15 sequences with a length of 60 seconds each. This results in tracked activity for the last 15 minutes. Each tracked event is added to the current sequence, the activity is the average point value of all available sequences. One sequence can have more than 100 points, but the average activity is capped at 100 points/percent.

    How does the income work?

    Let me just give the actual calculation for now, feel free to ask if you have questions (and remember +- = -):
    Code:
    base_value
    + (((ACTIVITY - target_activity) / activity_modifier) * base_value)
    + (PLAYER_BALANCE * balance_multiplier)
    Config Examples (open)

    Default: 50% activity = 100% of base_value, 1% activity = 35% of base_value, 100% activity = 135% of base_value
    target_activity: 50
    activity_modifier: 75
    Linear income: 50% activity = 50% of base_value, 1% activity = 1% of base_value, 100% activity = 100% of base_value
    target_activity: 100
    activity_modifier: 100

    Complete annotated config.yml (included in zip download) (open)

    Code:
    # The comments will be gone after first reload/disable of the plugin
    general:
        # The time (in seconds) one sequence lasts
        sequence_interval: 60
        # Multiplier for all points, if you want more activity for all activities, rise this
        point_multiplier: 1.0
        # Sequence(s) in which the income is given
        # (max_sequences % income_sequence == 0)
        income_sequence: 15
        # Sequence(s) in which the players are notified about their activity, 6 means in sequence 6, 12(, ...)
        # (max_sequences % notification_sequence == 0)
        notification_sequence: 6
        # Max sequences which are stored, default 15 * 60 = 15 minutes
        max_sequences: 15
    income:
        # iConomy income enabled?
        enabled: true
        # Minimum activity to get income
        min_activity: 1
        # Allow negative income? (e.g. because of a negative balance_multiplier)
        allow_negative: true
        # Multiplies the current balance of the players and adds/subtracts it to/from the income
        balance_multiplier: 0.0
        # How much the activity affects the income, less is more (read documentation!)
        activity_modifier: 75
        # Base income value, this is the value the players get at target_activity
        base_value: 8.0
        # Target activity for the base_value, everything above will give more income
        # everything below will give less income
        target_activity: 50
    block:
        # Enable tracking of block break/place events?
        tracking: true
        # Points per tracked broken block event
        break_points: 1.95
        # Points per tracked placed block event
        place_points: 3.75
        # Minimum delay between 2 tracked block place/break events (ms)
        delay: 950
    move:
        # Enable tracking of move events?
        tracking: true
        # Points per tracked move event
        points: 0.58
        # Minimum delay between 2 tracked move events (ms)
        delay: 1100
    chat:
        # Enable tracking of chat?
        tracking: true
        # Points per character on chat
        char_points: 0.49
        # Points per chat use (adds on the char value)
        points: 1.0
    command:
        # Enable tracking of commands?
        tracking: true
        # Points per character on commands
        char_points: 0.53
        # Points per command use (adds on the char value)
        points: 1.0
    # This tree is just used for statistic and doesn't affect anything
    stats:
        move_points: 0.0
        block_break_points: 0.0
        chat_points: 0.0
        chat_char_points: 0.0
        command_char_points: 0.0
        block_place_points: 0.0
        command_points: 0.0


    Group/Player multipliers:

    You can set individual multipliers for each group/player using the Permissions "info" node. The following example would give 20% more activity for breaking blocks and 20% less activity for chatting:
    Code:
    info:
        # prefix etc is here too
        activity:
            multiplier:
                block_break: 1.2
                block_place: 1.0
                move: 1.0
                chat_char: 0.8
                command_char: 1.0
    How it looks ingame:
    This may look spammy, but it's normally split to about 50 minutes. Messages and colors will get configurable at some point.
    [​IMG]

    Changelog:
    v0.3.1:
    • Fixed a bug which caused only one player to get income, please update if you use the income feature!
    v0.3.0:
    • Added configurable minimum activity to get income (config node income.min_activity, default: 1)
    • Added config node to (dis)allow negative income (income.allow_negative, default: true)
    • Added config nodes to disable specific trackings (e.g. move.tracking, by default all are enabled)
    • Refactored permission handling, Permissions plugin is now optional (OP always has all permissions, admin commands OP only without Permissions plugin)
    • No longer ignore every y changing move events, instead check if x and z have changed
    • Changed default config to enable income and disable balance_multiplier (0.0)
    • Added ability to log commands to console (config node general.log_commands, default: false)
    • Some refactoring
    Old versions (open)

    v0.2.0:
    • Fixed config overwrite on reload/stop and only adding most important config nodes if they aren't set (no more auto-generation of all config nodes)
    • Fixed iConomy error on startup (skipping income on startup)
    • Added permission nodes "activity.view.list" and "activity.view.other"
    • Reformatted list of online players' activity (now it's only one row for all players)
    v0.1.1:
    • Upgraded iConomy support to 5.0 (just use the "older" Version if you're still on iConomy 4.6)
    • Better method to hook into Permissions and iConomy (ServerListener)
    v0.1-beta:
    • First public release
     
    Rollese and Phaedrus like this.
  2. Offline

    jamescosten

    Looks good, i will look into using this.
    Is there a way to give rewards based on time online ?
     
  3. Offline

    Sevenos

    I've added some more information and an annotated config.yml now, this should help a bit. Still have to say this plugin was made for my server and may be a bit rough/complex, but I will try to improve it and answer all questions.

    Income based on online time isn't possible yet, but I will set this on my TODO list to add a modifier for it (though, the main job of the plugin will remain the activity tracking and basing income on that).
     
  4. Offline

    WaterFalcon

    nice. i think this will work well for me.
    good plugin so far
     
  5. Offline

    Sevenos

    I forgot, there are commands too :D (added them to OP now). Also added a little screenshot of how it looks ingame.

    Hmm this forum doesn't like my code blocks, some edits screw it up :/
    Well /activity admin can be used by OPs and players with permission "activity.admin".
     
  6. Offline

    Zenithas

    +1 diamond. I've been working on something like this myself, for my server, and you've not only beaten me to the punch, but this is a very nicely crafted mod. Kudos, and much respect.
     
  7. Offline

    Sevenos

    Thanks. Please tell me about your experiences with it when you try it ;)

    iConomy 5 version is nearly finished, just have to test and upload it.
     
  8. Offline

    Zenithas

    I will do. Server's not going to be updated a little bit, the players are in the middle of a massive stage of their latest project, and I don't feel right bullying them offline so I can get it done. I'll give you a hoi when it's on and ready.
     
  9. I'm a bit confused about what this can do. So can i say:

    If a player has mined 1000 blocks in the last 15 minutes i can give him money? But what happens 5 minutes later when he is still mining,
     
  10. Offline

    Zenithas

    It gives players income per allocated time. In other words, let's say he's still mining blocks 5 minutes later. The plugin picks up that he's still active (maybe not AS active, but still), and pays him X money into his economy account.

    When he goes AFK, the income stops.

    When he comes back, it starts again.
     
  11. Offline

    odmir

    it doesn't work for me, it starts well but when someone logs in it says "Could not pass event PLAYER_MOVE to HeavenActivity" and then the error message

    sorry, now I see why, you didn't upgrade it yet!

    edit:
    and I forgot to install permissions :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  12. Offline

    Sevenos

    The actual error message could help ;)

    And no, not yet tested the iConomy 5 version sorry.

    Version 0.1.1 is out!
    • Upgraded iConomy support to 5.0 (just use the "older" Version if you're still on iConomy 4.6)
    • Better method to hook into Permissions and iConomy (ServerListener)
    This one is also available as zip including the annotated config file.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  13. Offline

    Darkbanisher

    I like this. Will test it out sometime.
     
  14. "It gives players income per allocated time. In other words, let's say he's still mining blocks 5 minutes later. The plugin picks up that he's still active (maybe not AS active, but still), and pays him X money into his economy account.

    When he goes AFK, the income stops.

    When he comes back, it starts again."

    Bit confused but i will probably try this out once my players get off the server for a while
     
  15. Offline

    SharkWipf

    hmm, I have this installed now, and maybe it's cause it's 1.33 am now, but I can't figure out how to set this up right. Or even if this does what I want.

    The prices on my server are (probably, no idea actually) quite high. This plugin by default only gives around ~6-15 coins on my server. What I want to do is to have the reward increase not only on the active time, but also on the blocks they placed/removed. If I understand it right this plugin can do that. Then how do I increase the values gained for building/breaking blocks, without skyrocketing the activity % itself, and without giving players a very high amount of money at 1% activity? I do not want the amount to be affected by the current amount of money players have.
    What I'm asking is probably either very simple or stupid, but I'm just very tired now, and can't see the logic.

    Below my current config file, though this latest version isn't thoroughly tested yet, as people didn't like me constantly restarting the server, and I needed to go to bed... :p
    Code:
    general:
        sequence_interval: 60
        point_multiplier: 2.0
        income_sequence: 15
        notification_sequence: 16
        max_sequences: 15
    income:
        enabled: true
        balance_multiplier: 0.0
        activity_modifier: 500
        base_value: 20.0
        target_activity: 50
    block:
        break_points: 8.0
        place_points: 6.0
        delay: 950
    move:
        points: 0.58
        delay: 1100
    chat:
        char_points: 0.49
        points: 1.0
    command:
        char_points: 0.53
        points: 1.0
    stats:
        move_points: 7911.779999999168
        block_break_points: 4323.549999999823
        chat_points: 670.0
        chat_char_points: 5663.909999999992
        command_char_points: 855.4199999999985
        block_place_points: 4091.25
        command_points: 184.0
     
  16. Hmm, weird:
    Would it still work or... ?
     
  17. Offline

    Darkbanisher

    Mate everytime my server starts up the stuff in the config file acts up.
    For some reason my balance_multiplier field goes back to -2.5E-4 everytime it starts up.
    This causes me to at max get + $0.25.

    Actualy It changes when I turn it off. So when I fix the config, then start up its fine untill crash.
     
  18. Offline

    dual★moon

    Please update this plugin to NOT overwrite the config file on reload. As it is, if you make a change and reload, the changes are wiped, the plugin overwrites the updated config.
     
  19. Offline

    Cobra289

    Just make it a read-only, as of the iconomy activity problem, how would that be remedied?
     
  20. Offline

    bfanboy

    This is a cool idea and I really wanted to use it but its just too damn confusing. With default config settings my users were losing money and it seemed impossible to attain an activity level above 50%. Even so the monetary sum was around 12 dollars which is pennies in my server where the average account is $50000. I tried to mess with settings and made it easier to reach higher activity levels. Also for some reason the balance multiplier kept changing itself to 25000. A few of my users got paid a billion dollars for a 40% activity level. Also I agree with previous posts, the config resetting itself is a major pain in the ass. I will use this again when improvements are made and its more user friendly.
     
  21. Offline

    rapajara

    ummm... permissions nodes are where?

    otherwise cool but it sounds a little confusing
     
  22. Offline

    Sevenos

    Sorry guys, my internet connection was broken last days and still seems to be unstable :( Config overwrite is on top of my todo list, it writes the values from server start when you reload/stop.

    I'm not a native speaker so dare with me if my "documentation" is bad, will try to improve it.

    - You can't give income relative to single activities, the income is always determined by the overall activity
    - If you want a linear modifier (1% activity = 2% of base_value, 100% activity = 200% of base_value) set activity_modifier to 50.
    - A lower value for activity_modifier would rise the modifier even more (at activity_modifier 25 it would be 1%activity = 0,5% base_value and 100% activity = 400% base_value). So it's probably the opposite way as you thought ;)

    Looks like the income method gets called at startup, before iConomy is loaded. Do you see a message that HeavenActivity hooked into iConomy later? It should still work, it's just a "cosmetic" error.

    Will work on the overwrite ASAP. However, the YAML parser of bukkit seems to convert 0.000... to such a format, which should still work (-0.00025 is the same as -2.5E-4).

    Post your config please, there seems to be something wrong. However, some of you problems are caused by the config overwrite (already working on it).

    There is only "activity.admin" for the admin commands yet, feel free to suggest other nodes you need.
     
  23. Oh yeah lol, just after iconomy is loaded =)
    I dunno how I missed that.
     
  24. Offline

    Cobra289

    I am a major server noob lol since Sunday, how would i fix this?

    I have permissions and this worked before but stopped recently?

     
  25. Offline

    Gogosjon

    Hi, sevenos! Great Plugin, but i don't get money?
    What's the problem?
    ( Iconomy 5? )
     
  26. Offline

    Sevenos

    What did you do before it broke? Upgraded permissions or anything?

    Did you set "enabled: true" in config.yml (income tree)?

    Expect a fix for the config overwrite soon.

    @Darkbanisher @dual★moon @bfanboy @rapajara

    Version 0.2.0 is out!
    • Fixed config overwrite on reload/stop and only adding most important config nodes if they aren't set (no more auto-generation of all config nodes)
    • Fixed iConomy error on startup (skipping income on startup)
    • Added permission nodes "activity.view.list" and "activity.view.other"
    • Reformatted list of online players' activity (now it's only one row for all players)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  27. Offline

    Cobra289

    I just reset my server, i reinstalled permissions and it worked again. Sorry forgot to post back here.
     
  28. Offline

    Gogosjon

    Sorry for wasting your time! - Thanks for your help!
    ____________________

    Works great now!
     
  29. Offline

    dual★moon

    Found another bug you might want to know about. If someone has over 65k money, the income they pull turns negative. Sounds like Short Int wraparound.
     
  30. Offline

    bfanboy

    Seeing this on my server as well.
     

Share This Page