Sneaky Ninja Update: Improved accuracy & performance

in Programming & Dev3 years ago (edited)

Hey guys, hope all is well.

The latest version of Sneaky-Ninja is now available! This update includes another few bug fixes & introduces more features to increase the accuracy + performance of the bot.

Here is a full list of all changes + fixes:

  • Fixed vote weight scaling (minimum 1%)
  • Enable / Disable progress logging & added log rate(update every N blocks)
  • Fixed timeframe management for trackers 2 - 10
  • Fixed accuracy + calculations for post inspections
  • Fixed bug where some comments were inspected & not the main post
  • Killed reblog & follow features
  • Enable / Disable MINAVGPOST scaling
  • Added SKIPTAG list
  • Added SKIPVOTER list
  • Now only does author evaluations if there are voters online
  • Validate all user inputs before starting
  • Validate user(s) + key(s) before starting
  • Improved the accuracy of avg post value calculation

1.Requirements:

  • Node.js (I recommend installing the latest version of node with nvm)
  • npm
  • (optional ) pm2

2.Installation:

  • Clone this repo & cd into it
    git clone https://github.com/louis23412/sneaky-ninja-hive.git && cd sneaky-ninja-hive

  • Install dependencies
    npm install

3.Configuring variables & running the bot:

  • Open settings.json & add your account(s) + key(s)

    Single account:
    "USERLIST" : [
        ["usernameHere", "privatePostingKeyHere"]
    ]
    
    Multiple accounts:
    "USERLIST" : [
        ["usernameHere", "privatePostingKeyHere"],
        ["usernameHere", "privatePostingKeyHere"],
        ["usernameHere", "privatePostingKeyHere"]
    ]
    

    For security reasons, only use your posting key(s)!

  • Change the variables as needed:

     "GLOBALVARS" : {
         "PROGRESSLOG" : true,
         "LOGRATE" : 1,
    
         "MINREP" : 35,
         "MAXACTIVEPOSTS" : 7,
         "MAXVOTERS" : 3,
         "MINAVGPOST" : 1,
         "DOWNSCALEMINAVG" : true,
         "MAXVALUETHRESHOLD" : 2.5,
         "MINSCHEDULETIME" : 4.88,
    
         "MINRC" : 80,
         "BASEWEIGHT" : 1,
         "VPRANGESTART" : 95,
         "VPRANGESTOP" : 99,
         "VWSCALE" : true
     }
    

PROGRESSLOG : true to enable progress logging for every block inspected / false to disable
LOGRATE : the number of blocks to pass before logging progress

MINREP : the minimum reputation of the author.
MAXACTIVEPOSTS : the maximum allowed posts for the author over the last 7 days.
MAXVOTERS : the maximum number of voters allowed on the post at the time of voting.
MINAVGPOST : the minimum average post value for the author over the last 7 days.
DOWNSCALEMINAVG : true to downscale the minimum average post value needed for longer timeframes / false to disable
MAXVALUETHRESHOLD : the maximum allowed % of average value allowed on the post at the time of inspection
MINSCHEDULETIME : the minimum age a post has to be to get an upvote.

MINRC : the minimum resource credit % needed to vote. Helps to prevent RC drainage on small accounts.
BASEWEIGHT : the voting weight % used to upvote posts.
VPRANGESTART : the minimum voting power % needed to vote
VPRANGESTOP : the script will automatically try to keep voting power % at this level. Voting power can dip in between start & stop.
VWSCALE : true to enable vote weight scaling. (Formula used: base weight x average post value) / false to use only BASEWEIGHT

  • In order to prevent the upvoting of plagiarised / "bad" / unwanted content, the bot will avoid all tags & voters from the SKIPTAGS & SKIPVOTERS lists

     "SKIPTAGS" : [
         "cross-post",
         "nsfw"
     ],
    
     "SKIPVOTERS" : [
         "spaminator"
     ],
    
  • The bot should work just fine with the default RPC list provided, but if it seems a bit slow or fails, you can view the status of all active nodes here.

    "RPCLIST" : [
          "https://anyx.io",
          "https://rpc.ausbit.dev",
          "https://api.hive.blog",
          "https://api.openhive.network"
    ]
    
  • Save the config file, then run the bot
    npm start

After validating the settings & username + keys, the bot will start the block stream:

Once connected & PROGRESSLOG = true, the bot will log every block inspected + some overall stats:

Note: The HP gain in the screenshot above is from delegations received via dlease. Not actual gain at runtime.

That's all I have, for now, more updates coming soon.

--------------------------------------------------------------------------

Add me on Discord if you'd like to talk: CreepyPastaZ ψ(`∇´)ψ#1729

--------------------------------------------------------------------------