Skip to content

little example update worked with isan.to #3

Description

@mortifia

custom rework not user ready
modify:

  • settings.yaml
  • main (settings)
  • upload :
    -- import (json)
    -- move_ship (with jwt)

main L32

def main():
    settings.Variables.pytesseractPath = read_config("pytesseractPath")

    settings.Variables.displayName = read_config("displayName")

    settings.Variables.layerID = read_config("layerID")

    settings.Variables.layerName = read_config("layerName")

    settings.Variables.layerName = read_config("layerName")

    settings.Variables.saveImages = str(read_config("saveImages"))

    settings.Variables.doUpload = str(read_config("doUpload"))

    settings.Variables.jwt = str(read_config("jwt"))

    settings.Variables.id = str(read_config("id"))

settings:

#This is what you show as on Starmap.
displayName: 'user'
#Change this to where pytesseract is installed. If you need help, message IHaveNoLife#6972 on discord
pytesseractPath: D:\\Program Files\\Tesseract-OCR\\tesseract

#turning this on saves what the program sees to a png. It can cause SSD wear on rubbish SSD's, so be wary
saveImages: "False"

#Don't change this unless someone told you to
layerID: 'bcxwoIKlAUCSJAwq'
#This doesn't do anything. It'll be removed, but I'm currently in change freeze before release.
layerName: ''
doUpload: 'True'

jwt: 'your Bearer jwt'
id: 'your point id'

upload L13

def move_ship(x, y, z, layer, layerid):
    if settings.Variables.doUpload == "False":
        return
    Vars.latestOnlineX = x
    Vars.latestOnlineY = y
    Vars.latestOnlineZ = z
    headers = {"authorization": settings.Variables.jwt, "content-type": "application/json"} 
    data = json.dumps({"desc":"", "groupID": settings.Variables.layerID, "name": settings.Variables.displayName, "pos": {"x":int(x), "y":int(y), "z":int(z)}, #"pos": "{{x:{},y:{},z:{}}}".format(str(x), str(y), str(z)),
            "showPrev": False, "subtype": "Default", "type": "ship", "_id": settings.Variables.id})

    response = requests.post(Vars.baseUrl + "/editPoint", headers=headers, data=data)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions