Python API for thetravelers.online
Project description
thetravelers.online-API
Description
A python API for the travelers.online. Read documentation bellow for details on usage.
Installation
- Run this in command line:
pip install thetravelers.online-Api
- Download install the latest version of Firefox Here:https://www.mozilla.org/en-US/firefox/new/
- Download Geckodriver from:https://github.com/mozilla/geckodriver/releases
- Place 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 Token
- Go to https://thetravelers.online and 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 Token
- To get your captcha token go to the https://thetravelers.online.
- Complete the captcha and don't log in.
- Paste this into the browser console.
prompt("Copy the captcha:", SOCKET.captcha);
Examples
Example auto xp program using a high level client:
token=input('token:')
captchaToken=input('captcha token:')
import travelersApi
api=travelersApi.travelerApi(token, captchaToken, openBrowser=True)
import time
turn='e'
while True:
if(api.isNewCycle()==True):
api.move(turn)
if turn=='e':
turn='w'
else:
turn='e'
time.sleep(.1)
Example auto xp program using a base client:
token=input('token:')
captchaToken=input('captcha token:')
import travelersApi
traveler=travelersApi.baseClient(token)
turn='e'
def onMessage(msg:travelersApi.gameObject):
global traveler, turn
print(msg)
traveler.send({'action':'setDir', 'dir':turn, 'autowalk': True})
if turn=='e':
turn='w'
else:
turn='e'
traveler.onMessage=onMessage
traveler.login(captchaToken)
or
import travelersApi
token=input('token:')
turn='e'
class bot(travelersApi.baseClient):
def onMessage(self, msg:travelersApi.gameObject):
global turn
print(msg)
traveler.send({'action':'setDir', 'dir':turn, 'autowalk': True})
if turn=='e':
turn='w'
else:
turn='e'
traveler = bot(token)
traveler.login(input('captcha:'))
Documentation
generateTileAt(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.
methods
send(packet)
- packet is the message sent to the server
- An action must be specified
- Ex.
traveler.send({'action':'setDir', 'dir':'n', 'autowalk':False})
onMessage(gameObject)
- The method to handle any request from the server
- Please look at the above example to specify the type
onUpdateImmediate(message)
- Gets called when the server sends an event during the cycle
onEvalJS(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 bot
login(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.
methods
api.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.getSuppliesData
- Returns 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()) .5
api.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) (tile above you)
api.isNewCycle()
- When run repeaditely it will return true when it is a new cycle.
- Ex.
from time import sleep while True: if api.isNewCycle(): code to be run every cycle sleep(.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') (your username)
api.sendPacket(packet)
- Sends a packet to the server.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for thetravelers.online Api-1.3.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f140f9cfc9623eb279d27e8111714472926ec5093db3a2b3067cde1e52647d17 |
|
MD5 | 037385d4972f5d96a750bb9771076856 |
|
BLAKE2b-256 | 6d2a9d2c8c6b301c95de1797839cceb268f5e52a496a2246d3d3c3180fb5c1cd |
Close
Hashes for thetravelers.online_Api-1.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d81035103e3033946329254d174437f635f6334563e64f3f8d867e9766ff4ba |
|
MD5 | 261fd8f82550d63eb237199468446844 |
|
BLAKE2b-256 | 7f9c9329f2356488b90686c6a8c67e49aa7fa8d983a021c70170a545b4cbe88f |