EverWingHax Py
EverWingHax Py
EverWingHax Py
/usr/bin/env python3
from __future__ import print_function
import json
import sys
try:
from urllib.parse import urlparse, urlencode
from urllib.request import urlopen, Request
from urllib.error import HTTPError
except ImportError:
from urlparse import urlparse
from urllib import urlencode
from urllib2 import urlopen, Request, HTTPError
try:
input = raw_input
except NameError:
pass
def main():
global debug
debug = False
global profile_url
profile_url = None
global query_endpoint
query_endpoint = "http://stormcloud-146919.appspot.com/purchase/listing/?"
debug_url = "http://stormcloud-146919.appspot.com/auth/connect/?
uid=1141161145996839&"
print("""
____| \ \ /_) | |
__|\ \ / _ \ __|\ \ \ / | __ \ _` | | | _` |\ \ /
| \ \ / __/ | \ \ \ / | | | ( | ___ | ( | ` <
_____|\_/ \___|_| \_/\_/ _|_| _|\__, | _| _|\__,_| _/\_\\
|___/
by andromeduck""")
print("\n\nSTARTING HAX\n")
update_world()
acquire_characters()
acquire_sidekicks()
exit_tutorial()
print("\nHAX FINISHED\n")
if sys.platform == "win32":
raw_input("hit return to exit")
return 0
def acquire_characters():
print("\nACQUIRING CHARACTERS\n")
characters = get_item_class("character")
for character in characters:
character_name = character["model"].replace("character:", "")
if not equip_character(character):
print("WARNING: Actions on character " + character_name + " skipped due
to active quest status")
continue
def equip_character(character):
character_name = character["model"].replace("character:", "")
if "questing" in character["state"]:
return False
if character["state"] == "locked":
complete_games(2)
print("Unlocking Character " + character_name + " ", end="")
event = {"k": get_func_key("player_key")}
event["l"] = get_func_key("listing_unlock_character_" + character_name)
event["global"] = get_func_key("item_global")
event["character"] = character["key"]
submit_event(event)
characters = get_item_class("character")
character = next(character for character in characters if character["key"]
== event["character"])
print("DONE")
if character["state"] == "idle":
print("Equipping Character:" + character_name + " ", end="")
characters = get_item_class("character")
curr_character = next(character for character in characters if
character["state"] == "equipped")
event = {"k": get_func_key("player_key")}
event["l"] = get_func_key("listing_equip_character")
event["equip"] = character["key"]
if curr_character:
event["unequip"] = curr_character["key"]
submit_event(event)
print("DONE")
return True
def acquire_sidekicks():
print("\nACQUIRING SIDEKICKS\n")
sidekicks = get_item_class("sidekick")
if debug:
print("Debug Mode, deleting all dragons and running 8/20 unlock rounds")
delete_extra_sidekicks(delete_all=True)
num_rounds = 8
elif len(sidekicks) > 100:
print("Lots of dragons found, running only 12/20 unlock rounds")
for i in range(0, 4):
level_up_sidekicks()
evolve_sidekicks()
num_rounds = 12
else:
print("Unlocking dragons")
num_rounds = 20
for i in range(0, num_rounds):
print("Round " + str(i+1) + " of " + str(num_rounds) + " ", end="")
complete_games(10)
acquire_eggs("epic", 80)
acquire_dragons("legendary", 8)
print(" DONE")
if i % 4 == 0:
level_up_sidekicks()
evolve_sidekicks()
print("Evolving dragons")
for i in range(0, 4):
level_up_sidekicks()
evolve_sidekicks()
delete_extra_sidekicks()
print("\nSIDEKICKS ACQUIRED\n\n")
def level_up_sidekicks():
sidekicks = get_item_class("sidekick")
sidekicks = [sidekick for sidekick in sidekicks
if get_stat(sidekick, "xp", "value") != get_stat(sidekick, "xp",
"maximum")]
print("Leveling up " + str(len(sidekicks)) + " sidekicks")
for i in range(0, int((len(sidekicks) +1)/ 2)):
equip_sidekicks(sidekicks[i], sidekicks[len(sidekicks) - 1 - i])
complete_games(1)
print(" DONE")
def evolve_sidekicks():
sidekicks = get_item_class("sidekick")
evolution_candidates = [sidekick for sidekick in sidekicks
if get_stat(sidekick, "xp", "value") == get_stat(sidekick, "xp", "maximum")
and get_stat(sidekick, "maturity", "value") != get_stat(sidekick,
"maturity", "maximum")]
print("Attempting to Evolve " + str(len(evolution_candidates)) + " of " +
str(len(sidekicks)) + " sidekicks ", end="")
while (len(evolution_candidates)):
event = {"k": get_func_key("player_key")}
match_target = evolution_candidates[0]
evolution_candidates.remove(match_target)
if ideal_match:
evolution_candidates.remove(ideal_match)
event["l"] = get_func_key("listing_fuse_dragon_zodiac_bonus")
event["sidekick1"] = match_target["key"]
event["sidekick2"] = ideal_match["key"]
print(":", end="")
sys.stdout.flush()
else:
print(".", end="")
sys.stdout.flush()
continue
submit_event(event, update_world=False)
update_world()
print(" DONE")
def delete_extra_sidekicks(delete_all=False):
sidekicks = get_item_class("sidekick")
if delete_all:
extra_sidekicks = sidekicks
else:
extra_sidekicks = [sidekick for sidekick in sidekicks
if get_stat(sidekick, "xp", "value") != get_stat(sidekick, "xp",
"maximum")
or get_stat(sidekick, "maturity", "value") != get_stat(sidekick,
"maturity", "maximum")
or get_stat(sidekick, "zodiac_bonus", "value") != get_stat(sidekick,
"zodiac_bonus", "maximum")]
print("Deleting " + str(len(extra_sidekicks)) + " leftover sidekicks ", end="")
event = {"k": get_func_key("player_key")}
event["l"] = get_func_key("listing_sell_dragon")
for sidekick in extra_sidekicks:
event["sidekick"] = sidekick["key"]
submit_event(event, update_world=False)
print(".", end="")
sys.stdout.flush()
print(" DONE")
update_world()
sidekicks = get_item_class("sidekick")
curr_right = next((sidekick for sidekick in sidekicks if sidekick["state"] ==
"equippedRight"), None)
event = {"k": get_func_key("player_key")}
if curr_right:
event["l"] = get_func_key("listing_equip_dragon_right_swap")
event["sidekick1"] = new_right["key"]
event["sidekick2"] = curr_right["key"]
if new_right["key"] != curr_right["key"]:
submit_event(event)
else:
event["l"] = get_func_key("listing_equip_dragon_right")
event["sidekick1"] = new_right["key"]
submit_event(event)
if debug:
print("Equipped Sidekicks")
else:
print(".", end="")
sys.stdout.flush()
def complete_games(num_games):
if debug:
print("Farming " + str(num_games) + " Rounds ", end="")
sidekicks = get_item_class("sidekick")
curr_left = next((sidekick for sidekick in sidekicks if sidekick["state"] ==
"equippedLeft"), None)
curr_right = next((sidekick for sidekick in sidekicks if sidekick["state"] ==
"equippedRight"), None)
def get_func_key(key_name):
if key_name == "player_key":
return world["player"]["key"]
elif key_name == "item_global":
return next(item["key"] for item in world["player"]["inventory"] if
item["model"] == "item_global")
else:
return next(item["key"] for item in world["schema"]["listings"] if
item["name"] == key_name)
def get_item_class(type_name):
return[item for item in world["player"]["inventory"] if type_name in
item["model"]]
def update_world():
try:
global world
world = json.loads(urlopen(profile_url).read().decode('utf-8'))
return world
except Exception as error:
print("Invalid Profile URL: ", profile_url)
print(str(error))
exit(1)
if "error" in response:
if debug:
print("ERROR on query: ", query_url)
if type(response) == dict:
print(URL)
print(response["message"])
else:
print(response)
else:
print("!", end ="")
elif update_world:
response = json.loads(response)
if "wallet" in response:
world["player"]["wallet"] = response["wallet"]
if "inventory" in response:
world["player"]["inventory"] = response["inventory"]
def exit_tutorial():
if (get_item_class("token:tutorialComplete")):
return
print("\nEXITING TUTORIAL\n")
characters = get_item_class("character")
curr_character = next(character for character in characters if
character["state"] == "equipped")
event = {"k": get_func_key("player_key")}
event["l"] = get_func_key("listing_tutorial_lvl5")
event["character"] = curr_character["key"]
submit_event(event)
print("\nTUTORIAL EXITED\n")
def default_inventory():
event = {"k": get_func_key("player_key")}
event["l"] = get_func_key("listing_default_inventory")
submit_event(event)
if __name__ == "__main__":
main()