Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TheNeonKiwi = require './lib/TheNeonKiwi'
- interrested = ['Encounter', 'EvolvePokemon', 'CatchPokemon', 'GetInventory']
- addPokemon = true
- pokemontoevolve = 0
- cnt = 0
- server = new PokemonGoMITM port: 8090
- .addRequestHandler "*", (data, action) ->
- console.log "[<-] Request for #{action} ", data, "\n" unless action not in interrested
- false
- .addResponseHandler "*", (data, action) ->
- console.log "[->] Response for #{action} ", JSON.stringify(data, null, 4), "\n" unless action not in interrested
- false
- .addResponseHandler "GetInventory", (data) ->
- cnt++
- console.log "Update number ", cnt
- if addPokemon
- console.log "Going to add Pokemon!"
- if data.inventory_delta
- if cnt > 5
- console.log "Adding candy!"
- data.inventory_delta.new_timestamp_ms += 1000000
- data.inventory_delta.inventory_items.push
- modified_timestamp_ms: data.inventory_delta.new_timestamp_ms
- inventory_item_data:
- candy: {
- family_id: "MEW"
- candy: 3
- }
- data.inventory_delta.inventory_items.push
- modified_timestamp_ms: data.inventory_delta.new_timestamp_ms
- inventory_item_data:
- candy: {
- family_id: "Pidgey"
- candy: 73
- }
- if addPokemon
- console.log "Going to add Pokemon!"
- data.inventory_delta.new_timestamp_ms += 500
- data.inventory_delta.inventory_items.push
- modified_timestamp_ms: data.inventory_delta.new_timestamp_ms
- inventory_item_data:
- pokemon_data: {
- id: pokemontoevolve
- pokemon_id: "MEWTWO"
- cp: 3299
- stamina: 714
- stamina_max: 714
- move_1: "PSYSHOCK"
- move_2: "HYPER_BEAM"
- height_m: 1.1
- weight_kg: 0.91
- captured_cell_id: 5064635525547163648
- creation_time_ms: 1469196525585
- pokeball: "ITEM_GREAT_BALL"
- individual_attack: 15
- individual_deffence: 15
- individual_stamina: 15
- cp_multiplier: 1.0
- num_upgrades: 1
- }
- data.inventory_delta.inventory_items.push
- modified_timestamp_ms: data.inventory_delta.new_timestamp_ms
- inventory_item_data:
- pokedex_entry: {
- pokemon_id: "MEW"
- times_encountered: 1
- times_captured: 1
- }
- addPokemon = false
- data
- .addRequestHandler "EvolvePokemon", (data) ->
- console.log "Trying to evolve!"
- pokemontoevolve = parseInt(data.pokemon_id)+20
- addPokemon = true
- data
- .addResponseHandler "EvolvePokemon", (data) ->
- console.log "Evolve Responce!"
- data.result = "SUCCESS"
- data.experience_awarded = 1000
- data.candy_awarded = 3
- data.evolved_pokemon_data = {
- id: pokemontoevolve
- pokemon_id: "MEWTWO"
- cp: 3299
- stamina: 714
- stamina_max: 714
- move_1: "PSYSHOCK"
- move_2: "HYPER_BEAM"
- height_m: 1.1
- weight_kg: 0.91
- captured_cell_id: "5064635525547163648"
- creation_time_ms: "1469196525585"
- pokeball: "ITEM_GREAT_BALL"
- individual_attack: 15
- individual_deffence: 15
- individual_stamina: 15
- cp_multiplier: 1.0
- num_upgrades: 1
- }
- console.log data
- data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement