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()
示例#2
0
def goThru(x, y):
      useKami = Terminal.GetCheckBox("Kami Vac")
      Terminal.SetCheckBox("Kami Vac",False)
      tele(x, y - 10)
      print("Going thru portal.")
      Character.EnterPortal()
      time.sleep(.5)
      Character.EnterPortal()
      time.sleep(1)
      Terminal.SetCheckBox("Kami Vac",useKami)
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()
示例#4
0
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)
示例#5
0
def takePortal(portalstr):
    portal = Field.FindPortal(portalstr)
    if portal.valid:
        Character.Teleport(portal.x, portal.y)
        time.sleep(1)
        Character.EnterPortal()
        time.sleep(1)
示例#6
0
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 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)
示例#8
0
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()
示例#9
0
def mano():
    mob = Field.FindMob(9300815)
    if mob.valid:
        Terminal.SetCheckBox("Kami Vac", True)
        Terminal.SetCheckBox("Auto Attack", True)
        Character.BasicAttack()
    if not mob.valid:
        Terminal.SetCheckBox("Kami Vac", False)
        Terminal.SetCheckBox("Auto Attack", False)
        Character.Teleport(68, 150)
        Character.EnterPortal()
示例#10
0
    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)
示例#11
0
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)
示例#12
0
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)
示例#13
0
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
示例#14
0
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)
示例#15
0
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)
示例#16
0
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)
示例#17
0
def DungeonTeleport():
    time.sleep(1)
    Key.Press(0x08)
    time.sleep(1)
    Character.EnterPortal()
    time.sleep(1)
示例#18
0
def TP_EnterPortal(x, y):
    Character.Teleport(x, y)
    time.sleep(1)
    Character.EnterPortal()
示例#19
0
def mano():
    mob = Field.FindMob(9300815)
    if mob.valid:
        Terminal.SetCheckBox("Kami Vac", True)
        Terminal.SetCheckBox("Auto Attack", True)
        Character.BasicAttack()
    if not mob.valid:
        Terminal.SetCheckBox("Kami Vac", False)
        Terminal.SetCheckBox("Auto Attack", False)
        Character.Teleport(68, 150)
        Character.EnterPortal()

if Field.GetID() == 4000011:
    Character.Teleport(1106 ,545)
    time.sleep(3)
    Character.EnterPortal()
if Field.GetID() == 4000012:
    Npc.ClearSelection()
    Npc.RegisterSelection("I don't need you, Mai! (Skip tutorial and teleport straight to town.)")
    Character.TalkToNpc(10301)
    time.sleep(5)
    
if Character.GetLevel() == 2:
    if Field.GetID() == 4000020:
        Character.Teleport(1614 ,154)
        time.sleep(5)
        Character.TalkToNpc(10304)
        time.sleep(3)
        Character.TalkToNpc(10304)
if Character.GetLevel() == 3:
    if Field.GetID() == 4000020:
示例#20
0
def leave_ardentmill():
    if Character.GetPos().x != 976:
        Character.Teleport(976, -190)
    else:
        Character.EnterPortal()