def doCubing(self): necklace = "necklace" eye = 'eye' face = 'face' earring = 'earring' ring = 'ring' can_cube = not self.accountData['cubing_done'] and Character.GetLevel() >=145 can_cube = can_cube and HELPER.FarmedEnoughAccessories() have_cubes = Inventory.FindItemByID(MISC.red_cube_id).valid or Character.GetMeso() > 800000000 return can_cube and have_cubes
def withdraw_mesos(): if Field.GetID() ==101000000: #wait till character gets to ellinia #1032006 time.sleep(2) Packet.BlockRecvHeader(PACKET_HEADERS.block_header) print("Current Mesos before withdraw = {}".format(Character.GetMeso())) Character.TalkToNpc(1032006) time.sleep(3) oPacket = Packet.COutPacket(PACKET_HEADERS.store_header) oPacket.EncodeBuffer("07 00000006FC23ABFF") Packet.SendPacket(oPacket) oPacket1 = Packet.COutPacket(PACKET_HEADERS.store_header) oPacket1.Encode2(8) #oPacket2.EncodeBuffer("08") Packet.SendPacket(oPacket1) time.sleep(1) print("Current Mesos after withdraw = {}".format(Character.GetMeso())) time.sleep(1) Packet.UnBlockRecvHeader(PACKET_HEADERS.block_header) else: Terminal.Rush(101000000) time.sleep(3)
def store_mesos(): while True: if Field.GetID() == storage_map_id: print("Current Mesos before store = {}".format(Character.GetMeso())) Packet.BlockRecvHeader(PACKET_HEADERS.block_header) Character.Teleport(2268,17) time.sleep(1) Character.TalkToNpc(storage_npc_id) time.sleep(1) oPacket = Packet.COutPacket(PACKET_HEADERS.store_header) oPacket.EncodeBuffer("07 FFFFFFF903DC5401") Packet.SendPacket(oPacket) oPacket1 = Packet.COutPacket(PACKET_HEADERS.store_header) oPacket1.Encode2(8) Packet.SendPacket(oPacket1) print("Completed meso storing") time.sleep(1) print("Current Mesos after store = {}".format(Character.GetMeso())) Packet.UnBlockRecvHeader(PACKET_HEADERS.block_header) break else: Terminal.Rush(storage_map_id) print("Still rushing to storage") time.sleep(2)
def BuyByMeso(): Packet.BlockSendHeader(CashItemResultOpcode) oPacket = Packet.COutPacket(CashItemRequestOpcode) oPacket.Encode1(BuyByMesoRequest) nMeso = Character.GetMeso() nPrice = 0 if nMeso >= 25000000: nCommoditySN = 87000027 nPrice = 25000000 elif nMeso >= 13000000: nCommoditySN = 87000026 nPrice = 13000000 elif nMeso >= 5200000: nCommoditySN = 87000025 nPrice = 5200000 oPacket.Encode4(nCommoditySN) oPacket.Encode4(nPrice) Packet.SendPacket(oPacket) time.sleep(3) Packet.UnBlockSendHeader(CashItemResultOpcode)
def __Items(self): IGN = Character.GetName() Channel = GameState.GetChannel() World = GameState.GetWorldID() Level = Character.GetLevel() CharID = Character.GetID() PercentageExp = self.__GetPercentage() VJSymbol = Inventory.GetItemCount(1712001) ChuSymbol = Inventory.GetItemCount(1712002) LachSymbol = Inventory.GetItemCount(1712003) ArcanaSymbol = Inventory.GetItemCount(1712004) MorrasSymbol = Inventory.GetItemCount(1712005) EsferaSymbol = Inventory.GetItemCount(1712006) StigmaAmount = Inventory.GetItemCount(4001868) CoreAmount = Inventory.GetItemCount(4001842) TradNodes = Inventory.GetItemCount(2435719) UntradNodes = Inventory.GetItemCount(2436324) MesoCount = Character.GetMeso() DropletCount = Inventory.GetItemCount(4001878) EsferaDropletCount = Inventory.GetItemCount(4001879) ProtAmount = Inventory.GetItemCount(2531000) + Inventory.GetItemCount(2531001) + \ Inventory.GetItemCount(2531004) + Inventory.GetItemCount(2531005) CssAmount = Inventory.GetItemCount(2049004) + Inventory.GetItemCount(2049009) + Inventory.GetItemCount(2049011) + \ Inventory.GetItemCount(2049018) + Inventory.GetItemCount(2049022) PotentialScrolls = Inventory.GetItemCount(2049401) items = { 'IGN': IGN, 'World': World, 'CharID': CharID, 'Channel': Channel, 'Level': Level, 'EXP': PercentageExp, 'VJSymbols': VJSymbol, 'ChuChuSymbols': ChuSymbol, 'LacheleinSymbols': LachSymbol, 'ArcanaSymbols': ArcanaSymbol, 'MorrasSymbol': MorrasSymbol, 'EsferaSymbols': EsferaSymbol, 'StigmaCores': StigmaAmount, 'ACores': CoreAmount, 'TradableNodes': TradNodes, 'UntradableNodes': UntradNodes, 'Meso': MesoCount, 'Droplets': DropletCount, 'EsferaDroplets': EsferaDropletCount, 'mapID': Field.GetID(), 'ProtectionScrolls': ProtAmount, 'CleanSlate': CssAmount, 'PotentialScrolls': PotentialScrolls } try: self.__toFile('TMRemote/temp/logs', 'ab', items) return True except: try: with open('TMRemote/temp/logs', 'wb+') as temp: pass self.__toFile('TMRemote/temp/logs', 'ab', items) return True except: return False
def StoreMeso(self): storage_map_id = 550000000 storage_npc_id = 9270054 ###########store mesos def store_mesos(): while True: if Field.GetID() == storage_map_id: print("Current Mesos before store = {}".format(Character.GetMeso())) Packet.BlockRecvHeader(PACKET_HEADERS.block_header) Character.Teleport(2268,17) time.sleep(1) Character.TalkToNpc(storage_npc_id) time.sleep(1) oPacket = Packet.COutPacket(PACKET_HEADERS.store_header) oPacket.EncodeBuffer("07 FFFFFFF903DC5401") Packet.SendPacket(oPacket) oPacket1 = Packet.COutPacket(PACKET_HEADERS.store_header) oPacket1.Encode2(8) Packet.SendPacket(oPacket1) print("Completed meso storing") time.sleep(1) print("Current Mesos after store = {}".format(Character.GetMeso())) Packet.UnBlockRecvHeader(PACKET_HEADERS.block_header) break else: Terminal.Rush(storage_map_id) print("Still rushing to storage") time.sleep(2) def withdraw_mesos(): if Field.GetID() ==101000000: #wait till character gets to ellinia #1032006 time.sleep(2) Packet.BlockRecvHeader(PACKET_HEADERS.block_header) print("Current Mesos before withdraw = {}".format(Character.GetMeso())) Character.TalkToNpc(1032006) time.sleep(3) oPacket = Packet.COutPacket(PACKET_HEADERS.store_header) oPacket.EncodeBuffer("07 00000006FC23ABFF") Packet.SendPacket(oPacket) oPacket1 = Packet.COutPacket(PACKET_HEADERS.store_header) oPacket1.Encode2(8) #oPacket2.EncodeBuffer("08") Packet.SendPacket(oPacket1) time.sleep(1) print("Current Mesos after withdraw = {}".format(Character.GetMeso())) time.sleep(1) Packet.UnBlockRecvHeader(PACKET_HEADERS.block_header) else: Terminal.Rush(101000000) time.sleep(3) if Character.GetMeso() == 29999999999 and Character.GetJob() == 4212: #if mesos =29999999999, which is max, store them in the storage HELPER.ToggleRushByLevel(False) #Terminal.LoadProfile(r"C:\Users\Jacopo\Desktop\TerminalManager\terminalProfiles\StoreMesos.xml") if self.accountData['storing_meso'] == False: store_mesos() #Next step is to change the AutoChar Number and then logon into the new created luminous and release control #Read AutoChar Number, +1 write to file. time.sleep(3) if Character.GetMeso() == 0: self.accountData['storing_meso'] = True self.writeJson() print("logging out") if GameState.IsInGame(): Terminal.Logout() time.sleep(3) #print(GameState.GetLoginStep()) if self.accountData['storing_meso'] and GameState.GetLoginStep() == 2: autochar_kanna = 19 autochar_lumi = 11 Terminal.SetCheckBox("Auto Login",False) Terminal.SetLineEdit("LoginChar", str(accountData['storage_number'] + 1)) Terminal.SetComboBox("settings/autochar_job",autochar_lumi) Terminal.SetCheckBox("Auto Login",True) Terminal.SetCheckBox("settings/autochar",True) if self.accountData['storing_meso'] and Character.GetJob() == 2700 and Character.GetMeso() == 0: print("withdrawing mesos") HELPER.ToggleRushByLevel(False) withdraw_mesos() time.sleep(2) SCLib.UpdateVar("withdraw_flag",True) elif self.accountData['storing_meso'] and Character.GetJob() == 2700 and Character.GetMeso() == 29999999999 and SCLib.GetVar("withdraw_flag"): #safe to say that storage is empty and can switch back to kanna self.accountData['storage_number'] = self.accountData['storage_number'] + 1 self.accountData['storing_meso'] = False self.writeJson() if GameState.IsInGame(): Terminal.Logout() Terminal.SetLineEdit("LoginChar", self.accountData['kanna_pos']) SCLib.UpdateVar("withdraw_flag",False) print("Logging out and changing to Kanna farmer") time.sleep(2) elif self.accountData['storing_meso'] and Character.GetJob() == 2700 and Character.GetMeso() != 0 and not SCLib.GetVar("withdraw_flag"): #need to update bank number but did not withdraw mesos self.accountData['storage_number'] = self.accountData['storage_number'] + 1 self.writeJson() if GameState.IsInGame(): Terminal.Logout() print("Logging out and changing to next bank") time.sleep(2) def ChooseLightPath(): choosePacket = Packet.COutPacket(PACKET_HEADERS.dialogue_header) choosePacket.EncodeBuffer("1A 01 00000000") Packet.SendPacket(choosePacket) if Field.GetID() == 927020000: ChooseLightPath() time.sleep(1)
def doStoreMeso(self): return self.accountData['storing_meso'] or (Character.GetMeso() == 29999999999 and Character.GetJob() == JOB_CONSTANTS.KannaJobs[3])
def handleReady(self): false_list = ['ready_for_cube','face_done','eye_done','earring_done','ring_done','necklace_done','cubing_done','storing_meso','pet_expire','training_done','monster_park_done'] zero_list = ['storage_number','used_slots','total_slots','necklace','eye','face','earring','ring'] for entry in false_list: if entry not in self.accountData: self.accountData[entry] = False for entry in zero_list: if entry not in self.accountData: self.accountData[entry] = 0 if 'kanna_pos' not in self.accountData: if Character.GetJob() == 4212: self.accountData['kanna_pos'] = Terminal.GetLineEdit("LoginChar") if 'IGN' not in self.accountData or self.accountData['IGN'] == '': self.accountData['IGN'] = Character.GetName() if 'total_meso' not in self.accountData: if Character.GetJob() == 4212: self.accountData['total_meso'] = int(self.accountData['storage_number']) * 30 + Character.GetMeso() / 1000000000 if 'date' not in self.accountData: self.accountData['date'] = str(datetime.datetime.utcnow().date()) if 'equips' not in self.accountData: self.accountData['equips'] = [] if 'zakum_daily_done' not in self.accountData: self.accountData['zakum_daily_done'] = set() if 'horntail_daily_done' not in self.accountData: self.accountData['horntail_daily_done'] = set()
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)
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()
time.sleep(1) oPacket = Packet.COutPacket(header) oPacket.EncodeBuffer("07 FFFFFFF903DC5401") Packet.SendPacket(oPacket) oPacket1 = Packet.COutPacket(header) oPacket1.Encode2(8) Packet.SendPacket(oPacket1) print("Completed meso storing") break else: Terminal.Rush(storage_map_id) print("Still rushing to storage") time.sleep(1) if job == 4212 and Character.GetMeso() == 29999999999: #if mesos =29999999999, which is max, store them in the storage Terminal.SetRushByLevel(False) #Terminal.LoadProfile(r"C:\Users\Jacopo\Desktop\TerminalManager\terminalProfiles\StoreMesos.xml") store_mesos() Terminal.Logout() #Next step is to change the AutoChar Number and then logon into the new created luminous and release control #Read AutoChar Number, +1 write to file. CharName = Character.GetName() print("Changing profiles for {}".format(CharName)) while True: try: f = open( r'C:\Users\Jacopo\Desktop\Scripts\StoreMeso\%s.txt' % CharName, 'r') print("Successfully read meso bank number")