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 KaoAndDo(startRush, endRush, questState, questID, npcStartID, npcEndID): if currentMap != startRush and questState == 0: 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: time.sleep(2) Character.Teleport(-493, -868) time.sleep(5) 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 test_challenge_data(self): """Run the command sequence presented in the challenge""" # Note: the trailing backslashes in the sample data caused Python to ignore them: # appending a space after the \ tells Python's """ intepreter to leave the \ alone data = """^h^c ^04^^ ^13/ \^d^b / \ ^u^d^d^l^l^l^l^l^l^l^l^l ^r^r^l^l^d<CodeEval >^l^l^d/^b \ ^d^r^r^66/^b \ ^b^d \ / ^d^l^lv^d^b===========^i^94O123456 789^94A=======^u^u^u^u^u^u^l^l\^o^b^r/ """ t = Terminal() for s in data.splitlines(): t.interpret(s) self.assertEqual( t.str(), """ ^ / \ / \ / \ <CodeEval> \ / \ / \ / v ====A=====""", "Result does not match sample output")
def main(): if GameState.IsInGame(): if Terminal.GetProperty("Trainer",-1) == -1: Terminal.SetProperty("Trainer",Trainer()) trainer = Terminal.GetProperty("Trainer",-1) if trainer != -1: trainer.ControlCentre()
def TeleQuest(startRush, killingMap, endRush, questState, questID, npcStartID, npcEndID, startX, startY, endX, endY): if currentMap != startRush and questState == 0: Terminal.Rush(startRush) time.sleep(2) if questState == 0: # accept it if startX != 0 and startY != 0: Character.Teleport(startX, startY) time.sleep(2) time.sleep(2) Quest.StartQuest(questID, npcStartID) time.sleep(2) elif Quest.CheckCompleteDemand(questID, npcEndID) == 0: if currentMap != endRush: Terminal.Rush(endRush) time.sleep(2) if endX != 0 and endY != 0: Character.Teleport(endX, endY) time.sleep(2) Quest.CompleteQuest(questID, npcEndID) else: Terminal.Rush(killingMap) time.sleep(5)
def __GetWorld(self, LineEditID): if Terminal.GetComboBox('LoginServer') == 0: return elif Terminal.GetComboBox('LoginServer') == 1: IDToName = { 0: 'RebootNA', 1: 'GRAZED', 2: 'MYBCKN', 3: 'MYBCKN', 4: 'GRAZED', 5: 'GRAZED', 6: 'GRAZED', 7: 'GRAZED', 8: 'GRAZED', 9: 'MYBCKN', 10: 'MYBCKN', 11: 'MYBCKN', 12: 'MYBCKN', 13: 'Khroa', 14: 'Windia', 15: 'Khroa', 16: 'Bera', 17: 'Scania' } return IDToName[LineEditID].lower() elif Terminal.GetComboBox('LoginServer') == 2: IDToName = {0: 'Luna', 1: 'RebootEU'} return IDToName[LineEditID].lower()
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 break if bFound: time.sleep(1) MoveLToS(pCashItemInfo.liSN, nEmptySlotPOS) else: BuyByMeso() time.sleep(2) Terminal.LeaveCashShop() else: Terminal.LeaveCashShop()
def acceptVJ(): curMap = Field.GetID() if curMap != vjMap: Terminal.Rush(vjMap) return if Terminal.GetCheckBox("Kami Vac"): Terminal.SetCheckBox("Kami Vac", False) Terminal.SetCheckBox("Auto NPC", True) SunCat.Teleport(-1941, 60) time.sleep(0.1) if Quest.GetQuestState(34128) != 2: Quest.StartQuest(34128, vjNPC) time.sleep(1.5) Quest.CompleteQuest(34128, vjNPC) #Quest.StartQuest(34128, vjNPC) Npc.ClearSelection() #Npc.RegisterSelection("[Daily Quest] Vanishing Journey") Npc.RegisterSelection("Those are all") time.sleep(3) Quest.StartQuest(34129, vjNPC) time.sleep(3) #Character.TalkToNpc(vjNPC) #time.sleep(1) if SCLib.GetVar("UsingKami"): Terminal.SetCheckBox("Kami Vac", True) SCLib.UpdateVar("CurStep", "DoingVJ")
def initDD(): if Field.GetID() != ddStartingMap: Terminal.Rush(ddStartingMap) else: leaveParty() SunCat.HookDD() Terminal.SetCheckBox("Auto NPC", True) Terminal.SetCheckBox("Kami Vac", False) Terminal.SetCheckBox("Full Map Attack", False) Terminal.SetCheckBox("General FMA", False) #for mob in ddFilterMobs: #SunCat.FilterMob(mob) #SunCat.FilterMob(ddYellowBox) Npc.ClearSelection() Npc.RegisterSelection("Attempt") Npc.RegisterSelection(str(ddLevelSelect)) time.sleep(2) Character.TalkToNpc(ddNpc) time.sleep(3) SCLib.UpdateVar("CurStep", "StartingDD")
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 TierUpgrade(tier): if tier > Terminal.GetProperty("tier", 0): print("Upgrade tier") Terminal.SetProperty("tier", tier) return True else: return False
def rush(mapid): if not Terminal.IsRushing(): print("Rushing to map ID: {0}".format(mapid)) Terminal.Rush(mapid) time.sleep(1) else: time.sleep(1)
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()
def Rush(mapid): if not Field.GetID() == mapid: Terminal.Rush(mapid) time.sleep(2) while Terminal.IsRushing(): time.sleep(1) continue
def attackAuto(skillid,on): attack_key = 0x44 Key.Set(attack_key,1,skillid) Terminal.SetCheckBox("Skill Injection", False) Terminal.SetCheckBox("Melee No Delay",False) Terminal.SetCheckBox("Auto Attack", on) Terminal.SetComboBox("AttackKey",33) Terminal.SetSpinBox("autoattack_spin",100)
def ChaseMember(partyMembers): #members is a list of party char ids from lowest to highest for member in partyMembers: clientid = FindClientID(member) if Party.IsPartyMember(member): while Terminal.GetLocalUser(clientid).mapid != startingMap: Terminal.SetFollowID(FindClientID(member)) time.sleep(1)
def FollowLead(): if Party.IsInParty() and Party.GetPartyBossID() != Character.GetID(): if FindClientID(Party.GetPartyBossID()) is not None: LeaderClient = Terminal.GetLocalUser( FindClientID(Party.GetPartyBossID())) if Field.GetID() == LeaderClient.mapid and GameState.GetChannel( ) != LeaderClient.channel: print("Switch to leader channel") Terminal.ChangeChannel(LeaderClient.channel)
def test_setup(self): t = Terminal(3, 5) self.assertFalse(t.insert_mode, "Should be in overstrike mode at create time") self.assertEqual(t.row, 0, "Should be in row zero at create time") self.assertEqual(t.col, 0, "Should be in column zero at create time") self.assertEqual(t.str(), " \n \n ", "Should be three newline-terminated rows of spaces")
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 post(self): terminal = Terminal() scanned_items = self.request.get('scanned_items') items = scanned_items.split(',') for item in items: terminal.scan(item) total_price = terminal.total_price() self.render('terminal.html', scanned_items=scanned_items, total='{:,.2f}'.format(float(total_price)))
def SemiNDSi(siSkill,dummySkill,delay,on,attackSpeed): Terminal.SetCheckBox("Auto Attack",False) Terminal.SetRadioButton("SIRadioMelee",True) Terminal.SetCheckBox("MonkeySpiritsNDcheck",False) count = 0 if siSkill != 32120055: delay = 30*math.ceil(delay*1000 * (10+attackSpeed)/480)/1000 print("The delay for skill {} is {}, starting si".format(siSkill,delay)) if siSkill in [5311000,5301000]: sleepTime = 0.161 elif siSkill not in [25101000,25121000]: sleepTime = 0.211 else: sleepTime = 0.101 while Field.GetCharacterCount()<=1 and Field.GetEliteState() !=2 and len(Field.GetMobs())>0 and not Terminal.IsRushing() and GameState.IsInGame() and not Terminal.GetRadioButton("SIRadioDragon") and on: Terminal.SetCheckBox("Skill Injection",True) Terminal.SetLineEdit("SISkillID",str(siSkill)) Terminal.SetCheckBox("Melee No Delay",True) Terminal.SetSpinBox("SkillInjection",17) time.sleep(sleepTime) #Terminal.SetCheckBox("Melee No Delay",False) Terminal.SetLineEdit("SISkillID",str(dummySkill)) time.sleep(0.043) Terminal.SetCheckBox("Skill Injection",False) time.sleep(delay+0.05) #if Terminal.IsRushing(): # break if (siSkill == 27111303 or siSkill == 27121303) and not(Character.HasBuff(2,20040220) or Character.HasBuff(2,20040219)): break count += 1 print("Si ended due to break options")
def ToggleBuffs(buffid,skillid = None,toggleKami = False): short_sleep = 0.75 if skillid is None: skillid = buffid if Character.GetSkillLevel(buffid) > 0: if Character.HasBuff(2, buffid) == False: autoAttack = Terminal.GetCheckBox("Auto Attack") skillInject = Terminal.GetCheckBox("Skill Injection") javelin = Terminal.GetCheckBox("bot/illium/radiant_javelin_delay") Terminal.SetCheckBox("Auto Attack",False) Terminal.SetCheckBox("bot/illium/radiant_javelin_delay",False) Terminal.SetCheckBox("Skill Injection",False) if toggleKami: ToggleKami(False) time.sleep(short_sleep) Character.UseSkill(skillid) #time.sleep(short_sleep) if job in BattleMageJobs: time.sleep(short_sleep) Character.UseSkill(32001014) #time.sleep(short_sleep) if Character.HasBuff(2, buffid) == True: if toggleKami: ToggleKami(True) Terminal.SetCheckBox("Auto Attack",autoAttack) Terminal.SetCheckBox("bot/illium/radiant_javelin_delay",javelin) Terminal.SetCheckBox("Skill Injection",skillInject)
def start_DD(): print("Attempting to join Dream Defender") Party.LeaveParty() Disabler() if Terminal.GetCheckBox("Skill Injection"): Terminal.SetCheckBox("Skill Injection", False) Npc.ClearSelection() Npc.RegisterSelection("Dream") Npc.RegisterSelection("Stage") Character.TalkToNpc(9010100) time.sleep(3)
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()
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 __LogGM(self): GMLogs = self.__ReadGMLogs() world = Terminal.GetComboBox('LoginWorld') worldStatus = ast.literal_eval(GMLogs)['worlds'][self.__GetWorld( world)]['status'] worldsToCheck = self.__ReadWorldsToLogOut()[self.__GetWorld(world)] if worldStatus == 'online' and bool(worldsToCheck): Terminal.SetCheckBox('Auto Login', False) if GameState.IsInGame(): Terminal.Logout() if worldStatus == 'offline' and bool(worldsToCheck): Terminal.SetCheckBox("Auto Login", True)
def __LogGM(self): try: worldStatus = ast.literal_eval( self.__ReadGMLogs())[self.__GetWorld( Terminal.GetComboBox('LoginWorld'))] worldsToCheck = ast.literal_eval( self.__ReadWorldsToLogOut())[self.__GetWorld( Terminal.GetComboBox('LoginWorld'))] if worldStatus == 'online' and bool(worldsToCheck): Terminal.SetCheckBox('Auto Login', False) Terminal.Logout() if worldStatus == 'offline' and bool(worldsToCheck): Terminal.SetCheckBox("Auto Login", True) except: pass
def addTerminal(self, name, **opts): #print "Node.addTerminal called. name:", name, "opts:", opts #global TETRACYCLINE #print "TETRACYCLINE: ", TETRACYCLINE #if TETRACYCLINE: #print "Creating Terminal..." name = self.nextTerminalName(name) term = Terminal(self, name, **opts) self.terminals[name] = term if term.isInput(): self._inputs[name] = term elif term.isOutput(): self._outputs[name] = term self.graphicsItem().updateTerminals() return term
def GotoHorntail(): ToggleKami(False) ToggleHyperTeleportRock(True) print("Going to Horntail") if Field.GetID() != CaveOfLifeEntrance: if Field.GetID() != PeakOfTheBigNest: Terminal.Rush(PeakOfTheBigNest) else: ToggleHyperTeleportRock(False) time.sleep(0.5) Terminal.Rush(CaveOfLifeEntrance) else: Party.CreateParty() Npc.ClearSelection() Character.TalkToNpc(2083000)
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()
def finishChuChu(): chuchuSymbol = Inventory.FindItemByID(1712002) if not useSymbol(chuchuSymbol): if SCLib.GetVar("UsingWhitelist"): Terminal.SetPushButton("Whitelist", True) SCLib.UpdateVar("CurDaily", "DD") SCLib.UpdateVar("CurStep", "StartingDD")
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)
def post(self): terminal = Terminal() if len(self.request.arguments()) == 0 or not self.request.get('sku') or not self.request.get('unit_price'): self.render('set_price.html') else: sku = self.request.get('sku') unit_price = self.request.get('unit_price') bulk_price = self.request.get('bulk_price') bulk_quantity = self.request.get('bulk_quantity') currency = self.request.get('currency') if terminal.get_product_details(sku): if len(currency) == 0: terminal.set_price(authenticated=True, DBNames=[Product], sku=sku, unit_price=unit_price, bulk_price=bulk_price, bulk_quantity=bulk_quantity) self.write(json.dumps(terminal.get_product_details(sku))) else: terminal.set_price(authenticated=True, DBNames=[Product], sku=sku, unit_price=unit_price, bulk_price=bulk_price, bulk_quantity=bulk_quantity, currency=currency) self.write(json.dumps(terminal.get_product_details(sku))) else: self.write("item not found")
def run(self, working_dir, command_to_execute): parameters = Terminal.get_setting('parameters', []) t_app=Terminal.TerminalSelector.get() parameters.extend(self.get_terminal_args(t_app, working_dir,command_to_execute)) self.run_terminal(working_dir, parameters)