Closed byoxygen closed 2 years ago
Is the room script written in TypeScript? I do not recognize .append
method and File
in TypeScript.
What extension this file has?
Is the room script written in TypeScript? I do not recognize
.append
method andFile
in TypeScript.What extension this file has?
Hi @jakjus, I want to get .hbr files from DC but my code isn't work on haxball.js. I don't know how to run it.
Original code is here: https://github.com/hbenormous/haxball-headless-help/blob/main/scripts/enviar-rec.js
This repository is not using haxball.js.
But as I know haxball.js - it is not using browser JavaScript, but NodeJS. So, some browser functions might be missing. To migrate these "missing" functions, try to Google it, like: "NodeJS File is not defined" or "NodeJS Xmlhttprequest" or whatever you need.
Here is what I found for File is not defined: https://stackoverflow.com/questions/48237766/file-is-not-defined-error-in-javascript-while-executing-from-node-js-command-p Here is what I found for XmlHttpRequest: https://stackoverflow.com/questions/34514363/how-to-use-xhr-api-in-node-js
You would have to use different ways to create and send this data from NodeJS script, it seems.
That's all I can help you with. Good luck 🎉
Hi @jakjus,
Many thanks for your helps. I tried these steps before but unfortunately it didn't work so.
I guess it is not possible to run with TS.
Ah, so I thought that you have an issue with haxball.js
. But, if it's an issue with this repo, I'll research it further.
File
interface is implemented in TypeScript's library: WebWorker
Trying to reproduce it, I have added function, that you have provided, to src/room.ts
(in onPlayerChat - for fast debug purposes).
It does not show any in-editor error. It has compiled successfully. It worked in a browser environment.
Screenshot from editor:
Second question - what steps did you take in order to run this script and where did you run it? If you ran it in the browser on https://haxball.com/headless website (correct), what browser are you using?
Closing (inactive and can't reproduce).
Hi mate,
Why i am getting this error in your browser?
Please solve it.