def Stamp(slot): silverStamp = 2049501 item = Inventory.GetItem(1, slot) stamp = Inventory.FindItemByID(silverStamp) while item.grade > 0 and item.option1 > 0 and item.option3==0 \ and stamp.valid and GameState.IsInGame(): oPacket = Packet.COutPacket(stampHeader) oPacket.Encode4(int(time.monotonic() * 1000)) #time oPacket.Encode2(stamp.pos) oPacket.Encode2(slot) Packet.SendPacket(oPacket) time.sleep(1) item = Inventory.GetItem(1, slot) stamp = Inventory.FindItemByID(silverStamp)
def Reveal(slot): item = Inventory.GetItem(1, slot) if item.grade > 0 and item.option1 == 0 and GameState.IsInGame(): oPacket = Packet.COutPacket(revealHeader) oPacket.Encode4(int(time.monotonic() * 1000)) #time oPacket.Encode2(0x007F) oPacket.Encode2(item.pos) Packet.SendPacket(oPacket) time.sleep(1)
def main(): if GameState.IsInGame(): if aIStar: items = Inventory.GetItems(1) for item in items: starItem(item.pos, item.currentStar, item.maxStar, starTo, item.id) elif fIStar: # star first item in inventory item = Inventory.GetItem(1, 1) if item.valid: starItem(1, item.currentStar, item.maxStar, starTo, item.id) if eStar: for x in range(-100, 0): item = Inventory.GetItem(1, x) if item.valid: starItem(x, item.currentStar, item.maxStar, starTo, item.id)
def FarmedEnoughAccessories(): eye = 0 face = 0 earring = 0 necklace = 0 ring = 0 items = Inventory.GetItems(1) for item in items: if item.id in EQUIP_ID.necklace_list and item.grade > 0: necklace = 1 elif item.id in EQUIP_ID.ring_list and item.grade > 0: ring += 1 elif item.id in EQUIP_ID.eye_list and item.grade > 0: eye = 1 elif item.id in EQUIP_ID.face_list and item.grade > 0: face = 1 elif item.id in EQUIP_ID.earring_list and item.grade > 0: earring = 1 if Inventory.GetItem(1, EQUIP_SLOTS.necklace_slot ).id in EQUIP_ID.necklace_list and item.grade > 0: necklace = 1 elif Inventory.GetItem( 1, EQUIP_SLOTS.eye_slot).id in EQUIP_ID.eye_list and item.grade > 0: eye = 1 elif Inventory.GetItem( 1, EQUIP_SLOTS.face_slot).id in EQUIP_ID.face_list and item.grade > 0: face = 1 elif Inventory.GetItem(1, EQUIP_SLOTS.earring_slot ).id in EQUIP_ID.earring_list and item.grade > 0: earring = 1 for ring_slot in EQUIP_SLOTS.ring_slots: if Inventory.GetItem( 1, ring_slot).id in EQUIP_ID.ring_list and item.grade > 0: ring += 1 return (eye + face + earring + necklace + ring) >= 5
def Stamp(upToSlot): silverStamp = 2049501 if stampEverything: upToSlot = Inventory.GetItemSlotCount(1) currentSlot = 0 for item in Inventory.GetItems(1): stamp = Inventory.FindItemByID(silverStamp) currentSlot += 1 if currentSlot > upToSlot: break while item.grade > 0 and item.option1 > 0 and item.option3==0 \ and stamp.valid and GameState.IsInGame(): item = Inventory.GetItem(1, item.pos) stamp = Inventory.FindItemByID(silverStamp) if stamp.valid: oPacket = Packet.COutPacket(stampHeader) oPacket.Encode4(int(time.monotonic() * 1000)) #time oPacket.Encode2(stamp.pos) oPacket.Encode2(item.pos) Packet.SendPacket(oPacket) time.sleep(1)
def starItem(pos, currStar, itemMaxStar, userMaxStar, itemid): print('{0} {1}'.format("Position: ".ljust(padding), str(pos))) slotStartingMeso = Character.GetMeso() slotStartingStar = currStar currCode = None if itemid in whitelist: return while currStar < userMaxStar and currStar < itemMaxStar and Inventory.GetItem( 1, pos).valid: if GameState.IsInGame(): print("#-----------------------Star-----------------------#") print('{0} {1}'.format("Starring From: ".ljust(padding), str(currStar))) print('{0} {1}'.format("User Max stars: ".ljust(padding), str(userMaxStar))) print('{0} {1}'.format("Item max stars: ".ljust(padding), str(itemMaxStar))) print('{0} {1}'.format("Item ID: ".ljust(padding), str(itemid))) beforeMeso = Character.GetMeso() cPacket = Packet.COutPacket(StarForceHeader) cPacket.Encode1(StarCatchingOpcode) Packet.SendPacket(cPacket) ciPacket = Packet.WaitForRecv(StarForceRecv, 10000) if ciPacket.GetRemaining() != 12 or ciPacket.ReadLong( 1) != StarCatchingOpcode: print('star catching packet error', flush=True) return level = ciPacket.ReadLong(1) # 0130 01 053ADEC9 FFF5 [01] 678C8108 00000001 FFFFFFFF 01 00 # 0130 01 058B16B9 FFF5 [01] 54A8F589 00000001 FFFFFFFF 00 00 # star the item oPacket = Packet.COutPacket(StarForceHeader) oPacket.Encode1(1) oPacket.Encode4(int(time.monotonic() * 1000)) oPacket.Encode2(toHex(pos, 16)) oPacket.Encode1(1) oPacket.Encode4(GenSecretCode(ciPacket.ReadLong(4))) oPacket.Encode4(1) oPacket.Encode4(0xFFFFFFFF) if safeguard and currStar in range(12, 17): oPacket.Encode1(1) print("SAFEGUARDING") else: oPacket.Encode1(0) oPacket.Encode1(1) Packet.SendPacket(oPacket) # wait for recv iPacket = Packet.WaitForRecv(StarForceRecv, 10000) afterMeso = Character.GetMeso() iCosted = beforeMeso - afterMeso print('{0} {1:,}'.format("Meso Cost of Star: ".ljust(padding), iCosted)) print('{0} {1}'.format("iPacket remaining: ".ljust(padding), iPacket.GetRemaining()), flush=True) # update current star counter currStar = Inventory.GetItem(1, pos).currentStar # get max star again in case item blew up # item blown up means itemMaxStar = 0 itemMaxStar = Inventory.GetItem(1, pos).maxStar slotEndingMeso = Character.GetMeso() slotEndingStar = currStar slotTotalCost = slotStartingMeso - slotEndingMeso if (slotStartingMeso - slotEndingMeso) != 0: print('{0} {1:,} meso from star {2} to {3}\n'.format( "Total Cost: ".ljust(padding), slotTotalCost, str(slotStartingStar), str(slotEndingStar)), flush=True)
def GetTotalStar(): total_star = 0 for x in range(-100, 0): item = Inventory.GetItem(1, x) total_star += item.currentStar return total_star
nCommodityID = iPacket.ReadLong(4) nNumber = iPacket.ReadLong(2) sBuyCharacterID = iPacket.ReadLong(13) ftDateExpire = iPacket.ReadLong(8) # FileTime(4, 4) nPaybackRate = iPacket.ReadLong(4) dDiscountRate = iPacket.ReadLong(8) dwOrderNo = iPacket.ReadLong(4) dwProductNo = iPacket.ReadLong(4) bRefundable = iPacket.ReadLong(1) nSourceFlag = iPacket.ReadLong(1) nStorageBank = iPacket.ReadLong(1) # CashItemOption Decode liCashItemSN = iPacket.ReadLong(8) ftExpireDate = iPacket.ReadLong(8) # FileTime(4, 4) nGrade = iPacket.ReadLong(4) iPacket.ReadLong(4) # aOption[0] iPacket.ReadLong(4) # aOption[1] iPacket.ReadLong(4) # aOption[2] if GameState.IsInGame(): if Inventory.GetItemCount(5040004) == 0 and Inventory.GetEmptySlotCount( 5) > 0 and Character.GetMeso() >= 5200000: nEmptySlotPOS = 0 for i in range(1, Inventory.GetItemSlotCount(5)): pItem = Inventory.GetItem(5, i) if not pItem.valid: nEmptySlotPOS = i break Terminal.EnterCashShop() CashItemResLoadLockerDone()
oPacket.Encode2(slot) Packet.SendPacket(oPacket) time.sleep(1) item = Inventory.GetItem(1, slot) stamp = Inventory.FindItemByID(silverStamp) if GameState.IsInGame(): for i in range(startSlot, endSlot + 1): if autoReveal: Reveal(i) if autoStamp: Stamp(i) item = Inventory.GetItem(1, i) if item.valid and item.grade > 0 and item.option1 > 0: if not item.valid: pass elif stopAtStatThreshold == True and getHighestPotential( item) >= statThreshold: pass elif stopAtMesoRate == True and getHighestPotential( item) >= dropStatThreshold and containMesosObtained(item): pass elif stopAtDropRate == True and getHighestPotential( item) >= dropStatThreshold and containItemDropRate(item): pass elif stopAtDoubleMesoRate == True and containDoubleMesoObtained( item): pass