Package: thetravelers.online-Api
thetravelers.online-APIDescriptionA python API for the travelers.online.
Read documentation bellow for details on usage.InstallationRun this in command line:pipinstallthetravelers.online-ApiDownload install the latest version of Firefox Here:https://www.mozilla.org/en-US/firefox/new/Download Geckodriver from:https://github.com/mozilla/geckodriver/releasesPlace geckodriver.exe with your python instalation or anywhere else in your path.(Either C:\Users\your_user\AppData\Local\Programs\Python\Python38 or C:\Python38)Account TokenGo tohttps://thetravelers.onlineand login.In firefox press shift+f9 to open up storage.Scroll until you see a cookie named T.The value is your account token.Captcha TokenTo get your captcha token go to thehttps://thetravelers.online.Complete the captcha and don't log in.Paste this into the browser console.prompt("Copy the captcha:",SOCKET.captcha);ExamplesExample auto xp program using a high level client:token=input('token:')captchaToken=input('captcha token:')importtravelersApiapi=travelersApi.travelerApi(token,captchaToken,openBrowser=True)importtimeturn='e'whileTrue:if(api.isNewCycle()==True):api.move(turn)ifturn=='e':turn='w'else:turn='e'time.sleep(.1)Example auto xp program using a base client:token=input('token:')captchaToken=input('captcha token:')importtravelersApitraveler=travelersApi.baseClient(token)turn='e'defonMessage(msg:travelersApi.gameObject):globaltraveler,turnprint(msg)traveler.send({'action':'setDir','dir':turn,'autowalk':True})ifturn=='e':turn='w'else:turn='e'traveler.onMessage=onMessagetraveler.login(captchaToken)orimporttravelersApitoken=input('token:')turn='e'classbot(travelersApi.baseClient):defonMessage(self,msg:travelersApi.gameObject):globalturnprint(msg)traveler.send({'action':'setDir','dir':turn,'autowalk':True})ifturn=='e':turn='w'else:turn='e'traveler=bot(token)traveler.login(input('captcha:'))DocumentationgenerateTileAt(x, y)This will generate a tile at a specific location.getPerlin(x, y, s=100)This gets the noise value at a given location.isTileEvent(x, y)Returns a boolean for if the given tile is an event or not.traveler=baseClient(token)token is your account token.methodssend(packet)packet is the message sent to the serverAn action must be specifiedEx.traveler.send({'action':'setDir','dir':'n','autowalk':False})onMessage(gameObject)The method to handle any request from the serverPlease look at the above example to specify the typeonUpdateImmediate(message)Gets called when the server sends an event during the cycleonEvalJS(js)Gets called when the server sends java script to evaluate. This has been previously sent for the exploding spire popups.error(err)Gets called when an error occurs.stop()Stops the botlogin(captcha)Connects to the travelers.If this is never called you will never connect.api=travelerApi(token, captchaToken, openBrowser=False, printInitialize=True)Token is your account token.captchaToken is your captcha token.OpenBrowser is defaulted to False but I would recommend setting it to True when testing.PrintInitialize is whether or not to print API initialized when the api is set up.methodsapi.stop()This will close all browsing context from firefox and delete your account token. Always use this to stop your bot.api.move(dir)dir is the direction you would like to move.Valid directions are n, ne, e, se, s, sw, w, nw.api.doubleStep()Will click the double step button once.api.equip(itemID)itemID is the id of the item you would like to equip.This lets you equip anything.api.unEquip()Unequips the current item.api.getLastEventInLog()Returns a string of the most recent event in your log.api.getFullEventLog()Returns a list of every message in the event log.api.getSuppliesList()Returns a list of each itemID you currently have.this doesnt give any information about the items other than the ID.api.getSuppliesDataReturns a dictionary of each item you currently have.This does include data such as ammount, equip data, crafting recipee, etc.api.craft(ID)This will craft an item from it's ID.You can only craft one item a second due to game limits.api.getCurrentCrafting()Returns a dictionary of your crafting queue.api.pressEventButton(text)text is the buttons text you would like to click.api.getEventName()Returns the current event title as a string.api.getLootingName()Returns the current looting title as a string.api.getLootingDescription()Returns the current looting menu description as a string.api.getLootablesAsData()Returns every item you can loot as a dictionary with data.api.getLootablesAsList()Returns every item to loot as a list.api.takeAll()Will take all lootables.api.takeItem(ID, amount)ID is the itemID you wish to take.Amount is the amount you wish to take.api.giveItem(ID, amount)ID is the itemID you wish to give.Amount is the amount you wish to give.api.openDropping()Opens the dropping items menu.api.getUsername()Returns your username.api.getLevel()Returns your current level.api.getMaxWeight()Returns your current max weight.api.getMaxHealth()Returns your current max health.api.getMaxStamina()Returns your current max stamina.api.getMinute()Returns the current minute.api.getHour()Returns the current hour.api.getAmPm()Returns if it is a.m. or p.m. as a string.api.getDay()Returns the current day.api.getSeason()Returns the current season.api.getYear()Returns the current year.api.getCycleTime()Returns the current time till next cycle.Ex.>>>print(api.getCycleTime()).5api.getBiome()Returns your current biome.api.getPos()Returns you position as a list [x,y].api.deriveTile(x,y)Returns the tile at the coordinates.Only shows client side generation.api.getTileMap()Returns a list with each tile in view distance.api.getLocalTile(x,y)Top left is 1,1 and bottom right is 31,31.Returns a tile within view distance.Can show server side locations.api.getRelTile(x,y)Returns a tile relative to you.Ex.>>>api.getRelTile(0,-1)(tileaboveyou)api.isNewCycle()When run repeaditely it will return true when it is a new cycle.Ex.fromtimeimportsleepwhileTrue:ifapi.isNewCycle():codetoberuneverycyclesleep(.01)api.executeRawJS(js)Executes raw java script so if my API missed something you can use javascript.api.returnJS(js)Same as executeRawJS except it can use return values.Ex.>>>print(api.returnJS('YOU.username')(yourusername)api.sendPacket(packet)Sends a packet to the server.