def ToNPC(npc): npc = Field.FindNpc(npc) if npc.valid: if not (Character.GetPos().x < npc.x + 5 and Character.GetPos().x > npc.x - 5): SunCat.Teleport(npc.x, npc.y - 10) time.sleep(1)
def ToPortal(portal, enter=True): map = Field.GetID() portal = Field.FindPortal(portal) if portal.valid: AAFlag = False kamiFlag = False if Terminal.GetCheckBox("Auto Attack"): AAFlag = True CheckBox("Auto Attack", False) if Terminal.GetCheckBox("Kami Vac"): kamiFlag = True CheckBox("Kami Vac", False) time.sleep(1) if not (Character.GetPos().x < portal.x + 5 and Character.GetPos().x > portal.x - 5): Character.Teleport(portal.x, portal.y - 20) time.sleep(1) attempt = 0 while enter and Field.GetID() == map and attempt < 3: attempt += 1 Character.EnterPortal() time.sleep(1) if AAFlag: CheckBox("Auto Attack", True) if kamiFlag: CheckBox("Kami Vac", True)
def rushAndDo(startRush, endRush, questState, questID, npcStartID, npcEndID): if currentMap != startRush: Terminal.Rush(startRush) time.sleep(1) if currentMap == 270000000: pos = Character.GetPos() if pos.x != -2387 and pos.y != -177: Character.Teleport(-2387, -177) if currentMap == 270010111: pos = Character.GetPos() if pos.x != -493 and pos.y != -868: Character.Teleport(-493, -868) if questState == 0: # accept it time.sleep(1) Quest.StartQuest(questID, npcStartID) time.sleep(1) elif Quest.CheckCompleteDemand(questID, npcEndID) == 0: if currentMap != endRush: Terminal.Rush(endRush) time.sleep(1) Quest.CompleteQuest(questID, npcEndID)
def safe_enter_portal(): start = Character.GetPos() Character.EnterPortal() time.sleep(SLEEP_TIME) end = Character.GetPos() if close_enough(start.x, start.y, end.x, end.y, 10): Character.EnterPortal()
def toPortal(portal): # Credit to Rain for this function tPortal = Field.FindPortal(portal) if tPortal.valid: while tPortal.x != Character.GetPos().x: Character.Teleport(tPortal.x, tPortal.y) time.sleep(1) if tPortal.x == Character.GetPos().x: break Character.EnterPortal() time.sleep(2)
def RushAndComplete(completemap, questid, npcid): if Field.GetID() != completemap: Terminal.Rush(completemap) while Terminal.IsRushing(): time.sleep(1) else: if Character.GetPos().x < -800 or Character.GetPos().x > 675: Character.Teleport(-800, 153) time.sleep(2) Quest.CompleteQuest(questid, npcid) time.sleep(1)
def ToPortal(portal, enter=True): portal = Field.FindPortal(portal) if portal.valid: if not (Character.GetPos().x < portal.x+5 and Character.GetPos().x > portal.x-5): SunCat.Teleport(portal.x, portal.y-5) time.sleep(1) if enter: Character.EnterPortal() time.sleep(1) elif enter: time.sleep(1) Character.EnterPortal()
def Mine(vein): pos = Character.GetPos() while pos.x < (vein.x - 50) or pos.x > (vein.x + 50): Character.AMoveX(vein.x) pos = Character.GetPos() Character.StopMove() print("Pressing mining key") time.sleep(.25) Key.Press(0x20) time.sleep(.1) Key.Press(0x20) time.sleep(.1) Key.Press(0x20) time.sleep(4)
def to_portal(pname, enter=True): map = Field.GetID() portal = Field.FindPortal(pname) if portal.valid: if not ((portal.x-10 < Character.GetPos().x < portal.x+10)\ and (portal.y-10 < Character.GetPos().y < portal.y+15)): Character.Teleport(portal.x, portal.y-20) time.sleep(1) attempt = 0 while enter and Field.GetID() == map and attempt < 3: attempt += 1 Character.EnterPortal() time.sleep(1)
def EnterPortal(name): time.sleep(0.5) portal = Field.FindPortal(name) pos = Character.GetPos() if pos.x != portal.x: print("Portal " + str(name) + " found, teleporting...") Character.Teleport(portal.x, portal.y - 20) time.sleep(0.5) print("Teleported to portal: " + str(name) + "...") print("Trying to enter portal...") while GameState.IsInGame() and Character.GetPos().x == portal.x: if Field.GetID() == 610050000: break Character.EnterPortal() time.sleep(0.5)
def TerminalATK(flag, quest=False): if not quest: if useSI: Terminal.SetCheckBox("Skill Injection", flag) else: Terminal.SetCheckBox("Auto Attack", flag) else: Terminal.SetCheckBox("Skill Injection", False) Terminal.SetCheckBox("General FMA", False) Terminal.SetCheckBox("Full Map Attack", False) Terminal.SetCheckBox("Melee No Delay", False) Terminal.SetCheckBox("Auto Attack", flag) if useKami: Terminal.SetCheckBox("Kami Vac", flag) elif useFallLegit: Terminal.SetCheckBox("Legit Vac", flag) Terminal.SetCheckBox("Mob Falldown", flag) if flag: _left = Field.GetRect().left _right = Field.GetRect().right _mid = (_left + _right) / 2 if not (_mid - 10 < Character.GetPos().x < _mid + 10): Character.AMoveX(int(_mid)) time.sleep(walkTime)
def LeaveHorntail(): if (Field.GetID() == EntranceToHorntailsCave or Field.GetID() == CaveOfLifeEntrance or Field.GetID() == CaveOfLifeEntrance1): ToggleKami(False) ToggleHyperTeleportRock(False) if Field.GetID() == EntranceToHorntailsCave: Character.TalkToNpc(2083002) elif Field.GetID() == CaveOfLifeEntrance: if Character.GetPos().x != -335: Character.Teleport(-335, 255) else: Character.EnterPortal() elif Field.GetID() == CaveOfLifeEntrance1: if Character.GetPos().x != -206: Character.Teleport(-206, 312) else: Character.EnterPortal()
def ToMid(): sp = Field.FindPortal("sp").x down00 = Field.FindPortal("down00").x pos = Character.GetPos().x if not ((pos < sp + 5 and pos > sp - 5) or (pos < down00 + 5 and pos > down00 - 5)): ToPortal("down00", False)
def safe_teleport(x, y): toggle_attack(False) pos = Character.GetPos() if not close_enough(pos.x, pos.y, x, y, 1000): print('TOO FAR. NOT SAFE TO TELEPORT!!!') return Character.Teleport(x, y - 5) time.sleep(SLEEP_TIME)
def ToNPC(npc, talk=False): npc = Field.FindNpc(npc) if npc.valid: flag = False if Terminal.GetCheckBox("Kami Vac"): flag = True CheckBox("Kami Vac", False) time.sleep(1) if not (Character.GetPos().x < npc.x + 5 and Character.GetPos().x > npc.x - 5): Character.Teleport(npc.x, npc.y - 10) time.sleep(1) if talk: Character.TalkToNpc(npc) if flag: CheckBox("Kami Vac", True)
def rush_to_ardentmill(): if Field.GetID() != 550000000: Terminal.Rush(550000000) time.sleep(2) elif Character.GetPos().x != 2506: time.sleep(1) Character.Teleport(2506, 10) else: time.sleep(0.5) Character.EnterPortal()
def toRope(self): pos = Character.GetPos() while pos.x not in range(self.x - 75, self.x + 75): Character.AMoveX(self.x) pos = Character.GetPos() storedY = pos.y Character.StopMove() time.sleep(0.4) Character.AMoveX(self.x) Character.Jump() time.sleep(0.1) #NOT SURE IF NEEDED while pos.y > self.platform.y: Character.StopMove() Character.AMoveY(self.platform.y) pos = Character.GetPos() if pos.y == storedY: self.toRope() return Character.StopMove()
def EnterPortal(pos, enter=True): _map = Field.GetID() _portal = Field.FindPortal(pos) _char = Character.GetPos() if not (_portal.x - 10 < _char.x < _portal.x + 10) or not (_portal.y - 5 < _char.y < _portal.y + 5): Character.Teleport(_portal.x, _portal.y) time.sleep(teleportTime) if enter: Character.EnterPortal() time.sleep(teleportTime)
def MoveToNpc(id, limit=False): _npc = Field.FindNpc(id) _char = Character.GetPos() if limit: npcDistance = 2 else: npcDistance = 500 if not (_npc.x - npcDistance < _char.x < _npc.x + npcDistance): # too far i assume? test this distance Character.Teleport(_npc.x, _npc.y) time.sleep(teleportTime) time.sleep(teleportTime)
def enterDungeon(): #fieldid = Field.GetID() enterDungeonFlag = True try_count = 0 while enterDungeonFlag and try_count < 6: try_count += 1 field_id_check = Field.GetID() token = dungeonSelector() print("Entering dungeon {}".format(token[1])) pos = Character.GetPos() if pos.x not in range(token[0][0] - 5, token[0][0] + 5): Character.Teleport(token[0][0], token[0][1]) time.sleep(1) Npc.ClearSelection() Character.EnterPortal() Npc.RegisterSelection(token[1]) time.sleep(1) if field_id_check != 951000000: print("Complete enterDungeon") enterDungeonFlag = False
def ToPortal(portal, enter=True, safe=False): map = Field.GetID() if safe: for char in Field.GetCharacters(): if not Terminal.IsLocalUser(char.id): return False portal = Field.FindPortal(portal) if portal.valid: AAFlag = False kamiFlag = False if Terminal.GetCheckBox("Auto Attack"): AAFlag = True CheckBox("Auto Attack", False) if Terminal.GetCheckBox("Kami Vac"): kamiFlag = True CheckBox("Kami Vac", False) time.sleep(1) if not (Character.GetPos().x < portal.x+5 and Character.GetPos().x > portal.x-5) \ or not (Character.GetPos().y < portal.y+10 and Character.GetPos().y > portal.y-10): Character.Teleport(portal.x, portal.y - 20) time.sleep(1) attempt = 0 while enter and Field.GetID() == map and attempt < 3: if (Character.GetPos().x < portal.x + 5 and Character.GetPos().x > portal.x - 5): attempt += 1 Character.EnterPortal() time.sleep(2) if AAFlag: CheckBox("Auto Attack", True) if kamiFlag: CheckBox("Kami Vac", True)
def KillHorntail(bossDifficulty): SCLib.PersistVar("HasSpawned", False) SCLib.PersistVar("NowLockedVar", False) HasSpawned = SCLib.GetVar("HasSpawned") NowLockedVar = SCLib.GetVar("NowLockedVar") SCLib.StartVars() if bossDifficulty == 0: HorntailEasy = True HorntailNormal = False HorntailChaos = False elif bossDifficulty == 1: HorntailEasy = False HorntailNormal = True HorntailChaos = False else: HorntailEasy = False HorntailNormal = False HorntailChaos = True HorntailPreQuest = Quest.GetQuestState(7313) if HorntailPreQuest == 0: print( "Horntail Prequest not started or done, Starting quest before entery" ) if Field.GetID() != CaveOfLifeEntrance1: Terminal.Rush(CaveOfLifeEntrance1) else: Quest.StartQuest(7313, 2081006) print("Horntail Prequest started") else: #ToggleKami(False) print("Doing Horntail") if HorntailEasy: print("Easy") if Field.GetID() != HorntailsCaveEasy: if Field.GetID() != TheCaveOfTrialEasy2: if Field.GetID() != TheCaveOfTrialEasy1: if Field.GetID() != EntranceToHorntailsCave: GotoHorntail() else: if not NowLockedVar: Npc.ClearSelection() Npc.RegisterSelection( "Easy Mode (Level 130 or above)") time.sleep(1) Character.TalkToNpc(2083004) time.sleep(1) else: print( "Seems like you diddnt finish your last attempt and are locked. Continueing other bosses" ) SCLib.UpdateVar("KillHorntail", False) ResetNowLockedFunction() else: NowLockedFunction() boss = Field.FindMob(HorntailsLeftHeadEasy) if boss.valid: ToggleKami(False) if Character.GetPos().x != 522: Character.Teleport(522, -40) print("Horntails left head still alive standby") else: ToggleFaceLeft(True) ToggleKami(False) if Character.GetPos().x != 840: Character.Teleport(840, -165) else: Character.EnterPortal() else: boss = Field.FindMob(HorntailsRightHeadEasy) if boss.valid: ToggleKami(False) ToggleAttack(True) if Character.GetPos().x != 9: Character.Teleport(9, -40) print("Horntails right head still alive standby") else: ToggleFaceLeft(False) ToggleKami(False) if Character.GetPos().x != -307: Character.Teleport(-307, -165) else: Character.EnterPortal() else: boss = Field.FindMob(EasyHorntail) if boss.valid: ToggleAttack(True) DidSpawn() ToggleKami(True) print("Horntail still alive Standby") else: if HasSpawned: ToggleKami(False) ToggleLoot(True) print( "Horntail Easy Is dead waiting 10 sec before continueing" ) time.sleep(10) Character.TalkToNpc(2083002) time.sleep(1) SCLib.UpdateVar("KillHorntail", False) ToggleLoot(False) ResetSpawn() ResetNowLockedFunction() else: ToggleKami(False) ToggleAttack(False) crystal = Field.FindReactor(2401300) if crystal.valid: if Character.GetPos().x != 540: Character.Teleport(540, 15) else: Character.BasicAttack() time.sleep(2) elif HorntailNormal: print("Normal") if Field.GetID() not in HorntailsCaveNormal: if Field.GetID() not in TheCaveOfTrialNormal2: if Field.GetID() not in TheCaveOfTrialNormal1: if Field.GetID() != EntranceToHorntailsCave: GotoHorntail() else: if not NowLockedVar: Npc.ClearSelection() Npc.RegisterSelection( "Normal Mode (Level 130 or above)") time.sleep(1) Character.TalkToNpc(2083004) time.sleep(1) else: print( "Seems like you diddnt finish your last attempt and are locked. Continueing other bosses" ) SCLib.UpdateVar("KillHorntail", False) ResetNowLockedFunction() else: NowLockedFunction() boss = Field.FindMob(HorntailsLeftHeadNormal) if boss.valid: ToggleKami(False) ToggleAttack(True) if Character.GetPos().x != 522: Character.Teleport(522, -40) print("Horntails left head still alive standby") else: ToggleFaceLeft(True) ToggleKami(False) if Character.GetPos().x != 840: Character.Teleport(840, -165) else: Character.EnterPortal() else: boss = Field.FindMob(HorntailsRightHeadNormal) if boss.valid: ToggleKami(False) if Character.GetPos().x != 9: Character.Teleport(9, -40) print("Horntails right head still alive standby") else: ToggleFaceLeft(False) ToggleKami(False) if Character.GetPos().x != -307: Character.Teleport(-307, -165) else: Character.EnterPortal() else: boss = Field.FindMob(NormalHorntail) if boss.valid: ToggleAttack(True) ToggleKami(True) DidSpawn() print("Horntail Normal still alive Standby") else: if HasSpawned: ToggleKami(False) ToggleLoot(True) print( "Horntail Normal Is dead waiting 10 sec before continueing" ) time.sleep(10) Character.TalkToNpc(2083002) time.sleep(1) ToggleLoot(False) SCLib.UpdateVar("KillHorntail", False) ResetSpawn() ResetNowLockedFunction() else: ToggleAttack(False) ToggleKami(False) crystal = Field.FindReactor(2401000) if crystal.valid: if Character.GetPos().x != 540: Character.Teleport(540, 15) else: Character.BasicAttack() time.sleep(2) elif HorntailChaos: print("Chaos") if Field.GetID() not in ChaosHorntailsCave: if Field.GetID() not in TheCaveOfTrialChaos2: if Field.GetID() not in TheCaveOfTrialChaos1: if Field.GetID() != EntranceToHorntailsCave: GotoHorntail() else: if not NowLockedVar: Npc.ClearSelection() Npc.RegisterSelection( "Chaos Mode (Level 135 or above)") time.sleep(1) Character.TalkToNpc(2083004) time.sleep(1) else: print( "Seems like you diddnt finish your last attempt and are locked. Continueing other bosses" ) SCLib.UpdateVar("KillHorntail", False) ResetNowLockedFunction() else: NowLockedFunction() boss = Field.FindMob(ChaosHorntailsLeftHead) if boss.valid: ToggleKami(False) ToggleAttack(True) while Character.GetPos().x not in range(500, 570): Character.AMoveX(522) print("Horntails left head still alive standby") else: ToggleFaceLeft(True) ToggleKami(False) if Character.GetPos().x != 840: Character.Teleport(840, -165) else: Character.EnterPortal() else: boss = Field.FindMob(ChaosHorntailsRightHead) if boss.valid: ToggleKami(False) ToggleAttack(True) while Character.GetPos().x not in range(-40, 40): Character.AMoveX(9) print("Horntails right head still alive standby") else: ToggleFaceLeft(False) ToggleKami(False) if Character.GetPos().x != -307: Character.Teleport(-307, -165) else: Character.EnterPortal() else: boss = Field.FindMob(ChaosHorntail) boss1 = Field.FindMob(ChaosHorntail1) boss2 = Field.FindMob(ChaosHorntail2) boss3 = Field.FindMob(ChaosHorntail3) boss4 = Field.FindMob(ChaosHorntail4) if boss.valid or boss1.valid or boss2.valid or boss3.valid or boss4.valid: ToggleAttack(True) #ToggleKami(True) DidSpawn() while Character.GetPos().x not in range(140, 220): Character.AMoveX(183) print("Horntail still alive, Standby") else: if HasSpawned: ToggleKami(False) ToggleLoot(False) #print("Horntail Is dead waiting 10 sec before continueing") print("Looting") Terminal.SetCheckBox("Auto Loot", True) MoveToXLocation(Field.GetRect().left) time.sleep(1.5) MoveToXLocation(Field.GetRect().right) time.sleep(1.5) MoveToXLocation(Field.GetRect().left) time.sleep(1.5) MoveToXLocation(Field.GetRect().right) time.sleep(1.5) MoveToXLocation(Field.GetRect().left) time.sleep(1.5) #time.sleep(10) Character.TalkToNpc(2083002) time.sleep(1) SCLib.UpdateVar("KillHorntail", False) ToggleLoot(False) ResetSpawn() ResetNowLockedFunction() else: ToggleAttack(False) ToggleKami(False) crystal = Field.FindReactor(2401100) if crystal.valid: if Character.GetPos().x != 540: Character.Teleport(540, 15) else: Character.BasicAttack() time.sleep(2)
def MoveToXLocation(xPos): while Character.GetPos().x not in range(xPos - 60, xPos + 60): Character.AMoveX(xPos)
ReactorSend = 0x042E MovementSend = 0x00D5 delay = 0.01 def grabObjectID(): iPacket = Packet.WaitForRecv(ReactorRecv, 10000) if iPacket.GetRemaining() > 0: objectID = iPacket.ReadLong(4) Terminal.SetProperty(str(GameState.GetChannel()), objectID) def blubBlub(): oPacket = Packet.COutPacket(ReactorSend) oPacket.Encode4(Terminal.GetProperty(str(GameState.GetChannel()), 0)) oPacket.Encode4(2) oPacket.Encode2(0x106) oPacket.Encode4(0) Packet.SendPacket(oPacket) while GameState.IsInGame(): if Field.GetID() == 230040420: if Terminal.GetProperty(str(GameState.GetChannel()), 0) == 0: Terminal.SetCheckBox("Jump Down Anywhere", True) if Character.GetPos().y <= 78: Character.JumpDown() time.sleep(2) Character.JumpDown() grabObjectID() else: blubBlub() time.sleep(delay) Character.AMoveX(-491)
def doMaze(targetMap): if Field.GetID() in mazeMaps: triedRoutes = [] mapRoute = [] returnRoute = [] while Field.GetID() != targetMap: if Terminal.IsRushing(): continue if GameState.IsInGame(): fgm(True) checkMap = Field.GetID() charPos = Character.GetPos() foundNext = False routeChecked = False for portal in mazePortals: # Don't go the return route if len(returnRoute) > 0: if portal == returnRoute[len(returnRoute) - 1]: print("Skipping return portal:", portal) continue nextPortal = Field.FindPortal(portal) if nextPortal.valid: # Check routes testRoute = mapRoute.copy() testRoute.append(portal) for route in triedRoutes: if testRoute == route: print("Skipping already tried portal:", portal) routeChecked = True break if routeChecked: continue if (nextPortal.x >= (charPos.x - 20) and nextPortal.x <= charPos.x + 20) and ( nextPortal.y >= (charPos.y - 20) and nextPortal.y <= charPos.y + 20): continue print("Going to portal:", portal) Character.Teleport(nextPortal.x, nextPortal.y - 10) time.sleep(enterWait) for i in range(5): Character.EnterPortal() time.sleep(0.05) time.sleep(checkWait) if Field.GetID() != checkMap: mapRoute.append(portal) print(mapRoute) foundNext = True newPos = Character.GetPos() for portal2 in mazePortals: returnPortal = Field.FindPortal(portal2) if returnPortal.valid: if (returnPortal.x >= (newPos.x - 20) and returnPortal.x <= newPos.x + 20) and ( returnPortal.y >= (newPos.y - 20) and returnPortal.y <= newPos.y + 20): returnRoute.append(portal2) break break elif Field.GetID() == 863000017: print("Disconnected from game! Exiting script...") break else: print("Disconnected from game! Exiting script...") break if not foundNext and Field.GetID() != targetMap: if len(returnRoute) > 0: if mapRoute not in triedRoutes: triedRoutes.append(mapRoute) print(triedRoutes) portal3 = returnRoute.pop() backPortal = Field.FindPortal(portal3) if backPortal.valid: print("Going back to", portal3) Character.Teleport(backPortal.x, backPortal.y - 10) time.sleep(enterWait) Character.EnterPortal() time.sleep(checkWait) mapRoute.pop() else: print("Already starting on a portal - pls don't do this") Character.EnterPortal() time.sleep(checkWait)
quest18 = Quest.GetQuestState(34116) quest19 = Quest.GetQuestState(34117) quest20 = Quest.GetQuestState(34118) quest21 = Quest.GetQuestState(34119) quest22 = Quest.GetQuestState(34120) # Fakesymbol, enter at correct place and replace FAKESYMBOLID with item ID fakesymbol = Inventory.FindItemByID(1712000) # enter ID if fakesymbol.valid: Inventory.SendChangeSlotPositionRequest(1, fakesymbol.pos, -1600, -1) # RealSymbol, enter at correct place and replace REALSYMBOLID with item ID realsymbol = Inventory.FindItemByID(1712001) # enter ID if realsymbol.valid: Inventory.SendChangeSlotPositionRequest(1, realsymbol.pos, -1600, -1) if fieldid == 450001000: time.sleep(1) if Character.GetPos().x != -338: Character.Teleport(-338, -3) if fieldid == 450001340: time.sleep(1) if Character.GetPos().x != 563: Character.Teleport(563, 177) if fieldid == 450001350: time.sleep(1) if Character.GetPos().x != 1200: Character.Teleport(1200, 177) if quest1 != 2: if quest1 == 0: if fieldid != 270010111: Terminal.Rush(270010111) else: Quest.StartQuest(1466, 2140001)
Terminal.SetCheckBox("Kami Vac", True) def spacemash(): for _ in range(0, 40): space = 0x20 Key.Down(space) time.sleep(0.1) Key.Up(space) def kamioff(): Terminal.SetCheckBox("Kami Vac", False) pos = Character.GetPos() def basecamp(): if Field.GetID() == 450007040: if pos.x != -1196 or pos.y != -395: Character.Teleport(-1196, -395) def rightmash(): for _ in range(0, 40): right = 0x27 Key.Down(right) time.sleep(0.1) Key.Up(right)
def Teleport(x, y): CheckBox("Kami Vac", False) time.sleep(1) if not (Character.GetPos().x < x + 5 and Character.GetPos().x > x - 5): Character.Teleport(x, y - 5)
Terminal.SetProperty("count", 0) if Terminal.GetProperty("danceDone", None) is None: Terminal.SetProperty("danceDone", False) if not GameState.IsInGame(): Terminal.SetProperty("count", 0) Terminal.SetProperty("danceDone", False) Terminal.SetProperty("Once", True) #print(Terminal.GetProperty("danceDone",None)) if GameState.IsInGame(): if not Terminal.GetProperty("danceDone", None): if Field.GetID() not in range(danceMap, danceMap + 20): #print("Not in dance map") if Field.GetID() == 993050000: if Character.GetPos().x != 1704: Character.Teleport(1704, 35) time.sleep(0.3) else: if Quest.GetQuestState( 16817) == 0 and Terminal.GetProperty("Once", True): Npc.ClearSelection() Npc.RegisterSelection("all") Quest.StartQuest(16817, 9062081) Terminal.SetProperty("Once", False) else: Quest.StartQuest(16827, 9062081) else: #print("Not done quest") if Quest.GetQuestState(16731) != 2: print("1")
def leave_ardentmill(): if Character.GetPos().x != 976: Character.Teleport(976, -190) else: Character.EnterPortal()