Open chrisk123999 opened 11 years ago
(Effectively) the same as https://github.com/urbanyoung/Phasor/issues/42
Not really, as that one would only be saving specific info, I want to make it run stuff in the other script.
From an implementation point-of-view they're pretty much the same. In his request you'd do something like override("isadmin", "my_isadmin")
and yours would be register("isadmin", "my_isadmin")
But what if I want to do something that doesn't replace a phasor function? As I'd like to be able to call functions from my stat tracker in my admin script.
Oh right, yeah it'd be register("mynewfunc")
How about instead of having the script register it's own function, let the other script simply called the script name and function. So it would be more like: local some_var = callscript("scriptName", "functionName")
This would allow me to make scripts that extend the functionality of other scripts. This would allow me to add extra info to my admin script by reading the already collected stats from the stat tracker script. This would also most likely need another function to check if the script is loaded in the first place.
Yeah that could work, I'd need to add another function where scripts can specify their name, but that's not really an issue. So, like
function OnScriptLoad()
setname("myAdminScript")
end
... other script ...
callscript("myAdminScript", "someFunction")
That sounds good.
My suggestion was meant for any function you've written in Lua to be able to be saved to Phasor; I just used overriding a Phasor function as an example.
Edit: Read this issue before reading the updated comments on my own; apologies for the redundancy.
[03:18] =CE= Chris [Equal]: think you could add sommething to that would let us call a function from another currently running script? but isn't done with an include [03:18] =CE= Chris [Equal]: cause my script makes it's own admin system [03:18] =CE= Chris [Equal]: but I'd like a way to let other scripts interface with it somehow [03:18] Oxide: Nuggets has requested a similar feature - overriding Phasor funcs for all scripts [03:19] =CE= Chris [Equal]: I mostly need it just so I can have one script check my admin script to see if they're allowed to do certain commands [03:20] Oxide: Yeah, I do plan to add something like that (yours and nuggets' requests are effectively the same thng) [03:20] =CE= Chris [Equal]: however mine would be to call a function in it, not just simply replace a command