Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected end of JSON input #24

Open
standerksen opened this issue Feb 22, 2023 · 8 comments
Open

Unexpected end of JSON input #24

standerksen opened this issue Feb 22, 2023 · 8 comments

Comments

@standerksen
Copy link

Following up on #18, I still get this error when I run npm run collect. Issue exists for ts7.x1.international.travian.com server.

> [email protected] collect
> node src/scripts/collectOasysPosition.js

P:\TravianElephantFinder\node_modules\jsonfile\index.js:67
      throw err
      ^

SyntaxError: data/oasis.json: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object.readFileSync (P:\TravianElephantFinder\node_modules\jsonfile\index.js:63:17)
    at Object.<anonymous> (P:\TravianElephantFinder\src\scripts\collectOasysPosition.js:11:30)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47

I installed by using yarn install and npm run preinstal-windows. I have correctly set the .env file (correct server) and pasted my cookie in src/config/cookie.txt.

@Kopilut
Copy link
Contributor

Kopilut commented Oct 16, 2023

You will find this script working on my fork. Using 'fs.createWriteStream' before writing was a problem in src/scripts/cleanData.js

@Tegos
Copy link
Owner

Tegos commented Oct 16, 2023

Could you create pull request @BeneAlgirdas ?

@Kopilut
Copy link
Contributor

Kopilut commented Oct 16, 2023

Oh, hello. Just created one. Do you mean this project is still maintained? :D How about new features such as coordinates wrapping (when from e.g. y -200 it goes around decrementing from 200, from the top)?

@Tegos
Copy link
Owner

Tegos commented Oct 16, 2023

Hello. Yes, not so active, but still maintained. You may implement by yourself or describe feature and I'll try to add. :)

@cheryiit
Copy link

is it working now ? :)

@Tegos
Copy link
Owner

Tegos commented Mar 15, 2024

@cheryiit hello. Yes, should work. Did you try? 😄

@cheryiit
Copy link

There is no AjaxToken now whats the token?
And for more less ban risk, maybe it should be first
login api request then auth dorf1 map page and then mape api's maybe 🤔

LOGIN_API = "/api/v1/auth/login"
AUTH_API = "/api/v1/auth/"
MAIN_PAGE = "/dorf1.php"
MAP_PAGE = "/karte.php"
MAP_API = "/api/v1/map/position"

I am currently working on huge thing like a automaticly given best oasis to attack for x,y coordinates and with their attack links

@Tegos
Copy link
Owner

Tegos commented Mar 17, 2024

Hello, @cheryiit. I will check auth mechanism.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@Tegos @standerksen @Kopilut @cheryiit and others