Do I have to leave the tab open to run my script?
this is probably a dumb question But can I close the tab/turn off my pc while I'm running the script, or will that just stop the script?
yeah you do.
Unless you make a 'keepalive' script:
where you make an HTTP server so it can run on its own for an hour or so.
or just the always on option:
Depends on what you mean by "script". If you're talking about replit, then yes, you need to be on the page to keep a process running. After about five minutes of you not being on the repl, it will close itself. This does not apply to repls that are HTML, CSS, and JS because they are static webpages.