Jump to content

[Lua] [API] getElementById(uid)


Broote

Recommended Posts

The core unit lets you get a list of element uids, and even get some information about those elements using the API.   But we cant DO anything with those elements.  If we could get an element object without directly linking it to the programming board it would be a huge help.  So I propose adding getElementById(uid) to the Core Unit APIs.

 

With this you can, when iterating through id's from getElementIdList(), find industry elements, and check status.  Are they jammed? Which ones? With this you could find out which of the hundreds of industry elements is actually not producing to do an 'internal server error' so you don't have to check them all manually after every server restart.  

 

You could also 'fix' them remotely with that same script because all you have to do is stop() then start() them again. Which would be simple to do if you already had the element as you are iterating through the list.  

 

This would circumvent the need to link everything directly, of which I do not know the impact.  Though currently you COULD achieve this by chain linking dozens of programming boards and data links, and writing one bear of a lua script to manage it.  And you would have to link every new industry placed to the 'system'.   Possible, but ridiculously inconvenient.  And solved by one API call addition described above.

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

you can do alot with this if it still exists

i used it to program all the boxes contents in my databanks using the old industry model (pre schematics)

with the core element iteration i could tell what boxes contained what with a bit of pre structuring on the entire construct

unknown.png

 

and then relay that to various screens displaying what the box contents and how full it was 

unknown.png

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...