So your Piston-Bot unexpectedly quit? How to automatically restart it when you sleep!

in #piston4 years ago

Assuming you start your script using the command: python3 script.py and then click enter. Well, some times the piston-bots quit unexpectedly when for example a user edit his post or you simply lose connection with the node.

Here is a quick hack to make your bot restart automatically when it crash:

Use this command instead when you start your script: while :; do python3 script.py; sleep 5; done and click enter
Now you have made an infinite loop called "while" and it will "do" your python script. When it crashes it will wait 5 seconds and "while" again and "do" your script again and again and again until you end it.

How to end the infinite loop?

You use the same CTRL+C as always, but you might have to hit it two-three times.


To automatically upvote the people I follow, I use this python-script written by: @furion and modified by @contentjunkie. You will also need to install Piston written by @xeroc - Follow the simple step-by-step instructions and you should be able to do fine even as a non-technical user.


I hope this was helpful :)

Sort:  

I only saw this after I asked you but thanks for all the help! This did wonders for me and so is everything else you helped me with! Chat with you in steemspeak radio.

Will tearing it's head off help?

only with a real light-saber @lordvader :)

I have no idea what any of this means, but you're one of my favorites on steemit. This hack seems important so I'm into it. @fyrstikken, what's the weather like in Peru these days?

Getting warmer every day, looking forward to summer :)

That's right your down by the Equator. I live in very warm central california and it always sort of miserable for a month or so. Looking forward to fall here.

Seems very basic, but will definitely save someone some time.

yes, sometimes a simple solution is better then making a big work-around. :)

What happen if you have a Black out?
or even your bot on strike?
No Choice but to restart your generator and get up to UPVOTES them yourself. Joke joke