Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
LemADEC

OC support in WarpDrive mod

Question

While updating my WarpDrive mod preloaded LUA scripts, I've noted a few issues.

Issue #1:
As of OC 1.7.10-1.6.0-beta.1, autorun.lua scripts provided by my mod were automatically executed.
As of OC 1.7.10-1.6.2, the same scripts are no longer loaded when starting the computer. However, they'll run if I break/place my block.
From a LUA console, filesystem autorun is reported as enabled (filesystem.isAutorunEnabled() returns true).
If I "install" them, they are copied in / but still won't autorun. Same goes if I copy them in /home.

How are we supposed to have autorun now with OpenOS? Is there a wiki on how the boot sequence works?

Issue #2:
When connecting multiple version of the same block, each one will provide the same read-only filesystem from the same location.
However, OC API doesn't seem to detect them as equals and create a lot of filesystem components while only one is actually necessary.
Is it the intended behavior? How can I declare the filesystem as being actually the same?

Here's a simplified version of my TileEntity code:

Quote

 

Node     OC_node = null;
boolean  OC_addedToNetwork = false;
ManagedEnvironment OC_fileSystem = null;

public void updateEntity() {
   super.updateEntity();
   
   if (!OC_addedToNetwork) {
      OC_addedToNetwork = true;
      Network.joinOrCreateNetwork(this);
   }
}


public void validate() {
   OC_node = Network.newNode(this, Visibility.Network).withComponent(peripheralName).create();

   OC_fileSystem = FileSystem.asManagedEnvironment(FileSystem.fromClass(getClass(), WarpDrive.MODID.toLowerCase(), "lua.OpenComputers/" + peripheralName), peripheralName);
   ((Component) OC_fileSystem.node()).setVisibility(Visibility.Network);

   super.validate();
}

public void onConnectif instanceof OC_fileSystem;
public void onDisconnectif instanceof // Disconnecting from a single computer
OC_fileSystem;
else if OC_node// Disconnecting from the network
OC_fileSystem;
   

Issue #3:

I've added a common library to all my scripts. When placed next to the autorun.lua script, it'll only find it when I change to that folder first.

It appears the autorun is called without setting current directory to it, is that intended?

Using the OpenOS install command does copy some files, but the library doesn't get installed in /lib or something.

How can I install my library automatically?

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.