[Help] How to create multiple bot/accounts instances?
How to create multiple bots from the same "jar" file? I noticed that there's a commit for multiple bots, but no information on how to do it.
Found out..
In "bot-settings" folder, we should have a .json file with some basic initial info:
{ "name" : "bot-name", "latitude" : xx.xx, "longitude" : xx.xx, "credentials" : { "type" : "ptc", "username": "account-name", "password": "account-password" } }
After initial run, the bot will populate the json file with extra config settings.
what name should the json file have? and we should have a bot-seetings folder and the .json file should be in there, is that it?
@tristaoeast Just create a .json file with "any" name in the bot-settings folder. The bot will look for all *.json files in the bot-settings folder and use the specified information from that file.
can you post an example ?
Im not sure what you expect as example but here is my setup:
/PokemonGoBot-0.5.jar
/config.properties
/bot-settings/account1.json
/bot-settings/account1.json
The config.properties is the default one that you need to load with the bot.
I think that the account in this file is ignored if the bot finds the json files in the bot-settings dir.
A fully generated json (e.g. accoun1.json) looks like this:
{
"latitude" : XX.XX,
"longitude" : XX.XX,
"credentials" : {
"type" : "ptc",
"username" : "XXXX",
"password" : "XXXX"
},
"speed" : 2.8,
"followStreets" : false,
"dropItems" : true,
"uselessItems" : {
"ITEM_REVIVE" : 20,
"ITEM_MAX_REVIVE" : 10,
"ITEM_POTION" : 0,
"ITEM_SUPER_POTION" : 30,
"ITEM_HYPER_POTION" : 50,
"ITEM_MAX_POTION" : 50,
"ITEM_POKE_BALL" : 40,
"ITEM_GREAT_BALL" : 50,
"ITEM_ULTRA_BALL" : 50,
"ITEM_MASTER_BALL" : 10,
"ITEM_RAZZ_BERRY" : 40,
"ITEM_LUCKY_EGG" : -1,
"ITEM_INCENSE_ORDINARY" : -1,
"ITEM_TROY_DISK" : -1
},
"profileUpdateTimer" : 60,
"timerWalkToStartPokestop" : -1,
"randomNextPokestopSelection" : 5,
"desiredCatchProbability" : 0.4,
"desiredCatchProbabilityUnwanted" : 0.0,
"autotransfer" : true,
"keepPokemonAmount" : 1,
"maxPokemonAmount" : -1,
"displayKeepalive" : true,
"displayPokestopName" : false,
"displayPokestopRewards" : true,
"displayPokemonCatchRewards" : true,
"displayIfPokemonFromLure" : true,
"lootPokestop" : true,
"catchPokemon" : true,
"autoFillIncubator" : true,
"sortByIv" : false,
"alwaysCurve" : false,
"neverUseBerries" : true,
"allowLeaveStartArea" : false,
"spawnRadius" : -1,
"banSpinCount" : 0,
"transferCpThreshold" : 400,
"transferIvThreshold" : 80,
"ignoredPokemon" : [ "EEVEE", "MEWTWO", "CHARMANDER" ],
"obligatoryTransfer" : [ "DODUO", "RATTATA", "CATERPIE", "PIDGEY" ],
"export" : "",
"guiPortSocket" : 8001,
"initialMapSize" : 9,
"version" : "0.5.0"
}
(replace the XXXX with your account data and location lat/lng)
nice Tnks :)
I suggest you to name the .json file as the profil name has.
For example pogoMaster.json for username "pogoMaster", ProPlayer.json for username "ProPlayer", etc.
Exception in thread "account2" Exception in thread "account1" com.fasterxml.jackson.databind.JsonMappingException: Unexpected token (VALUE_STRING), expected FIELD_NAME: missing pro perty 'type' that is to contain type id (for class ink.abb.pogo.scraper.Credentials)
@paulohdc looks like your json structure is not valid
i copy your example and replace the XXXX with your account data and location lat/lng Exception in thread "account1" com.fasterxml.jackson.databind.JsonMappingException: Unexpected character ('}' (code 125)): was expecting a colon to separate field name and value
@paulohdc but apparently it doesn't work ;) Paste your config here and maybe a more detailed error log so we can help you!
i figured out !!! tnks again !!
it doesn't work for me, i copied the config file and i put it in a json type but when i lauchned the bot, it shows :
Exception in thread "caco" com.fasterxml.jackson.core.JsonParseException: Unexpected character ('#' (code 35)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [Source: /Users/jcmasset/Desktop/Alex/PokemonGoBot-Alex/./bot-settings/caco.json; line: 1, column: 2] at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1702) at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:558) at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:456) at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2686) at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:878) at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:772) at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3825) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3774) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2731) at ink.abb.pogo.scraper.services.BotService.load(BotService.kt:65) at ink.abb.pogo.scraper.PokemonGoBotApplication$BotRunner$run$$inlined$forEach$lambda$1.invoke(PokemonGoBotApplication.kt:62) at ink.abb.pogo.scraper.PokemonGoBotApplication$BotRunner$run$$inlined$forEach$lambda$1.invoke(PokemonGoBotApplication.kt:46) at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:18)
@Onelir13 It seems that you have an # in your config that doesn't belong there. If you can not get it to run by yourself paste your config here and i'll have a look
ir is not working for me, it gives me the following: 08 ago 18:04:51 (ratchet623): Logging in to game server... Please go to https://accounts.google.com/o/oauth2/auth?client_id=848232511240-73ri3t7plvk96pj4f85uj8otdat2alem.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=openid%20email%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email Enter authorisation code: D/GoogleUserCredentialProvider: 0Exception in thread "ratchet623" java.lang.IllegalStateException: provider.refreshToken must not be null D/GoogleUserCredentialProvider: Got token: null at ink.abb.pogo.scraper.MainKt.getAuth(Main.kt:43) Refresh token:null at ink.abb.pogo.scraper.MainKt.startBot(Main.kt:100) at ink.abb.pogo.scraper.MainKt.startBot$default(Main.kt:89) at ink.abb.pogo.scraper.services.BotService.submitBot(BotService.kt:39) at ink.abb.pogo.scraper.PokemonGoBotApplication$BotRunner$run$$inlined$forEach$lambda$1.invoke(PokemonGoBotApplication.kt:62) at ink.abb.pogo.scraper.PokemonGoBotApplication$BotRunner$run$$inlined$forEach$lambda$1.invoke(PokemonGoBotApplication.kt:46) at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:18) 08 ago 18:04:52 (ratchet623): Setting Google refresh token in your config
@effem Here's my config i put in "bot settings" folder and i had to delete the spaces between the "#" and the first word of the line otherwise everything would have been bold
#PTC/Google login credentials username=
#Choose plaintext or base64'd password password= base64_password=
#Token to login directly token= latitude=40.7828647 longitude=-73.9675438
#Desired probability to catch Pokemon with 1 throw desired_catch_probability=0.4
#Desired probability to catch unwanted Pokemon (obligatory_transfer; low IV; low CP) #Set to -1 to not attempt catching at all desired_catch_probability_unwanted=0.0
#Number of nearest unused pokestops to randomly select #The next pokestop from (1/infinite) random_next_pokestop_selection=5
##Walking #Meters per second speed=2.8
#Should the bot follow the streets (true) or just go directly to pokestops/waypoints follow_streets=false
#Should the bot loot the pokestops (true/false) loot_pokestop=true
#Should the bot catch pokemons (true/false) catch_pokemon=true
#Should the bot auto fill incubators with eggs (true/false) auto_fill_incubator=true
##Items drop #Should the bot EVER drop items (true/false) drop_items=true
#Max number of each item that the bot should keep if "drop_items" is enabled #Use -1 in an item to never drop this specific item #The default values add up to 350 item_revive=20 item_max_revive=10 item_potion=0 item_super_potion=30 item_hyper_potion=50 item_max_potion=50 item_poke_ball=40 item_great_ball=50 item_ultra_ball=50 item_master_ball=10 item_razz_berry=40 item_lucky_egg=-1 item_incense=3 item_lure_module=5
##Extra Info #Should the bot display rewards pokestop (true/false) display_pokestop_rewards=true
#Should the bot display if it caught a pokemon from a lure (true/false) display_if_pokemon_from_lure=true
#Should the bot display rewards when catching pokemon (true/false) display_pokemon_catch_rewards=true
#Display keepalive coordinates display_keepalive=true
#Should the bot display information of where it's walking to (true/false) #This will show the name of the pokestop that it's walking to and #replace on the loot log the pokestop id for its name #WARNING: this will increase the https requests without any need. If #the servers are slow it's recommended to turn off this setting display_pokestop_name=false
##Pokemon Transfer #Should the bot auto transfer duplicate pokemon autotransfer=true
#Minimum amount of pokemon type to keep keep_pokemon_amount=1
#Maximum amount of pokemon type to keep (-1 to keep all) max_pokemon_amount=-1
#Sort by IV first instead of CP sort_by_iv=false
#Always throw curveballs always_curve=false
#Never use berries never_use_berries=false
#Allow leaving the starting area allow_leave_start_area=false
#Max distance from starting point the bot should ever go in meters #(-1: only limited by the initial pokestops (~3*3km); with allow_leave_start_area=true unlimited) spawn_radius=-1
#Number of times the pokestop should be spun to attempt softban bypass (0 to disable, 40 recommended value to work) ban_spin_count=40
#Set timer in seconds to go back to the starting pokestop (-1 disabled) timer_walk_to_start_pokestop=-1
#Set profile update timer (Default: 60) profile_update_timer=60
#Minimum IV percentage to keep a pokemon (to ignore IV: use -1) #between 0 and 100, suggested 80 transfer_iv_threshold=80
#Minimum CP to keep a pokemon (to ignore CP: use -1) transfer_cp_threshold=300
#List of pokemon you don't want to transfer regardless of CP #The names must be divided by a "," #If you want all pokemons to be transferred just leave it blank ignored_pokemon=EEVEE,MEWTWO,CHARMANDER
#List of pokemon you always want to transfer regardless of CP obligatory_transfer=DODUO,RATTATA,CATERPIE
#Port where the socketserver should listen, 0 = do not listen gui_port_socket=8001
#Export player/pokemondata on Profile Update. Options are: #empty Don't export (default) #CSV Correct USA/UK CSV format ("," as delimiter and "." as decimal separator) #DSV European CSV/DSV format (";" as delimiter and "," as decimal separator) #Use this one if your MS Excel can't handle the default CSV option export=
#Initial map size (S2 tiles) to fetch (max. 9: ~3*3km area) initial_map_size=9
#List of pokemon names #MISSINGNO #BULBASAUR #IVYSAUR #VENUSAUR #CHARMANDER #CHARMELEON #CHARIZARD #SQUIRTLE #WARTORTLE #BLASTOISE #CATERPIE #METAPOD #BUTTERFREE #WEEDLE #KAKUNA #BEEDRILL #PIDGEY #PIDGEOTTO #PIDGEOT #RATTATA #RATICATE #SPEAROW #FEAROW #EKANS #ARBOK #PIKACHU #RAICHU #SANDSHREW #SANDSLASH #NIDORAN_FEMALE #NIDORINA #NIDOQUEEN #NIDORAN_MALE #NIDORINO #NIDOKING #CLEFAIRY #CLEFABLE #VULPIX #NINETALES #JIGGLYPUFF #WIGGLYTUFF #ZUBAT #GOLBAT #ODDISH #GLOOM #VILEPLUME #PARAS #PARASECT #VENONAT #VENOMOTH #DIGLETT #DUGTRIO #MEOWTH #PERSIAN #PSYDUCK #GOLDUCK #MANKEY #PRIMEAPE #GROWLITHE #ARCANINE #POLIWAG #POLIWHIRL #POLIWRATH #ABRA #KADABRA #ALAKAZAM #MACHOP #MACHOKE #MACHAMP #BELLSPROUT #WEEPINBELL #VICTREEBEL #TENTACOOL #TENTACRUEL #GEODUDE #GRAVELER #GOLEM #PONYTA #RAPIDASH #SLOWPOKE #SLOWBRO #MAGNEMITE #MAGNETON #FARFETCHD #DODUO #DODRIO #SEEL #DEWGONG #GRIMER #MUK #SHELLDER #CLOYSTER #GASTLY #HAUNTER #GENGAR #ONIX #DROWZEE #HYPNO #KRABBY #KINGLER #VOLTORB #ELECTRODE #EXEGGCUTE #EXEGGUTOR #CUBONE #MAROWAK #HITMONLEE #HITMONCHAN #LICKITUNG #KOFFING #WEEZING #RHYHORN #RHYDON #CHANSEY #TANGELA #KANGASKHAN #HORSEA #SEADRA #GOLDEEN #SEAKING #STARYU #STARMIE #MR_MIME #SCYTHER #JYNX #ELECTABUZZ #MAGMAR #PINSIR #TAUROS #MAGIKARP #GYARADOS #LAPRAS #DITTO #EEVEE #VAPOREON #JOLTEON #FLAREON #PORYGON #OMANYTE #OMASTAR #KABUTO #KABUTOPS #AERODACTYL #SNORLAX #ARTICUNO #ZAPDOS #MOLTRES #DRATINI #DRAGONAIR #DRAGONITE #MEWTWO #26
@Onelir13 in the bot settings folder you need to use the config structure that i posted here: https://github.com/jabbink/PokemonGoBot/issues/777#issuecomment-238166925
It is different to the normal config.properties filed that lies beside you .jar file.
If you wrote the confing you mentioned in you comment this cannot work!
@PabliniBis Paste your complete config and folder structure here so i can have a look. Please also use code block for longer pastes (see here how it is done)
I believe it has something to do with the token not being specified when trying to login using a google account but I don't have a solution either...
@effem I copied the config structure you posted and now it gives me an issue like that
Exception in thread "alex" com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id 'Google' into a subtype of [simple type, class ink.abb.pogo.scraper.Credentials]: known type ids = [Credentials, google, google-auto, ptc] at [Source: /Users/jcmasset/Desktop/Alex/PokemonGoBot-Caco/./bot-settings/alex.json; line: 5, column: 14](through reference chain: ink.abb.pogo.scraper.Settings["credentials"]) at com.fasterxml.jackson.databind.exc.InvalidTypeIdException.from(InvalidTypeIdException.java:42) at com.fasterxml.jackson.databind.DeserializationContext.unknownTypeIdException(DeserializationContext.java:1441) at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownTypeId(DeserializationContext.java:1169) at com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase._handleUnknownTypeId(TypeDeserializerBase.java:287) at com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase._findDeserializer(TypeDeserializerBase.java:156) at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:112) at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:97) at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:142) at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:488) at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:511) at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:396) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1194) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:314) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:148) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3789) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2731) at ink.abb.pogo.scraper.services.BotService.load(BotService.kt:65) at ink.abb.pogo.scraper.PokemonGoBotApplication$BotRunner$run$$inlined$forEach$lambda$1.invoke(PokemonGoBotApplication.kt:62) at ink.abb.pogo.scraper.PokemonGoBotApplication$BotRunner$run$$inlined$forEach$lambda$1.invoke(PokemonGoBotApplication.kt:46) at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:18)