Recent content by Darkmisc

  1. D

    Is it possible to use js variables in html while using Puppeteer?

    I wanted to use Puppeteer to get sports scores from a page and put them in a variable. I then wanted to use that variable to display updates for the scores in a popup.
  2. D

    How do I make Browserify work with Puppeteer?

    Hi everyone I am using Visual Studio Code with Node.js 18.17.1. I installed Puppeteer 22.5.0 with the following command: Npm install browserify -g I tried creating a bundle with the following command: Browserify index.js -o bundle.js This error message came up: Error: Can't walk...
  3. D

    Is it possible to use js variables in html while using Puppeteer?

    The console says index.js:2 Uncaught ReferenceError: require is not defined at index.js:2:19 (anonymous) @ index.js:2 The code that it refers to is const puppeteer = require("puppeteer") This is the part in sources that is underlined I think flow might not be an issue here. My js...
  4. D

    Is it possible to use js variables in html while using Puppeteer?

    Hi everyone I'm using Visual Studio Code and would like to use a variable from a JavaScript file in my html code. This is easy enough to do until I try using Puppeteer in the JS file. If I add the following line to the JS code, I can no longer call my JS variable in the html file. const...
  5. D

    How to install Cheerio in Visual Studio Code v 1.87.1

    Turns out it was a problem with package.json (thing mentioned in line 3) The first step in installation was to type "npm init". At the final step, it asked "Is this ok? (yes)". I was supposed to just hit enter, but I typed "y" then hit enter, which messed it up. This is why it later...
  6. D

    How to install Cheerio in Visual Studio Code v 1.87.1

    Hi everyone I've just started using Visual Studio Code and tried to install Cheerio using the "npm i cheerio" command. It gives me the following error messages. npm ERR! code EJSONPARSE npm ERR! path C:\Users\donbi\Downloads\scraper/package.json npm ERR! JSON.parse Unexpected token 'p'...
  7. D

    [Godot] Can I directly access files saved on Android to user:// ?

    The files shows up and can be loaded and deleted within the Android app. I can also find it on my PC and open it as a text file when I run the app within Godot. What I can't do is plug my phone into the PC and find the file on my phone in a directory.
  8. D

    [Godot] Can I directly access files saved on Android to user:// ?

    Hi everyone My program saves files to user://. I'd like to find these files on my phone and copy them to another phone. Is it possible? I used ProjectSettings.globalize_path("user://") to show where the file saved and got /data/org.godotengine.[APP_NAME]/files/ However, when I went to...
  9. D

    Can globals in Godot randomly fail to update?

    That's what I did. I didn't know I had to manually update Global.dict whenever I changed Global.arrayA (or arrayB). Now, I'm surprised it worked at all. I think it makes sense why lines 2 and 3 fix the problem now.
  10. D

    Can globals in Godot randomly fail to update?

    Hi everyone I'm making a game for memorising pairs of things entered by the user (e.g. countries and their capitals). If we're using countries and capitals, I'll store countries as an array in Globals.arrayA. Capitals get stored as Globals.arrayB. The two arrays are stored in globals as...
  11. D

    Automatically adjust font size in Godot to fit text in a label?

    Hi everyone So far as I can tell, there is no function to automatically shrink text to fit on one line within a label in Godot 4. Instead, I'm going to get the length of each string with len(string) and use Label.set("theme_override_font_sizes/font_size", size) to adjust the size according...
  12. D

    My app has a generic Android icon when I download it from Google Play

    I ended up fixing it, although I can't remember exactly how. I think I just needed to change one line in the xml file. I've been using only Godot for a few months, so I forgot a lot of what I used to do with Android Studio.
  13. D

    How to open a JSON file in Godot that contains 2 arrays?

    Nvm. I saved the two arrays into a dictonary and saved the dictionary without using JSON.
  14. D

    How to open a JSON file in Godot that contains 2 arrays?

    Hi everyone I've saved two arrays into a JSON file. This was the code I used: func save(): var file = FileAccess.open("user://savedarrays.json", FileAccess.WRITE) var file_path = "user://saved_arrays.json" var data = { "arrayA": Global.arrayA, "arrayB"...
Back
Top