meepen / salien-bot

Steam Summer Sale 2018 "Salien" minigame bot - runs in console or browser
MIT License
417 stars 103 forks source link

possibility run few bots at sinle instance ? #108

Closed AndyShade closed 6 years ago

AndyShade commented 6 years ago

configure gettoken.json, gettoken1.json or `{"webapi_host":"https:\/\/community.steam-api.com\/","webapi_host_secure":"https:\/\/community.steam-api.com\/","token":"not real","steamid":"0","persona_name":"Meepen","success":1}

{"webapi_host":"https:\/\/community.steam-api.com\/","webapi_host_secure":"https:\/\/community.steam-api.com\/","token":"not real","steamid":"0","persona_name":Beepen","success":1} `

ghost commented 6 years ago

No, this is not possible, and really isn't worth it to implement. Just setup two different instances (two different folders) with two different gettoken.json

meepen commented 6 years ago

could possibly allow --token to have multiple tokens but it's still kind of pointless, i will see what i can do in a bit

meepen commented 6 years ago

but you can also just start two command prompts with --token <file> as well

gmmanonymus111 commented 6 years ago

Well, I replaced const gettoken = JSON.parse(fs.readFileSync(token_file, "utf8")); with const gettoken = JSON.parse(args[0]); and made a batch file with the following commands: start node headless "{\"webapi_host\":\"https:\/\/community.steam-api.com\/\",\"webapi_host_secure\":\"https:\/\/community.steam-api.com\/\",\"token\":\"XXT0k3nXX\",\"steamid\":\"01234567890123456\",\"persona_name\":\"bot1\",\"success\":1}" start node headless "{\"webapi_host\":\"https:\/\/community.steam-api.com\/\",\"webapi_host_secure\":\"https:\/\/community.steam-api.com\/\",\"token\":\"XXT0k3nXX\",\"steamid\":\"78901234567890123\",\"persona_name\":\"bot2\",\"success\":1}" ... Please note, if you have a space in your bot's persona name, you should put the gettoken string in quotes, also, don't forget to escape any other quotes

Edit: Also comment out else throw new Error(invalid command line argument ${arg});

meepen commented 6 years ago

why would you comment out that error?

gmmanonymus111 commented 6 years ago

Since your if statement filters arguments, it won't do anything with the invalid ones. If that error is not commented out, the script will simply stop after launch with my argument