Universal Hive Bot - DevLog - #7

avatar

Hello all users,

I am trying to improve my bot as well as this devlog every time I post it. From now I will post a dev log update every time I will publish the release to GitHub. I am trying to keep one change per branch policy.

Current latest release: 0.10.1

What's new

The theme for this update is to power dCropsboost bot to allow monitoring, voting and commenting on posts tagged with drops tag.

A lot of the changes are very tailored for my use cases but they can be changed/extended if required. Please let me know how I can improve this bot.

There is a small issue when the continuous and scheduled action does not work together very well. I need to add a little bit of asynchronous execution to improve it.

Ability to name the Action

To make logging better I have added the ability to name the action. The default name is a username so this change is optional.

{
      "name": "",
      "username": ""

Continous running mode

From now actions have two modes they can run. It is the Scheduler, where execution is controlled by CRON-like syntax and triggered by the scheduler, and continuous when will actions are executing in a forever loop.

To get the Continouse bot you have to specify the type:

{
      "username": "",
      "type": "continuous",
      "tasks": []

The default behaviour is still scheduler with a trigger every 10 minutes, but trigger should still be defined.

{
    "trigger": "0 */10 * * * *",
    "tasks": [

Read Ranked Posts

The new task is to load the 20 latest posts created with a given tag. The new kind of functionality is label it allows to load of multiple reads into various variables. The idea is top have a various task to manipulate given posts so they can be restricted in some way.

{
  "name": "read_posts",
  "parameters": {
    "tag": "dcrops",
    "label": "posts"
  }
},

Vote on posts

A new task which allows casting a vote for the given posts. It has two modes, one is to specify the weight parameter. It follows the hive way of weight where 100 is 1%. The second way is to use useVaraible. That way the value will be loaded from the variable (yes there is a way to specify variables, which is useful for templates and voting).

{
  "name": "vote_on_posts",
  "parameters": {
    "label": "posts",
    "useVaraible": true
  }
},

or

{
  "name": "vote_on_posts",
  "parameters": {
    "label": "posts",
    "weight": 1510
  }
},

Comment on posts

It simply posts a comment to a post. To make it more dynamic user needs to specify the template, and for now, templates are only GIST-hosted online.

{
  "name": "comment_on_posts",
  "parameters": {
    "label": "posts",
    "template": "posts_template"
  }
},

Loading templates

It allows the loading of the text stored in the GIST. The template is a supporting replacement for moustache syntax, that is use of curly brackets like that {{ }}. It is using variables and properties stored in the context object.
{
"name": "load_template",
"parameters": {
"templateId": "Username/>firstnumber/raw/>second number>",
"label": "posts_template"
}
},

Variables

This is an easy and quick way to share some value between various tasks.

{
  "name": "variable",
  "parameters": {
    "name": "weight",
    "value": "15.00"
  }
},

Bug fixes

fixed issue when sell token has no buy offers

Usesful links

GitHub Page
https://github.com/Assassyn/universal-hive-bot/

Release
https://github.com/Assassyn/universal-hive-bot/tree/release-0.10.1-5

Support me by voting for my witnesses
HIVE - https://vote.hive.uno/@assassyn
HiveEngine - https://votify.vercel.app/alamut-he

image.png



0
0
0.000
1 comments
avatar

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support. 
 

0
0
0.000