ComputerCraft Forums

ComputerCraft => Ask a Pro => Topic started by: TheTinyDeskEngineer on Aug 21, 2021, 06:53 PM

Title: can loaded APIs have their own variables?
Post by: TheTinyDeskEngineer on Aug 21, 2021, 06:53 PM
I'm trying to make an API which keeps track of user input and allows for easily checking if a key is pressed, and I want to have tables that store what keys and mouse buttons are held down, but I can't find anything that mentions variables in APIs in any way.

I made a simple test function and I have found out that APIs can, indeed declare variables. I don't know why I didn't do that first.
Title: can loaded APIs have their own variables?
Post by: pjals_but_noisy on Aug 22, 2021, 01:39 PM
are you using os.loadAPI or require? (note: you should be using require because superglobals are bad)