How to Setup NodeJS & Asshunter.js Bot on Windows OS

in #steem7 years ago (edited)

Roughly a week ago I managed to finish and share my open sourced Anti-Asshat bot which is written using NodeJS and borrows functionality from steem.js as well as node-datetime.

While many praised me for my efforts in getting the bot publicly released so users could defend themselves an the network against ill-doers it became apparent to me that for your average PC user the whole NodeJS setup as well as using NPM (node package manager) to grab the required dependencies may be a bit out of the scope of their normal usage.

I've created this short illustrated guide to help Windows PC users set up and deploy NodeJS on their systems as well as pull in any dependencies they need in the future to get themselves the ability to deploy Javascript bots to help defend STEEM right from their home desktops.

Download & Install NodeJS

This is one of the easier steps of this guide. Head on over to NodeJS.org and grab a copy that is best suited for your operating system. Generally you're best off to go with a stable version.

Once you've downloaded the NodeJS installer to your PC next step is to install it. Locate where you've put the installer and double click it and let it do it's thing. The default way it's set up should be enough for what we are using it for. Get through the installer and you'll be good.

Open Command Prompt (cmd) & Install Dependencies

For those of you who generally tend to stick to using the computer for only checking their social media and emails this might be a bit out of your comfort level. However do not fear. This stuff is super easy and once you get your feet wet you'll be fine. Depending on what version of Windows you have this step might be slightly different.. If you are having issues with it simply google "Open Command Prompt for Windows X" where X is your version of windows. Personally I have a shortcut to cmd right on my desktop bar.

If you don't have Command Prompt (cmd) on your desktop bar I suggest making a shortcut there. It makes everything way easier to run rather than having to search for the thing each and every time you wish to run a program or script. Google it if you're having problems.

Once we've got Command Prompt open we'll see the directory it's based out of. This is important because in order to easily run the asshunter.js script we must put it in the same folder as our Command Prompt looks in by default else it's just extra work. as you can see in the circled part below it very clearly shows you where the command window starts in:

The part underlined and labeled working directory is where you are going to want to take the asshunter.js file and paste it into. What this does is ensures that when you start up Command Prompt you don't have to change directories! Open file explorer and navigate to the working directory shown on your screen when you start up cmd, copying asshunter.js into it.

Going back to your Command Prompt window the next step you're going to want to do is add the dependencies steem.js as well as node-datetime to the working directory so the asshunter bot can run properly. This is done easily by typing the 2 following commands into cmd.

npm install steem -save

npm install node-datetime -save

Now with your required dependencies installed via NPM we are ready to configure our script!

Configuration & Running of Asshunter.js Bot

Now assuming you've already taken the asshunter.js script and put it into you working directory you're ready to configure it with the required information to make it run properly! What you will need is your username, posting private key and the username of the account you wish to deploy counter measures against.

After you've filled out the required info (your username, your posting private key and the name of your enemy) at the top of the file you can go to cmd and run it using the following:

node asshunter.js

If all is well it will start spitting output that looks like that same as below! With that you are now officially monitoring STEEM for the flags and comments of your target asshat and should deploy counter measures automatically when their activity is detected by the script.

To stop the script simply use ctrl+c and this will stop it from running. Good luck everyone!


Vote @klye for Witness!

https://steemit.com/~witnesses


A Proud STEEMbassador of Canada

Thank you for your votes, the opportunity and support!

Sort:  

dumb question, but wouldnt it be a lot easier to just use the minified versions of steem and date-time instead of installing node. Then you could even run it in the browser

like do something like copy and paste this

removed doesnt work:

into notepad, then edit in your hero wif and asshat, then save it as asshat.html and open it in chrome (note: im hotlinking someone elses datetime.min.js not even sure if its the right thing but you get the idea)

EDIT... i don't think datetime is working... but its not totally necessary... you could do it like this

http://pastebin.com/kkg293va

ok lets see if it works... i set my asshat to aram, one of my little bots.

Im going to use him to flag DJsonics comment and see if the bot counters it.

OK, weird it looks like its monitoring blocks in the console, but its not seeing the target asshat....

i is the mad asshatter... why can't you find my vote

Exhellent job !!
Thank you for sharing ..Follow and Up now :)

Coin Marketplace

STEEM 0.20
TRX 0.12
JST 0.029
BTC 61249.08
ETH 3397.67
USDT 1.00
SBD 2.51