Esempio n. 1
0
def CashItemResLoadLockerDone():
    iPacket = Packet.WaitForRecv(CashItemResultOpcode, 10000)
    if iPacket.GetRemaining() > 0:
        nRes = iPacket.ReadLong(1)
        if nRes == LoadLockerDoneResult:
            bItemLockerFull = iPacket.ReadLong(1)
            if bItemLockerFull == 1:
                nOverItemCount = iPacket.ReadLong(4)
            nCashItemCount = iPacket.ReadLong(2)
            if nCashItemCount >= 0:
                bFound = False
                for i in range(0, nCashItemCount):
                    CashItemInfoDecode(iPacket)
                    if pCashItemInfo.nItemID == 5040004:
                        bFound = True
                        Terminal.SetProperty("liSN", pCashItemInfo.liSN)
                        break
                if bFound:
                    time.sleep(1)
                    CashItemInfoDecode(iPacket)
                    print("Moving", flush=True)
                    MoveLToS(Terminal.GetProperty("liSN", -1), nEmptySlotPOS)
                else:
                    BuyByMeso()
            time.sleep(2)
            Terminal.LeaveCashShop()
    else:
        Terminal.LeaveCashShop()
        ToggleRushByLevel(True)
        Terminal.StopRush()
Esempio n. 2
0
def WaitForFollow(user, startTime):
    timer = 0
    time.sleep(3)
    while (Field.GetID() != user.mapid or GameState.GetChannel() != user.channel) \
        and time.time() - startTime < timeout:
        time.sleep(1)
        timer += 1
    if Terminal.IsRushing():
        #print(Field.GetID(), user.mapid, GameState.GetChannel(), user.channel)
        if Field.GetID() != user.mapid or GameState.GetChannel(
        ) != user.channel:
            print("Failed in chasing {0} at {1} Ch{2}".format(
                user.charname, user.mapid, user.channel),
                  flush=True)
        Terminal.StopRush()
Esempio n. 3
0
def CheckQuestMap(mapid, forward=True):
    TerminalATK(False)
    _map = Field.GetID()
    momijigaoka = 807000000
    fieldmap1 = 811000001
    fieldmap2 = 811000004
    fieldmap3 = 811000006

    if _map != mapid and forward:
        if _map != momijigaoka and (_map < 811000000 or _map > 811000010):
            print("Moving to Momijigaoka")
            Terminal.Rush(momijigaoka)
        elif _map == momijigaoka:
            Terminal.StopRush()
            EnterPortal("west00")
        elif _map == fieldmap1:
            Terminal.StopRush()
            EnterPortal("out02")
        elif _map == fieldmap2:
            Terminal.StopRush()
            EnterPortal("out01")
        elif _map == fieldmap2 + 1:
            Terminal.StopRush()
            EnterPortal("out01")

    elif _map != mapid and not forward:
        if _map != momijigaoka and (_map < 811000000 or _map > 811000010):
            print("Moving to Momijigaoka")
            Terminal.Rush(momijigaoka)
        elif _map == fieldmap1:
            Terminal.StopRush()
            EnterPortal("out00")
        elif _map == fieldmap2:
            Terminal.StopRush()
            EnterPortal("out00")
        elif _map == fieldmap2 + 1:
            Terminal.StopRush()
            EnterPortal("out00")
        elif _map == fieldmap3:
            Terminal.StopRush()
            EnterPortal("out00")
Esempio n. 4
0
                                        SCLib.GetVar("HarvestAttempt") + 1)
                    else:
                        ChangeChannels()
    else:
        if HasLooted:
            ResetHarvestAttempt()
            if Terminal.GetCheckBox("Pet Item Teleport"):
                Terminal.SetCheckBox("Pet Item Teleport", False)
            else:
                if fieldID != maps[SCLib.GetVar("MapNumber")]:
                    Terminal.Rush(maps[SCLib.GetVar("MapNumber")])
                    SCLib.UpdateVar("TeleportCount", 0)
                else:
                    ChangeChannels()
                    SCLib.UpdateVar("TeleportCount", 0)
    if SCLib.GetVar("TeleportCount") >= 6:
        ResetHarvestAttempt()
        print("Reached teleporting limit")
        if Terminal.GetCheckBox("Pet Item Teleport"):
            Terminal.SetCheckBox("Pet Item Teleport", False)
        else:
            if fieldID != maps[SCLib.GetVar("MapNumber")]:
                Terminal.Rush(maps[SCLib.GetVar("MapNumber")])
                SCLib.UpdateVar("TeleportCount", 0)
            else:
                ChangeChannels()
                SCLib.UpdateVar("TeleportCount", 0)
if GameState.IsInGame() and Terminal.IsRushing():
    if fieldID == 270000200:
        Terminal.StopRush()
Esempio n. 5
0
def InitAll():
    Terminal.SetCheckBox("bot/si_no_wait", False)
    Terminal.SetCheckBox("Kami Vac", False)
    Terminal.SetCheckBox("General FMA", False)
    Terminal.SetCheckBox("Full Map Attack", False)
    Terminal.SetCheckBox("bot/kanna_kami", False)
    Terminal.SetCheckBox("Pet Item Teleport", False)

    retryCount = 0
    maxRetry = 3
    tryAgain = True

    if Field.GetID() == startingMap:
        print('Starting...')
        if Terminal.IsRushing():
            Terminal.StopRush()

        Terminal.SetCheckBox("Auto NPC", True)
        SunCat.HookChuChu()
        InitRecipes()

        if usingParty:
            if leader:
                # invite members in list
                '''
                while len(partyMembers) > len(Party.GetPartyMembers()):
                    print(partyMembers, Party.GetPartyMembers())
                    for member in partyMembers:
                        if member != Character.GetName():
                            print("inviting", member)
                            Party.InviteToParty(member)
                            time.sleep(1)
                '''
                changeChannel()

                while usingParty and not PartyReady() and tryAgain:
                    print("waiting for members")
                    time.sleep(2)
                    '''
                    for member in Party.GetPartyMembers():
                        if member.mapid == 450002000:
                            print("Done")
                            Party.KickMember(member.id)
                            tryAgain = False
                    '''
            else:
                if Party.IsInParty():
                    if not PartyReady():
                        print("Chasing leader")
                        FollowLead()
                        time.sleep(2)
                else:
                    Party.SetInviteCallback(partyInviteCallback)

        else:
            changeChannel()

        while tryAgain and Party.GetPartyBossID() == Character.GetID():
            if Field.GetID() == startingMap:
                if not Party.IsInParty():
                    Party.CreateParty()
                retryCount += 1
                time.sleep(1)

                if retryCount > maxRetry:
                    print(
                        "Failed to enter ChuChu, have you already done it 3 times? Move to next daily"
                    )
                    SCLib.UpdateVar("ChuchuDone" + CharName, True)
                    break
                Npc.ClearSelection()
                Npc.RegisterSelection("Enter <Hungry Muto>")
                if isHardMode:
                    Npc.RegisterSelection("Hard")
                else:
                    Npc.RegisterSelection("Normal")
                Character.TalkToNpc(3003166)
                time.sleep(5)

            elif Field.GetID() in hungryMutoMaps:
                print("Starting ChuChuPQ!")
                tryAgain = False
                DoChuChu()
            else:
                tryAgain = False
                print("Not in ChuChuPQ!")
                SunCat.UnhookChuChu()

    elif Field.GetID() == exitMap:
        RestoreSetting()
        SunCat.StopTP()

        Npc.ClearSelection()
        Npc.RegisterSelection("Claim")
        Character.TalkToNpc(3003166)
        time.sleep(1)

    else:
        print("Not in ChuChu Entry Map!")
Esempio n. 6
0
def Main():
    if GameState.IsInGame():
        if not Quest.GetQuestState(33284) == 2:
            if Terminal.IsRushing():
                Terminal.StopRush()

            CoreEnterance = 350060000
            Core = 350060160

            Lotus1 = 350060220
            Lotus2 = 350060240
            Lotus3 = 350060260

            BHCorrider = 350062000
            BHCorrider1 = 350062110
            BHCorrider2 = 350062120
            BHCorrider3 = 350062130
            BHCorrider4 = 350062150

            Quater = 350062400
            Gelimer = 350062410
            Gelimer2 = 350062500
            Escape1 = 350063000
            Escape2 = 350063001
            Escape3 = 350063002
            Escape4 = 350063003
            Escape5 = 350063004
            currentMap = Field.GetID()

            if not 350060000 <= Field.GetID() <= 350063500:
                Terminal.Rush(350061000)
                time.sleep(5)

            if currentMap == CoreEnterance:
                SetAttack(False)
                ToPortal("bossIn00")

            if currentMap in range(Core, Core + 10):
                SetAttack(True)

            if MapRange(Lotus1) or MapRange(Lotus2) or MapRange(Lotus3):
                SetAttack()

            if currentMap == 350061000:
                ToPortal("pt_350061000")

            elif currentMap == BHCorrider:
                SetAttack(False)
                ToPortal("In00")

            elif currentMap in range(BHCorrider1, BHCorrider1 + 10):
                if len(Field.GetMobs()) > 0:
                    SetAttack(True)
                else:
                    SetAttack(False)
                    ToPortal("east00")

            elif currentMap in range(BHCorrider3, BHCorrider3 + 10):
                if len(Field.GetMobs()) > 0:
                    SetAttack(True)
                else:
                    SetAttack(False)
                    ToPortal("east00")

            elif currentMap in range(BHCorrider4, BHCorrider4 + 10):
                if len(Field.GetMobs()) > 0:
                    SetAttack(True)
                else:
                    SetAttack(False)
                    ToPortal("east00")

            if currentMap == Quater:
                SetAttack(False)
                ToPortal("pt00")

            elif currentMap == Gelimer:
                Npc.ClearSelection()
                Npc.RegisterSelection("Please")
                time.sleep(2)
                SpamSpace()

            elif currentMap == Gelimer2:
                Character.MoveX(Field.FindPortal("pt00").x, 8000)
                # ToPortal("pt00")
                SpamSpace()

            elif currentMap == 350062900:
                ToPortal("out00")

            elif currentMap == Escape1:
                Character.MoveX(0, 5000)

            elif currentMap == Escape2:
                ToPortal("wet00")

            elif currentMap == Escape3:
                ToPortal("west00")

            elif currentMap == Escape4:
                time.sleep(2)
                ToPortal("pt00")

            elif currentMap == Escape5:
                SetAttack(False, False)
                Character.MoveX(200, 15000)
                # ToPortal("pt00")
                SpamKey("alt")

            elif currentMap == 350063200:
                quests = {
                    33281: 1540744,
                    33282: 1540745,
                    33283: 1540746,
                    33284: 1540729
                }

                for qid, npc in quests.items():
                    if DoQuest(qid):
                        StartQuest(qid, npc)
                        time.sleep(5)
Esempio n. 7
0
def CheckInstanceMap(mapid, dir, forward=True):
    _map = Field.GetID()
    entrance = 811000014
    field1 = 811000098
    field2 = 811000097
    down1 = 811000015
    down2 = down1 + 1
    down3 = down2 + 1
    well1 = down3 + 1

    templeEntrance = 811000019
    boss1 = 811000020

    nBossEntry = 811000025
    nBoss1 = nBossEntry + 1
    nBoss2 = nBoss1 + 1
    nBoss3 = nBoss2 + 2

    lastBossEntry = nBossEntry + 3

    if _map != mapid:
        if dir != "momi":
            Terminal.StopRush()

        if forward:
            if _map == entrance and dir == "up":
                EnterPortal("out01")
            if _map == field1 and dir == "up":
                EnterPortal("out01")
            if _map == entrance and dir == "down":
                EnterPortal("out02")
            if _map == down1 and dir == "down":
                EnterPortal("out01")
            if _map == down2 and dir == "down":
                EnterPortal("out01")
            if _map == down3 and dir == "down":
                EnterPortal("out01")
            if _map == templeEntrance and dir == "mid":
                EnterPortal("in00")
            if _map == entrance and dir == "right":
                EnterPortal("out02")
            if _map == down1 and dir == "right":
                EnterPortal("out01")
            if _map == down2 and dir == "right":
                EnterPortal("out01")
            if _map == down3 and dir == "right":
                EnterPortal("out01")
            if _map == templeEntrance - 1 and dir == "right":
                EnterPortal("out01")
            if _map == templeEntrance and dir == "right":
                EnterPortal("out01")
            if _map == templeEntrance + 1 and dir == "right":
                EnterPortal("out01")
            if _map == boss1 + 1 and dir == "right":
                EnterPortal("out01")
            if _map == nBossEntry and dir == "right":
                EnterPortal("out01")
            if _map == lastBossEntry and dir == "right":
                EnterPortal("in00")
        else:
            if _map == field1 and dir == "up":
                EnterPortal("out00")
            if _map == field2 and dir == "up":
                EnterPortal("out00")
            if _map == down1 and dir == "down":
                EnterPortal("out00")
            if _map == down2 and dir == "down":
                EnterPortal("out00")
            if _map == down3 and dir == "down":
                EnterPortal("out00")
            if _map == boss1 and dir == "mid":
                EnterPortal("out00")
            if _map == nBoss3 and dir == "mid2":
                EnterPortal("out00")
            if _map == nBoss2 and dir == "mid2":
                EnterPortal("out00")
            if _map == nBoss1 and dir == "mid2":
                EnterPortal("out00")