r/ComputerCraft • u/SelectionRelevant221 • Feb 03 '26
How does one know what program ran a global function?
I'm wanting to know what script ran a custom global function, So that I can check if said script has the privilages to perform a certain task, I feel like this is pretty self-explanatory.
2
Upvotes
3
u/9551-eletronics Computercraft graphics research Feb 03 '26
This feels like a x,y problem, why do you want this
1
u/kukeiko64 Feb 03 '26
If that script is run from shell, you can check the contents of the global
arg[0]which contains the path to the program run via the shell.1
u/NortWind Feb 03 '26
Pass the caller's privilege level in as a parameter.