Merge branch 'master-MC1.7.10' into rack-overhaul

Conflicts:
	assets/items.psd
	src/main/scala/li/cil/oc/common/inventory/InventoryProxy.scala
	src/main/scala/li/cil/oc/common/tileentity/Charger.scala
	src/main/scala/li/cil/oc/server/component/Server.scala
This commit is contained in:
Florian Nücke 2015-10-11 12:36:43 +02:00
commit 6bf5f709b8
335 changed files with 7154 additions and 913 deletions

View File

@ -25,7 +25,7 @@ This mod is [licensed under the **MIT license**](https://github.com/MightyPirate
If you would like to contribute better textures for certain items or blocks, feel free to pull-request them. If you would like to contribute *alternative* textures, make it a resource pack, and post it on the forums, for example.
3. **Documentation**
Help with keeping the [wiki][] up to date would be *really* appreciated. If you notice anything amiss and know better, fix it. If you don't ask someone who does, then fix it. If you had a question answered, consider adding that information somewhere in the wiki where you would have expected to find that information.
There are also the [files containing the ingame help][manpages], which could probably be much better than they are right now. Improvements to them, and new ones (e.g. for the libraries, such as `text` or `sides`) would help a lot. Thanks!
There are also the files containing the ingame help [for programs][manpages] and [for blocks and items][manual], which could probably be much better than they are right now. Improvements to them, and new ones (e.g. for the libraries, such as `text` or `sides`) would help a lot. Thanks!
4. **Robot Names**
Robots get a random name when placed (unless set with an Anvil). The list the names are chose from [can be found here][robot names]. Feel free to pull request additional names! *However*: since the list has grown to a considerable length already, here are the two basic criteria for new names: it must either be a real or fictional robot, or an AI that at least *appears* to be self-aware.
@ -99,7 +99,8 @@ In the case you wish to use Eclipse rather than IntelliJ IDEA, the process is mo
[jenkins]: http://ci.cil.li/
[localizations]: https://github.com/MightyPirates/OpenComputers/tree/master-MC1.7.10/src/main/resources/assets/opencomputers/lang
[loot]: https://github.com/MightyPirates/OpenComputers/tree/master-MC1.7.10/src/main/resources/assets/opencomputers/loot
[manpages]: https://github.com/MightyPirates/OpenComputers/tree/master-MC1.7.10/src/main/resources/assets/opencomputers/lua/rom/usr/man
[manpages]: https://github.com/MightyPirates/OpenComputers/tree/master-MC1.7.10/src/main/resources/assets/opencomputers/loot/OpenOS/usr/man
[manual]: https://github.com/MightyPirates/OpenComputers/tree/master-MC1.7.10/src/main/resources/assets/opencomputers/doc
[mcf]: http://www.minecraftforum.net/topic/2201440-opencomputers-v122/
[pack.mcmeta]: https://github.com/MightyPirates/OpenComputers/blob/master-MC1.7.10/src/main/resources/pack.mcmeta
[releases]: https://github.com/MightyPirates/OpenComputers/releases

Binary file not shown.

Binary file not shown.

View File

@ -45,12 +45,13 @@ def getGitRef() {
if (System.getenv("BUILD_NUMBER") != null)
version += ".${System.getenv("BUILD_NUMBER")}"
else
version += "-" + getGitRef()
if (config.oc.subversion != null && config.oc.subversion != "")
version += "-${config.oc.subversion}"
if (System.getenv("BUILD_NUMBER") == null)
version += "+" + getGitRef()
ext.simpleVersion = version
version = "MC${config.minecraft.version}-${project.version}"
@ -91,8 +92,8 @@ repositories {
url = "http://mobiusstrip.eu/maven"
}
maven {
name = "builtbroken"
url = "http://ci.builtbroken.com/maven/"
name = "dmodoomsirius"
url = "http://api.dmodoomsirius.me/"
}
maven {
name = "ue"
@ -186,7 +187,7 @@ dependencies {
provided "mcp.mobius.waila:Waila:${config.waila.version}_${config.minecraft.version}:dev"
provided "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev"
provided "net.sengir.forestry:forestry_${config.minecraft.version}:${config.forestry.version}:dev"
provided "notenoughkeys:NeK:${config.minecraft.version}-${config.nek.version}:deobf-dev"
provided "dev.modwarriors.notenoughkeys:NotEnoughKeys:${config.minecraft.version}-${config.nek.version}:deobf-dev"
provided "qmunity:QmunityLib:${config.qmunitylib.version}:deobf"
provided "tmech:TMechworks:${config.minecraft.version}-${config.tmech.version}:deobf"
provided ("mrtjp:ProjectRed:${config.projred.version}:dev") {

View File

@ -1,7 +1,7 @@
minecraft.version=1.7.10
forge.version=10.13.4.1448-1.7.10
oc.version=1.5.15
oc.version=1.5.18
oc.subversion=dev
ae2.version=rv2-beta-26
@ -32,7 +32,7 @@ mekanism.version=7.1.2
mfr.cf=2229/626
mfr.version=[1.7.10]2.8.0RC8-86
nei.version=1.0.3.57
nek.version=1.0.0b35dev
nek.version=2.0.0b4
projred.version=1.7.10-4.6.2.82
qmunitylib.version=0.1.105
rc.cf=2219/321
@ -46,4 +46,4 @@ wrcbe.version=1.4.1.2
cofhcore.cf=2246/697
cofhcore.version=[1.7.10]3.0.3B4-302-dev
maven.url=file:///home/www/maven.cil.li/web
maven.url=file:///home/www/maven.cil.li/web

Binary file not shown.

View File

@ -12,13 +12,14 @@ import li.cil.oc.api.detail.*;
*/
public class API {
public static final String ID_OWNER = "OpenComputers|Core";
public static final String VERSION = "5.5.3";
public static final String VERSION = "5.6.2";
public static DriverAPI driver = null;
public static FileSystemAPI fileSystem = null;
public static ItemAPI items = null;
public static MachineAPI machine = null;
public static ManualAPI manual = null;
public static NanomachinesAPI nanomachines = null;
public static NetworkAPI network = null;
public static Config config = null;

View File

@ -238,6 +238,29 @@ public final class IMC {
FMLInterModComms.sendMessage(MOD_ID, "registerWrenchTool", callback);
}
/**
* Register a callback for checking if an item is a wrench.
* <p/>
* This is used to determine whether certain item stacks are wrench items,
* which is used, for example, when "itemizing" a drone.
* <p/>
* The returned value must <tt>true</tt> if the item stack is a wrench,
* <tt>false</tt> otherwise.
* <p/>
* Signature of callbacks must be:
* <pre>
* boolean callback(ItemStack stack)
* </pre>
* <p/>
* Callbacks must be declared as <tt>packagePath.className.methodName</tt>.
* For example: <tt>com.example.Integration.callbackMethod</tt>.
*
* @param callback the callback to register as a wrench tool tester.
*/
public static void registerWrenchToolCheck(String callback) {
FMLInterModComms.sendMessage(MOD_ID, "registerWrenchToolCheck", callback);
}
/**
* Register a handler for items that can be charged.
* <p/>

View File

@ -0,0 +1,100 @@
package li.cil.oc.api;
import li.cil.oc.api.nanomachines.BehaviorProvider;
import li.cil.oc.api.nanomachines.Controller;
import net.minecraft.entity.player.EntityPlayer;
import java.util.Collections;
/**
* This API allows interfacing with nanomachines.
* <p/>
* It allows registering custom behavior providers as well as querying for all
* presently registered providers and getting a controller for a player.
*/
public class Nanomachines {
/**
* Register a new behavior provider.
* <p/>
* When a controller is reconfigured it will draw behaviors from all
* registered providers and build a new random connection graph to
* those behaviors.
*
* @param provider the provider to add.
*/
public static void addProvider(BehaviorProvider provider) {
if (API.nanomachines != null)
API.nanomachines.addProvider(provider);
}
/**
* Get a list of all currently registered providers.
*
* @return the list of all currently registered providers.
*/
public static Iterable<BehaviorProvider> getProviders() {
if (API.nanomachines != null)
return API.nanomachines.getProviders();
return Collections.emptyList();
}
/**
* Check whether a player has a nanomachine controller installed.
*
* @param player the player to check for.
* @return <tt>true</tt> if the player has a controller, <tt>false</tt> otherwise.
*/
public static boolean hasController(EntityPlayer player) {
if (API.nanomachines != null)
return API.nanomachines.hasController(player);
return false;
}
/**
* Get the nanomachine controller of the specified player.
* <p/>
* If the player has a controller installed, this will initialize the
* controller if it has not already been loaded. If the player has no
* controller, this will return <tt>null</tt>.
*
* @param player the player to get the controller for.
* @return the controller for the specified player.
*/
public static Controller getController(EntityPlayer player) {
if (API.nanomachines != null)
return API.nanomachines.getController(player);
return null;
}
/**
* Install a controller for the specified player if it doesn't already
* have one.
* <p/>
* This will also initialize the controller if it has not already been
* initialized.
*
* @param player the player to install a nanomachine controller for.
*/
public static Controller installController(EntityPlayer player) {
if (API.nanomachines != null)
return API.nanomachines.installController(player);
return null;
}
/**
* Uninstall a controller from the specified player if it has one.
* <p/>
* This will disable all active behaviors before disposing the controller.
*
* @param player the player to uninstall a nanomachine controller from.
*/
public static void uninstallController(EntityPlayer player) {
if (API.nanomachines != null)
API.nanomachines.uninstallController(player);
}
// ----------------------------------------------------------------------- //
private Nanomachines() {
}
}

View File

@ -0,0 +1,66 @@
package li.cil.oc.api.detail;
import li.cil.oc.api.nanomachines.BehaviorProvider;
import li.cil.oc.api.nanomachines.Controller;
import net.minecraft.entity.player.EntityPlayer;
public interface NanomachinesAPI {
/**
* Register a new behavior provider.
* <p/>
* When a controller is reconfigured it will draw behaviors from all
* registered providers and build a new random connection graph to
* those behaviors.
*
* @param provider the provider to add.
*/
void addProvider(BehaviorProvider provider);
/**
* Get a list of all currently registered providers.
*
* @return the list of all currently registered providers.
*/
Iterable<BehaviorProvider> getProviders();
/**
* Check whether a player has a nanomachine controller installed.
*
* @param player the player to check for.
* @return <tt>true</tt> if the player has a controller, <tt>false</tt> otherwise.
*/
boolean hasController(EntityPlayer player);
/**
* Get the nanomachine controller of the specified player.
* <p/>
* If the player has a controller installed, this will initialize the
* controller if it has not already been loaded. If the player has no
* controller, this will return <tt>null</tt>.
*
* @param player the player to get the controller for.
* @return the controller for the specified player.
*/
Controller getController(EntityPlayer player);
/**
* Install a controller for the specified player if it doesn't already
* have one.
* <p/>
* This will also initialize the controller if it has not already been
* initialized.
*
* @param player the player to install a nanomachine controller for.
* @return the controller for the specified player.
*/
Controller installController(EntityPlayer player);
/**
* Uninstall a controller from the specified player if it has one.
* <p/>
* This will disable all active behaviors before disposing the controller.
*
* @param player the player to uninstall a nanomachine controller from.
*/
void uninstallController(EntityPlayer player);
}

View File

@ -0,0 +1,27 @@
package li.cil.oc.api.driver.item;
import li.cil.oc.api.machine.Architecture;
import net.minecraft.item.ItemStack;
/**
* May be implemented in processor drivers of processors that can be reconfigured.
* <p/>
* This is the case for OC's built-in CPUs, for example, which can be reconfigured
* to any registered architecture. It a CPU has such a driver, it may also be
* reconfigured by the machine it is running in (e.g. in the Lua case via
* <tt>computer.setArchitecture</tt>).
*/
public interface MutableProcessor extends Processor {
/**
* Get a list of all architectures supported by this processor.
*/
java.util.Collection<Class<? extends Architecture>> allArchitectures();
/**
* Set the architecture to use for the specified processor.
*
* @param stack the processor to set the architecture for.
* @param architecture the architecture to use on the processor.
*/
void setArchitecture(ItemStack stack, Class<? extends Architecture> architecture);
}

View File

@ -0,0 +1,52 @@
package li.cil.oc.api.nanomachines;
/**
* Implemented by single behaviors.
* <p/>
* If you need a reference to the player this behavior applies to (which you'll
* probably usually want to have), pass it along from {@link BehaviorProvider#createBehaviors}.
*/
public interface Behavior {
/**
* A short name / description of this behavior.
* <p/>
* You can <em>not</em> use commas (<tt>,</tt>) or double quotes (<tt>"</tt>)
* in the returned string. If you do, they'll automatically be replaced with
* underscores.
* <p/>
* This is entirely optional and may even return <tt>null</tt>. It is made
* accessible via the controller's wireless protocol, to allow better
* automating reconfigurations / determining input mappings. In some cases
* you may not wish to make this possible, in those cases return <tt>null</tt>
* or a random string.
* <p/>
* Again, you can return whatever you like here, it's not used in mod internal
* logic, but only provided to ingame devices as a hint to make configuring
* nanomachines a little easier.
*
* @return the name to provide for this behavior, if any.
*/
String getNameHint();
/**
* Called when this behavior becomes active because all its required inputs
* are now satisfied.
* <p/>
* Use this to initialize permanent effects.
*/
void onEnable();
/**
* Called when this behavior becomes inactive.
* <p/>
* Use this to remove permanent effects.
*
* @param reason the reason the behavior is being disabled.
*/
void onDisable(DisableReason reason);
/**
* Called each tick while this behavior is active.
*/
void update();
}

View File

@ -0,0 +1,66 @@
package li.cil.oc.api.nanomachines;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
/**
* Implemented by providers for behaviors.
* <p/>
* You may implement one provider for each of your behaviors, or one provider
* for all of your behaviors; it really doesn't matter. This just allows for
* some logical grouping of behaviors, where desired.
* <p/>
* Each behavior provider must be capable or serializing the behaviors it
* creates, and re-create the behavior from its serialized form. It will
* not be given any hints as to whether a provided tag was originally
* produced by it, so you should add a sufficiently unique marker to the
* output NBT to allow identification later on. I recommend generating a
* UUID once, and using that. This is necessary to both save and restore
* neural connection state between saves without breaking the state when
* new behaviors are added, as well as to send states to the client.
*/
public interface BehaviorProvider {
/**
* Create all behaviors valid for the specified player.
* <p/>
* Note that this is only called on the server side when reconfiguring
* nanomachines. If you have a behavior that actually acts client-only,
* you still need to return it here, as it will be synchronized to the
* client using {@link #writeToNBT} and {@link #readFromNBT}.
*
* @param player the player the behaviors should be created for.
* @return list of new behaviors, may be <tt>null</tt>.
*/
Iterable<Behavior> createBehaviors(EntityPlayer player);
/**
* Write a behavior to NBT.
* <p/>
* This will only be called for behaviors originally created by this provider.
* <p/>
* This will only be called on the server. All behaviors not saved will be
* lost when loading again, they will <em>not</em> be regenerated using
* {@link #createBehaviors}, so make sure to save all your behaviors.
*
* @param behavior the behavior to serialize.
* @return the serialized representation of the specified behavior.
*/
NBTTagCompound writeToNBT(Behavior behavior);
/**
* Restore a behavior from NBT.
* <p/>
* You are <em>not</em> guaranteed that his nbt belongs to a behavior
* created by this provider! If the NBT cannot be handled, return
* <tt>null</tt>.
* <p/>
* This is called both on the server and the client; on the server it
* is called when restoring a saved player, on the client when
* synchronizing a configuration.
*
* @param player the player the behaviors should be created for.
* @param nbt the tag to restore the behavior from.
* @return the restored behavior, or <tt>null</tt> if unhandled.
*/
Behavior readFromNBT(EntityPlayer player, NBTTagCompound nbt);
}

View File

@ -0,0 +1,129 @@
package li.cil.oc.api.nanomachines;
/**
* The nanomachine controller is responsible for keeping track of the current
* layout of neural connections (i.e. how nanomachine "inputs" connect to
* behaviors, directly or indirectly).
* <p/>
* Each input can connect to one or more nodes. A node can either be a
* behavior, or an indirect connection, which in turn is connected to one
* or more behaviors (there is at maximum one layer of indirection). Each
* indirection may trigger one or more behaviors, but may also require one
* or more inputs to activate its outputs.
* <p/>
* Each node, input or indirection, will only connect to one or two other
* nodes, to keep randomization at a somewhat manageable level, but to still
* allow for some optimization by re-rolling the connections.
* <p/>
* This interface is not meant to be implemented externally. To get a reference
* to a controller, use {@link li.cil.oc.api.Nanomachines#getController}.
*/
public interface Controller {
/**
* Reconfigure the neural connections managed by this controller. This
* will lead to the system being unavailable for a short while, in which
* the neural connections are rebuilt in a new configuration. In addition,
* some debuffs will be applied to the player.
* <p/>
* This will reset all inputs to disabled and deactivate all previously
* active behaviors.
*
* @return the controller itself, for chaining / convenience.
*/
Controller reconfigure();
/**
* Get the number of inputs available.
* <p/>
* This number depends on the total number of behaviors available, to keep
* randomization at a manageable level. It is computed internally and
* based on a configuration value.
*
* @return the total number of available inputs.
*/
int getTotalInputCount();
/**
* Get the number of inputs that may be active at the same time
* before negative effects are applied to the player.
* <p/>
* The number of active inputs may exceed this value, but this will
* have negative effects on the player.
*
* @return the number of inputs that may safely be active at a time.
*/
int getSafeActiveInputs();
/**
* Get the total number of inputs that may be active at the same time.
* <p/>
* The number of active inputs cannot exceed this value.
*
* @return the number of inputs that may be active at a time.
*/
int getMaxActiveInputs();
/**
* Get whether the input with the specified index is active.
*
* @param index the input index.
* @return whether the input is active.
* @throws IndexOutOfBoundsException if <code>index &lt; 0</code> or <code>index &gt;= getInputCount</code>.
*/
boolean getInput(int index);
/**
* Set the state of the input with the specified index.
* <p/>
* This will fail if too many inputs are active already. It will also
* always fail when called on the client.
*
* @param index the input index.
* @param value whether the input should be active.
* @return whether the input was changed successfully.
* @throws IndexOutOfBoundsException if <code>index &lt; 0</code> or <code>index &gt;= getInputCount</code>.
*/
boolean setInput(int index, boolean value);
/**
* Get the list of currently active behaviors, based on the current input states.
* <p/>
* Note that behaviors may behave differently depending on how many active
* inputs they have. Behaviors in the returned list will have at least one
* active input.
*
* @return the list of currently active behaviors. Never <tt>null</tt>.
*/
Iterable<Behavior> getActiveBehaviors();
/**
* Get the number of active inputs for the specified behavior.
*
* @param behavior the behavior to get the number of inputs for.
* @return the number of inputs active for the specified behavior.
*/
int getInputCount(Behavior behavior);
// ----------------------------------------------------------------------- //
/**
* The amount of energy stored by this nanomachine controller.
*/
double getLocalBuffer();
/**
* The maximum amount of energy stored by this nanomachine controller.
*/
double getLocalBufferSize();
/**
* Try to apply the specified delta to the controller's buffer.
* <p/>
* A negative value will drain energy from the buffer, a positive value
* will inject energy into the buffer.
*
* @param delta the amount of energy to consume or store.
* @return the remainder of the delta that could not be applied.
*/
double changeBuffer(double delta);
}

View File

@ -0,0 +1,23 @@
package li.cil.oc.api.nanomachines;
/**
* Enum with reasons why a nanomachine behavior was disabled.
* <p/>
* This allows some more context specific behavior in a more stable fashion.
*/
public enum DisableReason {
/**
* This covers things like players logging off or the controller being reset.
*/
Default,
/**
* Input state changed, leading to a behavior being disabled.
*/
InputChanged,
/**
* System has run out of energy and is powering down.
*/
OutOfEnergy
}

View File

@ -0,0 +1,52 @@
package li.cil.oc.api.prefab;
import li.cil.oc.api.nanomachines.Behavior;
import li.cil.oc.api.nanomachines.DisableReason;
import net.minecraft.entity.player.EntityPlayer;
/**
* Base class for behaviors, mostly useful to have less cluttered classes when
* you only need one or two of the methods in the interface.
* <p/>
* This implementation will also store the player the behavior was created for.
*/
public abstract class AbstractBehavior implements Behavior {
/**
* The player this behavior was created for.
*/
public final EntityPlayer player;
/**
* Pass along the player the behavior was created for here to have it stored
* for later use.
*
* @param player the player the behavior was created for.
*/
protected AbstractBehavior(EntityPlayer player) {
this.player = player;
}
/**
* Use this if you do not need the player reference in your implementation.
*/
protected AbstractBehavior() {
this(null);
}
@Override
public String getNameHint() {
return null;
}
@Override
public void onEnable() {
}
@Override
public void onDisable(DisableReason reason) {
}
@Override
public void update() {
}
}

View File

@ -0,0 +1,74 @@
package li.cil.oc.api.prefab;
import li.cil.oc.api.nanomachines.Behavior;
import li.cil.oc.api.nanomachines.BehaviorProvider;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
/**
* Example base implementation of nanomachine behavior provider.
* <p/>
* This class takes care of handling the unique identifier used to tell
* if a behavior is its own when loading from NBT.
*/
public abstract class AbstractProvider implements BehaviorProvider {
/**
* Unique identifier used to tell if a behavior is ours when asked to load it.
*/
protected final String id;
/**
* For the ID passed in here, it is suggested to use a one-time generated
* UUID that is hard-coded into your provider implementation. Take care to
* use a different one for each provider you create!
*
* @param id the unique identifier for this provider.
*/
protected AbstractProvider(String id) {
if (id == null) throw new NullPointerException("id must not be null");
this.id = id;
}
/**
* Called when saving a behavior created using this behavior to NBT.
* <p/>
* The ID will already have been written, don't overwrite it. Store
* any additional data you need to restore the behavior here, if any.
*
* @param behavior the behavior to persist.
* @param nbt the NBT tag to persist it to.
*/
protected void writeBehaviorToNBT(Behavior behavior, NBTTagCompound nbt) {
}
/**
* Called when loading a behavior from NBT.
* <p/>
* Use the data written in {@link #writeBehaviorToNBT} to restore the behavior
* to its previous state, then return it.
*
* @param player the player to restore the behavior for.
* @param nbt the NBT tag to load restore the behavior from.
* @return the restored behavior.
*/
protected abstract Behavior readBehaviorFromNBT(EntityPlayer player, NBTTagCompound nbt);
// ----------------------------------------------------------------------- //
@Override
public NBTTagCompound writeToNBT(Behavior behavior) {
NBTTagCompound nbt = new NBTTagCompound();
nbt.setString("provider", id);
writeBehaviorToNBT(behavior, nbt);
return nbt;
}
@Override
public Behavior readFromNBT(EntityPlayer player, NBTTagCompound nbt) {
if (id.equals(nbt.getString("provider"))) {
return readBehaviorFromNBT(player, nbt);
} else {
return null;
}
}
}

View File

@ -100,6 +100,12 @@ opencomputers {
# The radius in which computer beeps can be heard.
beepRadius: 16
# Position of the power indicator for nanomachines, by default left to the
# player's health, specified by negative values. Values in [0, 1) will be
# treated as relative positions, values in [1, inf) will be treated as
# absolute positions.
nanomachineHudPos: [-1, -1]
}
# Computer related settings, concerns server performance and security.
@ -126,10 +132,10 @@ opencomputers {
# happen.
startupDelay: 0.25
# The maximum size of the byte array that can be stored on EEPROMs.
# The maximum size of the byte array that can be stored on EEPROMs as executable data..
eepromSize: 4096
# The maximum size of the byte array that can be stored on EEPROMs.
# The maximum size of the byte array that can be stored on EEPROMs as configuration data.
eepromDataSize: 256
# The number of components the different CPU tiers support. This list
@ -459,8 +465,8 @@ opencomputers {
# screens. This also controls how frequent distributors revalidate their
# global state and secondary distributors, as well as how often the power
# converter queries sources for energy (for now: only BuildCraft). If set
# to 1, this would query every tick. The default queries every 20 ticks,
# or in other words once per second.
# to 1, this would query every tick. The default queries every 10 ticks,
# or in other words twice per second.
# Higher values mean more responsive power consumption, but slightly more
# work per tick (shouldn't be that noticeable, though). Note that this
# has no influence on the actual amount of energy required by computers
@ -566,6 +572,10 @@ opencomputers {
# The internal buffer size of the hover boots.
hoverBoots: 15000.0
# Amount of energy stored by nanomachines. Yeah, I also don't know
# where all that energy is stored. It's quite fascinating.
nanomachines: 100000
}
# Default "costs", i.e. how much energy certain operations consume.
@ -767,6 +777,16 @@ opencomputers {
# Per-byte cost for ECDSA operation is controlled by `complex` value,
# because data is hashed with SHA256 before signing/verifying
dataCardAsymmetric: 10.0
# Energy required for one transposer operation (regardless of the number
# of items / fluid volume moved).
transposer: 1
# Energy consumed per tick per active input node by nanomachines.
nanomachineInput: 0.5
# Energy consumed when reconfiguring nanomachines.
nanomachinesReconfigure: 5000
}
# The rate at which different blocks accept external power. All of these
@ -953,6 +973,101 @@ opencomputers {
relayAmountUpgrade: 1
}
# Nanomachine related values. Note that most of these are relative, as
# they scale with the number of total effects controlled by nanomachines,
# which may very much vary depending on other mods used together with OC.
# To configure this, you'll need to know how this works a bit more in-
# depth, so here goes: there are three layers, the behavior layer, the
# connector layer, and the input layer. The behavior layer consists of
# one node for each behavior provided by registered providers (by default
# these will be potion effects and a few other things). The connector
# layer merely serves to mix things up a little. The input layer is made
# up from nodes that can be triggered by the nanomachines. Each connector
# node has behavior nodes it outputs to, and gets signals from input nodes.
# Behavior nodes get signals from both the connector and the input layers.
# Reconfiguring builds up random connections. Some behaviors change what
# they do based on the number of active inputs (e.g. potion effects will
# increase their amplification value).
nanomachines {
# The relative amount of triggers available based on the number of
# available behaviors (such as different potion effects). For example,
# if there are a total of 10 behaviors available, 0.5 means there will
# be 5 trigger inputs, triggers being the inputs that can be activated
# via nanomachines.
triggerQuota: 0.4
# The relative number of connectors based on the number of available
# behaviors (see triggerQuota).
connectorQuota: 0.2
# The maximum number of inputs for each node of the "neural network"
# nanomachines connect to. I.e. each behavior node and connector node
# may only have up to this many inputs.
maxInputs: 2
# The maximum number of outputs for each node (see maxInputs).
maxOutputs: 2
# How many input nodes may be active at the same time before negative
# effects are applied to the player.
safeInputsActive: 2
# Hard maximum number of active inputs. This is mainly to avoid people
# bumping other nanomachines' inputs to max, killing them in a matter
# of (milli)seconds.
maxInputsActive: 4
# Time in seconds it takes for the nanomachines to process a command
# and send a response.
commandDelay: 1
# The distance in blocks that nanomachines can communicate within. If
# a message comes from further away, it'll be ignored. When responding,
# the response will only be sent this far.
commandRange: 2
# Range of the item magnet behavior added for each active input.
magnetRange: 8
# Radius in blocks of the disintegration behavior for each active input.
disintegrationRange: 1
# Whitelisted potions, i.e. potions that will be used for the potion
# behaviors nanomachines may trigger. This can contain strings or numbers.
# In the case of strings, it has to be the internal name of the potion,
# in case of a number it has to be the potion ID. Add any potion effects
# to make use of here, since they will all be disabled by default.
potionWhitelist: [
"potion.moveSpeed",
"potion.digSpeed",
"potion.damageBoost",
"potion.jump",
"potion.resistance",
"potion.fireResistance",
"potion.waterBreathing",
"potion.nightVision",
"potion.absorption",
"potion.blindness",
"potion.confusion",
"potion.digSlowDown",
"potion.harm",
"potion.hunger",
"potion.moveSlowdown",
"potion.poison",
"potion.weakness",
"potion.wither"
]
# How much damage the hungry behavior should deal to the player when the
# nanomachine controller runs out of energy.
hungryDamage: 5
# How much energy the hungry behavior should restore when damaging the
# player.
hungryEnergyRestored: 50
}
# 3D printer related stuff.
printer {
# The maximum number of shape for a state of a 3D print allowed. This is
@ -1190,6 +1305,11 @@ opencomputers {
# properties, i.e. througput, frequency and buffer size.
# Valid values are: 0 = none, 1 = tier 1, 2 = tier 2, 3 = tier 3.
serverRackSwitchTier: 1
# Enforced delay when changing a redstone emitting component's output,
# such as the redstone card and redstone I/O block. Lowering this can
# have very negative impact on server TPS, so beware.
redstoneDelay: 0.1
}
# Settings for mod integration (the mod previously known as OpenComponents).
@ -1247,6 +1367,11 @@ opencomputers {
# The recommended method is to use the database component instead.
allowItemStackNBTTags: false
}
buildcraft {
# Cost to convert a loot disk to another in the BuildCraft programming table.
programmingTableCost: 5000
}
}
# Settings that are intended for debugging issues, not for normal use.

View File

@ -0,0 +1,12 @@
[{
"includes": [
"traits/environment.json",
"traits/inventory.json",
"traits/powerAcceptor.json"
],
"nbt": {
"blacklist": [
"oc:adapter.blocks"
]
}
}]

View File

@ -0,0 +1,12 @@
[{
"includes": [
"traits/environment.json",
"traits/inventory.json",
"traits/powerAcceptor.json"
],
"nbt": {
"blacklist": [
"oc:remaining"
]
}
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["traits/environment.json"]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["traits/environment.json"]
}]

View File

@ -0,0 +1,9 @@
[{
"includes": [
"traits/computer.json",
"traits/inventory.json",
"traits/powerAcceptor.json",
"traits/redstone.json",
"traits/rotatable.json"
]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["case.json"]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["case.json"]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["case.json"]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["case.json"]
}]

View File

@ -0,0 +1,16 @@
[{
"includes": [
"traits/environment.json",
"traits/inventory.json",
"traits/powerAcceptor.json",
"traits/redstone.json",
"traits/rotatable.json"
],
"nbt": {
"blacklist": [
"chargeSpeed",
"hasPower",
"invertSignal"
]
}
}]

View File

@ -0,0 +1,14 @@
[{
"includes": [
"traits/environment.json",
"traits/inventory.json",
"traits/powerAcceptor.json"
],
"nbt": {
"blacklist": [
"oc:buffer",
"oc:queue",
"oc:total"
]
}
}]

View File

@ -0,0 +1,7 @@
[{
"includes": [
"traits/environment.json",
"traits/inventory.json",
"traits/rotatable.json"
]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["traits/environment.json"]
}]

View File

@ -0,0 +1,7 @@
[{
"includes": [
"traits/environment.json",
"traits/externalData.json",
"traits/rotatable.json"
]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["hologram.json"]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["hologram.json"]
}]

View File

@ -0,0 +1,8 @@
[{
"includes": ["traits/rotatable.json"],
"nbt": {
"blacklist": [
"oc:keyboard"
]
}
}]

View File

@ -0,0 +1,18 @@
[{
"includes": [
"traits/computer.json",
"traits/hub.json",
"traits/inventory.json",
"traits/powerAcceptor.json",
"traits/redstone.json",
"traits/rotatable.json"
],
"nbt": {
"blacklist": [
"oc:info",
"oc:snooper",
"oc:componentNodes",
"oc:outputs"
]
}
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["traits/environment.json"]
}]

View File

@ -0,0 +1,6 @@
[{
"includes": [
"traits/environment.json",
"traits/redstone.json"
]
}]

View File

@ -0,0 +1,6 @@
[{
"includes": [
"traits/environment.json",
"traits/powerAcceptor.json"
]
}]

View File

@ -0,0 +1,7 @@
[{
"nbt": {
"blacklist": [
"oc:connector"
]
}
}]

View File

@ -0,0 +1,16 @@
[{
"includes": [
"traits/environment.json",
"traits/inventory.json"
],
"nbt": {
"blacklist": [
"oc:active",
"oc:amountInk",
"oc:amountMaterial",
"oc:limit",
"oc:remaining",
"oc:total"
]
}
}]

View File

@ -0,0 +1,7 @@
[{
"includes": [
"traits/environment.json",
"traits/inventory.json",
"traits/rotatable.json"
]
}]

View File

@ -0,0 +1,8 @@
[{
"includes": ["traits/redstone.json"],
"nbt": {
"blacklist": [
"oc:redstone/node"
]
}
}]

View File

@ -0,0 +1,12 @@
[{
"includes": [
"traits/hub.json",
"traits/inventory.json",
"traits/powerAcceptor.json"
],
"nbt": {
"blacklist": [
"oc:componentNodes"
]
}
}]

View File

@ -0,0 +1,24 @@
[{
"includes": [
"traits/computer.json",
"traits/environment.json",
"traits/inventory.json",
"traits/redstone.json",
"traits/rotatable.json"
],
"nbt": {
"blacklist": [
"display",
"oc:components",
"oc:containers",
"oc:lightColor",
"oc:owner",
"oc:ownerUuid",
"oc:robot",
"oc:robotEnergy",
"oc:selectedSlot",
"oc:selectedTank",
"oc:storedEnergy"
]
}
}]

View File

@ -0,0 +1,14 @@
[{
"includes": [
"traits/environment.json",
"traits/externalData.json",
"traits/redstone.json",
"traits/rotatable.json"
],
"nbt": {
"blacklist": [
"oc:hasPower",
"oc:hadRedstoneInput"
]
}
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["screen.json"]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["screen.json"]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["screen.json"]
}]

View File

@ -0,0 +1,15 @@
[{
"includes": [
"traits/hub.json",
"traits/inventory.json",
"traits/powerAcceptor.json",
"traits/redstone.json",
"traits/rotatable.json"
],
"nbt": {
"blacklist": [
"oc:servers",
"oc:terminals"
]
}
}]

View File

@ -0,0 +1,7 @@
[{
"nbt": {
"blacklist": [
"oc:computer"
]
}
}]

View File

@ -0,0 +1,8 @@
[{
"nbt": {
"blacklist": [
"node",
"oc:node"
]
}
}]

View File

@ -0,0 +1,9 @@
[{
"nbt": {
"blacklist": [
"chunkX",
"chunkZ",
"dimension"
]
}
}]

View File

@ -0,0 +1,8 @@
[{
"nbt": {
"blacklist": [
"oc:plugs",
"oc:queue"
]
}
}]

View File

@ -0,0 +1,8 @@
[{
"ignoreInventoryContents": true,
"nbt": {
"blacklist": [
"oc:items"
]
}
}]

View File

@ -0,0 +1,9 @@
[{
"nbt": {
"blacklist": [
"oc:ae2power",
"oc:ic2power",
"oc:ic2cpower"
]
}
}]

View File

@ -0,0 +1,11 @@
[{
"nbt": {
"blacklist": [
"oc:rs.input",
"oc:rs.output",
"oc:rs.bundledInput",
"oc:rs.bundledOutput",
"oc:rs.rednetInput"
]
}
}]

View File

@ -0,0 +1,7 @@
[{
"rotation": {
"type": "nbtField",
"tag": "oc:yaw",
"format": "ForgeDirection"
}
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["traits/environment.json"]
}]

View File

@ -0,0 +1,7 @@
[{
"includes": [
"traits/environment.json",
"traits/redstone.json",
"traits/rotatable.json"
]
}]

View File

@ -2,6 +2,8 @@
![AAA](oredict:oc:accessPoint)
*This block is deprecated and will be removed in a future version.* Craft it into a [relay](relay.md) to avoid losing it.
The access point is the wireless version of the [switch](switch.md). It can be used to separate subnetworks so that machines in them will not see [components](../general/computer.md) in other networks, while still allowing to send network messages to the machines in other networks.
In addition to that, this block can act as a repeater: it can re-send wired messages as wired messages to other devices; or wireless messages as wired or wireless messages.

View File

@ -26,6 +26,7 @@ Keep in mind that some of these may not be available, depending on the recipe se
* [Geolyzer](geolyzer.md)
* [Motion Sensor](motionSensor.md)
* [Redstone I/O](redstone.md)
* [Transposer](transposer.md)
* [Waypoint](waypoint.md)
## Assembly / Printing
@ -36,10 +37,9 @@ Keep in mind that some of these may not be available, depending on the recipe se
* [Disassembler](disassembler.md)
## Networking
* [Access Point](accessPoint.md)
* [Cable](cable.md)
* [Net Splitter](netSplitter.md)
* [Switch](switch.md)
* [Relay](relay.md)
## Power management
* [Capacitor](capacitor.md)

View File

@ -2,6 +2,6 @@
![*.net *.split](oredict:oc:netSplitter)
The net splitter is a device that allows controlling connectivity between subnetworks. Unlike the [switch](switch.md) or [power converter](powerConverter.md) it directly connects adjacent subnetworks, i.e. components can be accessed. Each side's connectivity can be toggled using a wrench (e.g. the [scrench](../item/wrench.md)). When a redstone signal is applied to the net splitter, all sides' connectivity is inverted.
The net splitter is a device that allows controlling connectivity between subnetworks. Unlike the [relay](relay.md) or [power converter](powerConverter.md) it directly connects adjacent subnetworks, i.e. components can be accessed. Each side's connectivity can be toggled using a wrench (e.g. the [scrench](../item/wrench.md)). When a redstone signal is applied to the net splitter, all sides' connectivity is inverted.
This block can therefore be used to toggle connectivity to certain parts of a component network. Use a [redstone I/O block](redstone.md) or [redstone cards](../item/redstoneCard1.md) to automate the net splitter.

View File

@ -0,0 +1,13 @@
# Relay
![Building bridges.](oredict:oc:relay)
The relay can be used to allow different subnetworks to send network messages to each other, without exposing components to [computers](../general/computer.md) in other networks. Keeping components local is usually a good idea, to avoid [computers](../general/computer.md) using the wrong [screen](screen1.md) or to avoid component overflows to happen (causing [computers](../general/computer.md) to crash and refuse to boot up).
The relay can be upgraded by inserting a [wireless network card](../item/wlanCard.md) to also relay messages wirelessly. Wireless messages can be received and relayed by other relays with a wireless network card, or by [computers](../general/computer.md) with a wireless network card.
Alternatively the relay can be upgraded using [linked cards](../item/linkedCard.md). In this case it will forward messages through the tunnel provided by the linked card, too; at the usual cost, so make sure the relay is sufficiently powered.
Relays do *not* keep track of which packets they forwarded recently, so avoid cycles in your network or you may receive the same packet multiple times. Due to the limited buffer size of relays, sending messages too frequently will result in packet loss. You can upgrade your relays to increase the speed with which they relay messages, as well as their internal message queue size.
Packets are only re-sent a certain number of times, so chaining an arbitrary number of relays is not possible. By default, a packet will be re-sent up to five times.

View File

@ -6,4 +6,4 @@ A server rack houses up to four [servers](../item/server1.md). A [server](../ite
Each [server](../item/server1.md) in a server rack can only communicate with one "face" of the server rack at a time - or none at all. Which side each [server](../item/server1.md) is connected to can be configured in the server rack's GUI. Beware that the sides are from the point of view of the server rack, i.e. if you are looking at the front of the server rack, `sides.right` will be to your left and vice versa.
Server racks act as [switch](switch.md) and [power distributor](powerDistributor.md) in one. The switch mode of the server rack can be configured in its GUI, with the two options being internal and external. In external mode the server rack will behave like a normal [switch](switch.md). In internal mode, messages are only passed to the [servers](../item/server1.md) in the rack, and will not be automatically relayed to the other faces of the rack. [Servers](../item/server1.md) will still be able to send messages to each other. This allows using server racks as advanced [switches](switch.md) that can perform filter and mapping operations, for example.
Server racks act as [relay](relay.md) and [power distributor](powerDistributor.md) in one. The switch mode of the server rack can be configured in its GUI, with the two options being internal and external. In external mode the server rack will behave like a normal [relay](relay.md). In internal mode, messages are only passed to the [servers](../item/server1.md) in the rack, and will not be automatically relayed to the other faces of the rack. [Servers](../item/server1.md) will still be able to send messages to each other. This allows using server racks as advanced [relays](relay.md) that can perform filter and mapping operations, for example.

View File

@ -2,6 +2,8 @@
![Building bridges.](oredict:oc:switch)
*This block is deprecated and will be removed in a future version.* Craft it into a [relay](relay.md) to avoid losing it.
The switch can be used to allow different subnetworks to send network messages to each other, without exposing components to [computers](../general/computer.md) in other networks. Keeping components local is usually a good idea, to avoid [computers](../general/computer.md) using the wrong [screen](screen1.md) or to avoid component overflows to happen (causing [computers](../general/computer.md) to crash and refuse to boot up).
There is also a wireless variation of this block, called the [access point](accessPoint.md), which will also relay messages wirelessly. Wireless messages can be received and relayed by other [access points](accessPoint.md), or by [computers](../general/computer.md) with a [wireless network card](../item/wlanCard.md).

View File

@ -0,0 +1,9 @@
# Transposer
![Such a poser.](oredict:oc:transposer)
The transposer bridges the gap between redstone controlled hoppers and [robots](robot.md), allowing [computer](../general/computer.md)-controlled transferral of items and fluids between adjacent blocks.
*Note that this block has no internal inventory.*
Besides moving things around, it can also be used to inspect the contents of the adjacent inventories, like an [adapter](adapter.md) with an [inventory controller upgrade](../item/inventoryControllerUpgrade.md) could, and the contents of adjacent tanks, like and adapter with a [tank controller upgrade](../item/tankControllerUpgrade.md) could.

View File

@ -0,0 +1,69 @@
# Headline with more lines [with link](redirect1.md) and *some* more
This is some test text for the subset of Markdown supported by the planned ingame documentation system for OpenComputers.
![This is a tooltip...](opencomputers:textures/gui/printer_ink.png)
![This is a tooltip...](opencomputers:/textures/gui/printer_material.png)
*This* is *italic* text, ~~strikethrough~~ maybe abc-ter **some** text **in bold**. Is _this underlined_? Oh, no, _it's also italic!_ Well, this [a link](../index.md).
![This is rendered live.](oredict:oc:assembler)
## Smaller headline [also with *link* but this __one__ longer](../block/adapter.md)
![This is another tooltip.](item:OpenComputers:item@23)
some text directly above the item stack renderer to test spacing
![All the colors.](oredict:craftingPiston)
some text directly below the item stack renderer to test spacing
This is *italic
over two* lines. But *this ... no *this is* **_bold italic_** *text*.
### even smaller
*not italic *because ** why would it be*eh
`test for code`
`that's not code yet`
`function f(a)`
` testingIndent(a)`
` do`
` lalala()`
` end`
`end`
yeah, line spacing is a bit low, but otherwise too little text fits on one screen.
this is some `code` that's inline. then `some more CODE that` line wraps and so on.
isn't*.
# not a header
* this is a list item and the text that will be wrapped will be indented appropriately
- this should also `work for code rendered text, if it doesn't i` will be a sad person
asdasd ![oh my god, the recursion!](img/example.png) qweqwe
And finally, [this is a link!](https://avatars1.githubusercontent.com/u/514903).
![broken item image](item:this is broken)
![broken item image](block:this is broken)
![broken item image](oredict:this is broken)
wrap testing
12345678901234567890.1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
`123456789012345678901234567890.12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890`
* 12345678901234567890.1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
- `123456789012345678901234567890.12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890`
this is a test for an![](oredict:oc:cpu1)an inline image kakakakalalsd 123 as
this is a test for an![](oredict:oc:cpu1)
an image with a break after it
this is a test for an
![](oredict:oc:cpu1)
an image between two lines
this is a test for an
![](oredict:oc:cpu1)
an image between two blank lines

View File

@ -2,4 +2,8 @@
![Reflux?](oredict:oc:materialAcid)
Encountered only when using hard-mode recipes, it is used to etch [circuit boards](circuitBoard.md) before crafting [printed circuit boards](printedCircuitBoard.md).
This tasty [citation needed] concoction can be consumed if you ever feel the need for some... fun. Or ruining your digestive tract. Or both. It can also serve as ingredient in other, more useful items.
One of the main uses, however, is to remove [nanomachines](nanomachines.md) from your system, if you no longer want them in you. Drinking this is the only way of getting rid of them!
When using hard-mode recipes, it is used to etch [circuit boards](circuitBoard.md) before crafting [printed circuit boards](printedCircuitBoard.md).

View File

@ -20,7 +20,7 @@ Keep in mind that some of these may not be available, depending on the recipe se
### Cards
* [AbstractBus Card](abstractBusCard.md)
* [Data Card](dataCard.md)
* [Data Card](dataCard1.md)
* [Debug Card](debugCard.md) (aka AMI)
* [Graphics Card](graphicsCard1.md)
* [Internet Card](internetCard.md)
@ -87,3 +87,4 @@ Keep in mind that some of these may not be available, depending on the recipe se
## Other
* [Hover Boots](hoverBoots.md)
* [Nanomachines](nanomachines.md)

View File

@ -2,4 +2,4 @@
![Enter the network.](oredict:oc:lanCard)
The network card allows [computers](../general/computer.md) to send and receive network messages. Messages (or packets) can be broadcasted to all receiving nodes in a subnetwork, or sent to a specific node with a specified address. [Switches](../block/switch.md) and [access points](../block/accessPoint.md) can be used to bridge multiple subnetworks by relaying messages between the subnetworks they are connected to. It is also possible to send a targeted message if the receiver is in another subnetwork, if the networks are connected via one or more [switches](../block/switch.md).
The network card allows [computers](../general/computer.md) to send and receive network messages. Messages (or packets) can be broadcasted to all receiving nodes in a subnetwork, or sent to a specific node with a specified address. [Relays](../block/relay.md) can be used to bridge multiple subnetworks by relaying messages between the subnetworks they are connected to. It is also possible to send a targeted message if the receiver is in another subnetwork, if the networks are connected via one or more [relays](../block/relay.md).

View File

@ -0,0 +1,33 @@
# Nanomachines
![Nanomachines, son.](oredict:oc:nanomachines)
These little guys interface with your nervous system to make you harder, better, faster, stronger, or kill you. Sometimes both at the same time! Put simply, nanomachines provide a power driven system for applying buffs (and debuffs) to the player they reside in. To "install" nanomachines, eat them!
Once injected, a new power indicator in your HUD will indicate how much energy your nanomachines have left to work with. You can recharge them by standing near a [charger](../block/charger.md). The more use you make of the nanomachines, the more energy they'll consume.
Nanomachines provide a certain number of "inputs" that can be triggered, causing many different effects on the player, ranging from visual effects such as particles spawning near the player, to select potion effects and some more rare and special behaviors!
Which input triggers what effect depends on the current configuration of the nanomachines, the actual "connections" being random per configuration. This means you'll have to try enabling different inputs to see what they do. If you're unhappy with a configuration, you can always reconfigure your nanomachines by injecting a new batch (just eat some more). To completely get rid of the nanomachines in you, consider drinking some [grog](acid.md). Beware that enabling too many inputs at a time has severe negative effects on you!
By default, the nanomachines will be on standby. You'll need to control them using wireless messages, so carrying a [tablet](tablet.md) with a [wireless network card](wlanCard.md) is strongly recommended. Nanomachines will only react to wireless signals emitted by devices no further than two meters away, but they will react to messages on any port, and from any device!
Nanomachines react to a simple, proprietary protocol: each packet must consist of multiple parts, the first of which is the "header" and must equal the string `nanomachines`. The second part must be the command name. Additional parts are parameters for the command. The following commands are available, formatted as `commandName(arg1, ...)`:
- `setResponsePort(port:number)` - Set the port nanomachines should send response messages to, for commands that have a response.
- `getPowerState()` - Request the currently stored and maximum stored energy of the nanomachines.
- `getHealth()` - Request the player's health state.
- `getHunger()` - Request the player's hunger state.
- `getAge()` - Request the player's age in seconds.
- `getName()` - Request the player's display name.
- `getExperience()` - Request the player's experience level.
- `getTotalInputCount()` - Request the total number of available inputs.
- `getSafeActiveInputs()` - Request the number of *safe* active inputs.
- `getMaxActiveInputs()` - Request the number of *maximum* active inputs.
- `getInput(index:number)` - Request the current state of the input with the specified index.
- `setInput(index:number, value:boolean)` - Set the state of the input with the specified index to the specified value.
- `getActiveEffects()` - Request a list of active effects. Note that some effects may not show up in this list.
For example, in OpenOS:
- `component.modem.broadcast(1, "nanomachines", "setInput", 1, true)` will enable the first input.
- `component.modem.broadcast(1, "nanomachines", "getHealth")` will get the player's health info.

View File

@ -2,6 +2,8 @@
![AAA](oredict:oc:accessPoint)
*Этот блок устарел и будет удален в следующих версиях.* Замените его на [ретранслятор](relay.md).
Точки доступа, это беспроводные версии [коммутаторов](switch.md). Они могут быть использованы, когда требуется разделить подсети, чтобы устройства не видели [компоненты](../general/computer.md) в других сетях, однако сохраняя при этом возможность передачи сообщений между подсетями.
В дополнение к этому, точки доступа могут использоваться как повторители: они могут перенаправлять сообщения из проводной линии другим устройствам; или беспроводные сообщения как проводные, так и беспроводные.

View File

@ -26,6 +26,7 @@
* [Геоанализатор](geolyzer.md)
* [Датчик движения](motionSensor.md)
* [Редстоун-I/O](redstone.md)
* [Транспозер](transposer.md)
* [Путевая точка](waypoint.md)
## Сборка / Печать
@ -39,6 +40,7 @@
* [Точка доступа](accessPoint.md)
* [Кабель](cable.md)
* [Сетевой переключатель](netSplitter.md)
* [Ретранслятор](relay.md)
* [Коммутатор](switch.md)
## Управление питанием

View File

@ -2,6 +2,6 @@
![*.net *.split](oredict:oc:netSplitter)
Сетевой переключатель позволяет контролировать соединение между подсетями. В отличие от [коммутатора](switch.md) или [конвертера энергии](powerConverter.md) позволяет непосредственно соединить подсети, делая при этом доступными все компоненты. Соединение каждой стороны переключается [ключем](../item/wrench.md). При подаче редстоун-сигнала все соединения инвертируются.
Сетевой переключатель позволяет контролировать соединение между подсетями. В отличие от [ретранслятора](relay.md) или [конвертера энергии](powerConverter.md) позволяет непосредственно соединить подсети, делая при этом доступными все компоненты. Соединение каждой стороны переключается [ключем](../item/wrench.md). При подаче редстоун-сигнала все соединения инвертируются.
Таким образом, этот блок может быть использован для переключения соединения определенных компонентов сети. Используйте [редстоун-I/O](redstone.md) или [редстоун карты](../item/redstoneCard1.md) для автоматизации сетевого переключателя.

View File

@ -0,0 +1,13 @@
# Ретранслятор
![Строит мосты.](oredict:oc:relay)
Ретранслятор используется для передачи сообщений между несколькими подсетями, изолируя компоненты [компьютеров](../general/computer.md) в других сетях. Сохранение компонентов, как правило, хорошая идея, что не позволяет [компьютерам](../general/computer.md) использовать неверный [монитор](screen1.md) или не позволяет перенагружать их (в результате чего [компьютеры](../general/computer.md) выключатся и отказываются загружаться).
Может быть улучшен добавлением [беспроводной сетевой карты](../item/wlanCard.md), что позволит ретранслировать беспроводные сообщения. Сообщения, переданные по беспроводной линии могут быть получены или перенаправлены другими ретрансляторами или [компьютерами](../general/computer.md) с [беспроводной сетевой картой](../item/wlanCard.md).
Также ретранслятор может быть улучшен с помощью [соединенной карты](../item/linkedCard.md). Это позволит передавать сообщения внутри туннеля, предоставленного картой, также; с обычными затратами энергии, поэтому убедитесь, что на ретранслятор поступает нужное количество энергии.
Ретрансляторы *не* отслеживают, какие пакеты и куда они передали, поэтому для в сети могут образовываться петли или вы можете получать одно сообщение несколько раз. Из-за ограниченного буфера сообщений коммутатора, частое отправление сообщений приводит к их потере. Вы можете улучшить ретранслятор для увеличения скорости обработки сообщений, а также увеличения размера сообщений.
Сообщения, могут перенаправлены всего несколько раз, поэтому цепочки с произвольным количеством ретрансляторов невозможны. По умолчанию, сообщение может быть перенаправлено пять раз.

View File

@ -6,4 +6,4 @@
Каждый [сервер](../item/server1.md) в серверной стойке может взаимодействовать только с одной "стороной" стойки или ни с какой. К какой стороне, какой [сервер](../item/server1.md) подключен, настраивается в интерфейсе стойки. Будьте внимательны, стороны считаются относительно самой стойки, например, если вы смотрите на стойку спереди, то `правая сторона` стойки для вас будет слева.
Серверные стойки взаимодействуют с [коммутаторами](switch.md) и [распределителями энергии](powerDistributor.md). Переключатель режимов работы стойки, может быть настроен в интерфейсе самой стойки, он имеет 2 режима: внешний и внутренний. Во внешнем режиме сервер будет работать как обычный [коммутатор](switch.md). Во внутреннем режиме, сообщения будут передаваться только к [серверам](../item/server1.md) в стойке и не будут автоматически связаны со сторонами стойки. [Серверы](../item/server1.md) все также будут иметь возможность передачи сообщений друг другу. Это позволяет использовать серверные стойки как продвинутые [коммутаторы](switch.md) для операций фильтрации и направления данных, например.
Серверные стойки взаимодействуют с [ретрансляторами](relay.md) и [распределителями энергии](powerDistributor.md). Переключатель режимов работы стойки, может быть настроен в интерфейсе самой стойки, он имеет 2 режима: внешний и внутренний. Во внешнем режиме сервер будет работать как обычный [ретранслятор](relay.md). Во внутреннем режиме, сообщения будут передаваться только к [серверам](../item/server1.md) в стойке и не будут автоматически связаны со сторонами стойки. [Серверы](../item/server1.md) все также будут иметь возможность передачи сообщений друг другу. Это позволяет использовать серверные стойки как продвинутые [ретрансляторы](relay.md) для операций фильтрации и направления данных, например.

View File

@ -2,6 +2,8 @@
![Строит мосты.](oredict:oc:switch)
*Этот блок устарел и будет удален в следующих версиях.* Замените его на [ретранслятор](relay.md).
Коммутатор используется для передачи сообщений между несколькими подсетями, не используя компоненты [компьютеров](../general/computer.md) в других сетях. Сохранение компонентов, как правило, хорошая идея, что не позволяет [компьютерам](../general/computer.md) использовать неверный [монитор](screen1.md) или не позволяет перенагружать их (в результате чего [компьютеры](../general/computer.md) выключатся и отказываются загружаться).
Также есть беспроводная версия коммутатора, называемая [точка доступа](accessPoint.md), с ее помощью сообщения передаются по беспроводной линии. Сообщения, переданные по беспроводной линии могут быть получены или перенаправлены другими [точками доступа](accessPoint.md) или [компьютерами](../general/computer.md) с [беспроводной сетевой картой](../item/wlanCard.md).

View File

@ -0,0 +1,9 @@
# Транспозер
![Такая проблемка.](oredict:oc:transposer)
Транспозер заполняет пробел между воронками, контролируемыми редстоун-сигналом и [роботами](robot.md), позволяя [компьютерам](../general/computer.md) контролировать перемещение предметов и жидкостей между соседними блоками.
*Данный блок не имеет внутреннего инвентаря.*
Кроме перемещения блоков, он также может быть использован для проверки содержимого соседних инвентарей, подобно [адаптеру](adapter.md) с [контроллером инвентаря](../item/inventoryControllerUpgrade.md), и содержимого соседних хранилищ жидкости, подобно адаптеру с [контроллером жидкости](../item/tankControllerUpgrade.md).

View File

@ -0,0 +1,69 @@
# Заголовок первого уровня [со ссылкой](redirect1.md) и *чем-то* еще
Это тестовый текст показывающий все многообразие оформления Markdown в игровой документации OpenComputers.
![Это всплывающее сообщение...](opencomputers:textures/gui/printer_ink.png)
![Это всплывающее сообщение...](opencomputers:/textures/gui/printer_material.png)
*Это* текст *курсивом*, ~~зачеркнутый~~ может быть abc-ter текст **немного** **жирный**. Это _подчеркнутый текст_? А, нет, _снова курсив!_ Хорошо, вот [ссылка](../index.md).
![А это полноценное описание.](oredict:oc:assembler)
## Заголовок второго уровня [снова со *ссылкой*, но __немного__ длиннее](../block/adapter.md)
![Это еще одно всплывающее сообщение.](item:OpenComputers:item@23)
какой-то текст, прямо над изображением, для тестирования отступов
![Все цвета.](oredict:craftingPiston)
какой-то текст, сразу под изображением, для тестирования отступов
Это *две
строки курсивом*. А *это ... нет *это* **_жирный текст_** *курсивом*.
### Еще меньший заголовок
*не курсив *потому, что ** не выделен с помощью *
`код`
`а это не код`
`function f(a)`
` testingIndent(a)`
` do`
` lalala()`
` end`
`end`
да, межстрочный интервал очень маленький, но иначе текст не помещается на экране.
Это некоторый `код` прямо в тексте. А это, `еще БОЛЬШЕ кода` прямо в тексте.
а это нет*.
# не заголовок
* а это элемент списка и он будет соответствующе сдвинуть
- а это должен быть `код, посреди текст, если это не так, значит Я` плохой человек
asdasd ![о нет, рекурсия!](img/example.png) qweqwe
И наконец, [это ссылка!](https://avatars1.githubusercontent.com/u/514903).
![Поврежденное изображение](item:повреждено)
![Поврежденное изображение](block:повреждено)
![Поврежденное изображение](oredict:повреждено)
тест обработки
12345678901234567890.1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
`123456789012345678901234567890.12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890`
* 12345678901234567890.1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
- `123456789012345678901234567890.12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890`
А это тест![](oredict:oc:cpu1) изображения в тексте kakakakalalsd 123 as
А это еще один тест![](oredict:oc:cpu1)
изображение не должно выводиться
А это еще один тест
![](oredict:oc:cpu1)
изображения между двумя пустыми строками
А это еще один тест
![](oredict:oc:cpu1)
изображения между двумя пустыми строками

View File

@ -2,4 +2,8 @@
![Отлив?](oredict:oc:materialAcid)
При использовании сложных рецептов, нужно использовать кислоту на [печатной плате](circuitBoard.md) перед созданием [отпечатанной печатной платы](printedCircuitBoard.md).
Это вкусная [в качестве приправы] смесь, которую можно употребить, ради... веселья. Или пищевого отравления. Или и то и другое. Также может быть ингредиентом в других, более полезных вещах.
Одно из основных применений это выведение [нанороботов](nanomachines.md) из организма, если, они вам больше не нужны. Это единственный повод избавиться от них!
При использовании усложненных рецептов, нужно использовать кислоту на [печатной плате](circuitBoard.md) перед созданием [отпечатанной печатной платы](printedCircuitBoard.md).

View File

@ -20,7 +20,7 @@
### Карты
* [Карта абстрактной шины](abstractBusCard.md)
* [Карта данных](dataCard.md)
* [Карта данных](dataCard1.md)
* [Отладочная карта](debugCard.md)
* [Видеокарта](graphicsCard1.md)
* [Интернет карта](internetCard.md)
@ -86,4 +86,5 @@
* [Корпус планшета](tabletCase1.md)
## Прочее
* [Реактивные ботинки](hoverBoots.md)
* [Реактивные ботинки](hoverBoots.md)
* [Нанороботы](nanomachines.md)

View File

@ -2,4 +2,4 @@
![Войди в сеть.](oredict:oc:lanCard)
Сетевая карта позволяет [компьютерам](../general/computer.md) отправлять и получать сетевые сообщения. Сообщения (или пакеты) будут отправлены всем принимающим устройствам в подсети или конкретной сетевой карте (после указания ее адреса). [Коммутаторы](../block/switch.md) и [точки доступа](../block/accessPoint.md) могут быть использованы для связи нескольких подсетей друг с другом, для передачи сообщений в них. Также возможно отправить письмо получателю, даже если он находится в другой подсети, если сеть подключена к одному или нескольким [коммутаторам](../block/switch.md).
Сетевая карта позволяет [компьютерам](../general/computer.md) отправлять и получать сетевые сообщения. Сообщения (или пакеты) будут отправлены всем принимающим устройствам в подсети или конкретной сетевой карте (при указании её адреса). [Ретрансляторы](../block/relay.md) могут быть использованы для связи нескольких подсетей друг с другом и передачи сообщений. Также возможно отправить письмо получателю, даже если он находится в другой подсети, если сеть подключена к одному или нескольким [ретрасляторами](../block/relay.md).

View File

@ -0,0 +1,33 @@
# Нанороботы
![Нанороботы, Карл.](oredict:oc:nanomachines)
Это миниатюрные устройства, которые интегрируются с вашей нервной системой, делая вас сильнее, лучше и быстрее или убьют вас. Иногда сразу! Проще говоря, нанороботы обеспечивают управляемую систему питания наделяющую игрока положительнымы (и отрицательнымы) способностями. Для "установки" нанороботов, съешьте их!
Однажды попав в организм, нанороботы добавляют новый индикатор энергии, который показывает, сколько энергии ваши нанороботы имеют. Вы можете перезарядить их, стоя у [зарядного устройства](../block/charger.md). Чем больше вы используете нанороботов, тем больше энергии они потребляют.
Нанороботы обеспечивают некоторое количество "контактов", которые могут быть активированы, накладывая на игрока различные эффекты, начиная с визуальных эффектов, таких как частицы, появляющиеся рядом с игроком и заканчивая эффектами от зелий, и некоторыми более редкими и особыми вещами!
Какой эффект получится при активации контакта зависит от текущей конфигурации нанороботов, связь между контактом и эффектом случайно для каждой конфигурации. Это означает, что потребуется активировать различные контакты, чтобы увидеть, что они делают. Если вам не повезло с конфигурацией, вы всегда можете переконфигурировать ваших нанороботов, добавив новых (просто съешьте еще). Если, вы хотите избавиться от них, выпейте [кислоту](acid.md), она выведет нанороботов из организма. Помните, большое количество активных контактов одновременно вредно для вашего организма!
По умолчанию, нанороботы находятся в режиме ожидания. Вы можете контролировать их с помощью беспроводных сообщений, [планшет](tablet.md) с [беспроводной сетевой картой](wlanCard.md) строго рекомендуется. Нанороботы реагирует только на беспроводные сигналы, источник которых находится не дальше двух метров, но они реагируют на все сообщения на любом порту и с любых устройств!
Нанороботы работают по простому проепритарному протоколу: каждый пакет может состоять из множества частей, первый это "заголовок" и он должен быть строкой с текстом `nanomachines`. Вторая часть должна быть командой. Дополнительные части это параметры для команды. Доступны следующие команды, форматированы как `имякоманды(аргумент1, ...)`:
- `setResponsePort(port:number)` - Устанавливает порт, на который будут отправляться ответные сообщения от нанороботов, для команд, требующих ответа.
- `getPowerState()` - Запрос текущего и максимального количества энергии нанороботов.
- `getHealth()` - Запрос состояния здоровья игрока.
- `getHunger()` - Запрос уровня голода игрока.
- `getAge()` - Запрос возраста игрока (в секундах).
- `getName()` - Запрос имени игрока.
- `getExperience()` - Запрос уровня опыта игрока.
- `getTotalInputCount()` - Запрос общего количества доступных контактов.
- `getSafeActiveInputs()` - Запрос количества *безопасных* активных контактов.
- `getMaxActiveInputs()` - Запрос *максимального* количества активных контактов.
- `getInput(index:number)` - Запрос текущего состояния контакта с указанным индексом.
- `setInput(index:number, value:boolean)` - Устанавливает указанный контакт в указанное состояние.
- `getActiveEffects()` - Запрос списка активных эффектов. Некоторые эффекты могут быть не показаны в этом списке.
Например, в OpenOS:
- `component.modem.broadcast(1, "nanomachines", "setInput", 1, true)` активирует первый контакт.
- `component.modem.broadcast(1, "nanomachines", "getHealth")` запрос информации о состоянии здоровья игрока.

View File

@ -36,6 +36,7 @@ tile.oc.screen2.name=Bildschirm (Stufe 2)
tile.oc.screen3.name=Bildschirm (Stufe 3)
tile.oc.serverRack.name=Serverschrank
tile.oc.switch.name=Switch
tile.oc.netSplitter.name=Net Splitter
tile.oc.waypoint.name=Wegpunkt
# Items
@ -157,6 +158,7 @@ oc:gui.Analyzer.AddressCopied=Adresse wurde in die Zwischenablage kopiert.
oc:gui.Analyzer.ChargerSpeed=§6Ladegeschwindigkeit§f: %s
oc:gui.Analyzer.ComponentName=§6Komponentenname§f: %s
oc:gui.Analyzer.Components=§6Anzahl verbundener Komponenten§f: %s
oc:gui.Analyzer.CopyToClipboard=In die Zwischenablage kopieren.
oc:gui.Analyzer.LastError=§6Letzter Fehler§f: %s
oc:gui.Analyzer.RobotName=§6Name§f: %s
oc:gui.Analyzer.RobotOwner=§6Besitzer§f: %s
@ -189,6 +191,9 @@ oc:gui.Chat.WarningPower=Es ist keine unterstützte, Strom erzeugende Mod verfü
oc:gui.Chat.WarningProjectRed=Die verwendete Version von Project: Red ist nicht mit OpenComputers kompatibel. Aktualisiere bitte deine Version von Project: Red.
oc:gui.Chat.WarningRecipes=Es gab Fehler beim Laden eines oder mehrerer Rezepte. Einige Gegenstände können unter Umständen nicht gefertigt werden. Bitte wirf einen Blick in deine Log-Datei für weitere Informationen.
oc:gui.Chat.WarningSimpleComponent=Eine Erweiterung (deine?) welche das §aSimpleComponent§f-Interface verwendet, hat etwas §efalsch gemacht§f. Komponentenlogik konnte nicht eingefügt werden. Bitte wirf einen Blick in deine Log-Datei für weitere Informationen.
oc:gui.Drive.Managed=Managed
oc:gui.Drive.Unmanaged=Unmanaged
oc:gui.Drive.Warning=§lWarnung§r: Umschalten der Modi führt zum Datenverlust.
oc:gui.Error.ComponentOverflow=Zu viele Komponenten sind mit dem Computer verbunden.
oc:gui.Error.InternalError=Interner Fehler, bitte sieh in der Logdatei nach. Das ist wahrscheinlich ein Bug.
oc:gui.Error.NoCPU=Im Computer ist kein Hauptprozessor (CPU) installiert.
@ -242,7 +247,7 @@ key.materialCosts=Materialkosten anzeigen
# Item / Block Tooltips
oc:tooltip.AccessPoint=Verhält sich wie ein Switch, aber empfängt zusätzlich Drahtlosnachrichten und leitet Pakete aus dem Festnetz drahtlos weiter.
oc:tooltip.AbstractBusCard=Erlaubt es, LIP-Pakete des Abstrakten Busses von §fStargateTech 2§7 zu senden und zu empfangen.
oc:tooltip.Acid=Eine hochgiftige Möchtegernflüssigkeit, wird üblicherweise nur von gewissen Piraten konsumiert. Dank ihrer korrosiven Eigenschaften ideal zum Bedrucken von Leiterplatten geeignet.
oc:tooltip.Acid=Eine hochgiftige Möchtegernflüssigkeit, wird üblicherweise nur von gewissen Piraten konsumiert. Mag sich aber auch zu anderen Zwecken eignen.
oc:tooltip.Adapter=Erlaubt es, Blöcke anzusteuern, die keine Komponentenblöcke sind, wie etwa reguläre Minecraft-Blöcke oder Blöcke anderer Mods.
oc:tooltip.ALU=Zählt Zahlen zum Zeitvertreib. Klingt komisch, is aber so.
oc:tooltip.Analyzer=Erlaubt es, Informationen über Blöcke anzuzeigen, wie zum Bleistift ihre §fAdresse§7 und ihren §fKomponentennamen§7.[nl] Erlaubt zudem, den Fehler anzuzeigen, der zu einem Computerabsturz geführt hat, falls der Computer nicht regulär heruntergefahren wurde.
@ -270,6 +275,9 @@ oc:tooltip.Disassembler=Zerlegt Gegenstände in ihre Einzelteile. §lWarnung§7:
oc:tooltip.Disk=Sehr einfaches Speichermedium, das verwendet werden kann, um Disketten und Festplatten zu fertigen.
oc:tooltip.DiskDrive.CC=ComputerCraft-Disketten werden §aauch unterstützt§7.
oc:tooltip.DiskDrive=Erlaubt es, Disketten zu lesen und zu beschreiben. Kann in Robotern installiert werden, um später Disketten einlegen zu können.
oc:tooltip.DiskUsage=Festplattennutzung: %s/%s Byte
oc:tooltip.DiskModeManaged=Modus: Managed
oc:tooltip.DiskModeUnmanaged=Modus: Unmanaged
oc:tooltip.Drone=Drohnen sind schlichte, flinke Aufklärungseinheiten mit limitierter Inventargröße.
oc:tooltip.DroneCase=Dieses Gehäuse wird verwendet, um Drohnen in der Elektronik-Werkbank zu bauen. Es bietet Platz für wenige Komponenten und kommt mit endsteinbetriebener Levitation.
oc:tooltip.EEPROM=Kleiner, programmierbarer Speicher für das BIOS, das Computer zum starten verwenden.
@ -334,6 +342,7 @@ oc:tooltip.TabletCase=Einfaches Gehäuse für Tablet-PCs. Kann in der Elektronik
oc:tooltip.Terminal=Erlaubt es, einen Server aus der Ferne zu steuern, so lange man sich in Reichweite des Servers befindet. Verhält sich wie Bildschirm und Tastatur in einem. Kann mit Shift-Rechtsklick an einen Server in einem Serverschrank gebunden werden.
oc:tooltip.TexturePicker=Dieses Werkzeug erlaubt es, eine Zeichenkette anzuzeigen, die die Oberfläche eines Blocks beschreibt und in Form-Definitionen für 3D-Drucker verwendet werden kann. Definiv keine Texturnamen, oh nein. Nix da.
oc:tooltip.Tier=§8Stufe %s
oc:tooltip.NetSplitter=Kann Netzwerke dynamisch verbinden. Die Konnektivität jeder Seite kann umgeschaltet werden, in dem man "Professionelle Wartungsarbeiten" mit einem Schraubenschlüssel durchführt. Sie kann auch mit einem Redstone-Signal an entsprechenden Seiten invertiert werden.
oc:tooltip.TooLong=Halte [§f%s§7] gedrückt für mehr Infos.
oc:tooltip.Transistor=Elementarer Baustein der meisten Computerkomponenten. Nicht zu verwechseln mit Steinelementaren.
oc:tooltip.UpgradeAngel=Erlaubt es Robotern, Blöcke in die Luft zu setzen, selbst wenn kein Referenzblock daneben existiert.
@ -361,7 +370,7 @@ oc:tooltip.WirelessNetworkCard=Erlaubt das drahtlose Senden von Netzwerknachrich
oc:tooltip.WorldSensorCard=Erlaubt es, Informationen über die Welt auszulesen, wie etwa Gravitation und ob die Atmosphäre atembar ist. Verwendung von Messergebnissen auf eigene Gefahr. Der Hersteller übernimmt keinerlei Garantie.
oc:tooltip.Wrench=Eine Mischung aus Schraubenzieher und Schraubenschlüssel, einfach zu benutzen, aber schwer zu meistern.
# Achievements
#Achievements
achievement.oc.adapter=Steck mich ein
achievement.oc.adapter.desc=Interagiert mit Blöcken aus anderen Mods, und sogar Vanilla-Minecraft!
achievement.oc.assembler=Wundervoll

View File

@ -3,7 +3,7 @@
# Use [nl] to for a line break.
# Blocks
tile.oc.accessPoint.name=Access Point
tile.oc.accessPoint.name=§cAccess Point§7
tile.oc.adapter.name=Adapter
tile.oc.assembler.name=Electronics Assembler
tile.oc.cable.name=Cable
@ -23,20 +23,22 @@ tile.oc.hologram2.name=Hologram Projector (Tier 2)
tile.oc.keyboard.name=Keyboard
tile.oc.microcontroller.name=Microcontroller
tile.oc.motionSensor.name=Motion Sensor
tile.oc.netSplitter.name=Net Splitter
tile.oc.powerConverter.name=Power Converter
tile.oc.powerDistributor.name=Power Distributor
tile.oc.print.name=3D Print
tile.oc.printer.name=3D Printer
tile.oc.raid.name=Raid
tile.oc.redstone.name=Redstone I/O
tile.oc.relay.name=Relay
tile.oc.robot.name=Robot
tile.oc.robotAfterimage.name=Robot
tile.oc.screen1.name=Screen (Tier 1)
tile.oc.screen2.name=Screen (Tier 2)
tile.oc.screen3.name=Screen (Tier 3)
tile.oc.serverRack.name=Server Rack
tile.oc.switch.name=Switch
tile.oc.netSplitter.name=Net Splitter
tile.oc.switch.name=§cSwitch§7
tile.oc.transposer.name=Transposer
tile.oc.waypoint.name=Waypoint
# Items
@ -98,6 +100,7 @@ item.oc.Microchip2.name=Microchip (Tier 3)
item.oc.MicrocontrollerCase0.name=Microcontroller Case (Tier 1)
item.oc.MicrocontrollerCase1.name=Microcontroller Case (Tier 2)
item.oc.MicrocontrollerCase3.name=Microcontroller Case (Creative)
item.oc.Nanomachines.name=Nanomachines
item.oc.NetworkCard.name=Network Card
item.oc.NumPad.name=Numeric Keypad
item.oc.Present.name=A little something...
@ -235,6 +238,7 @@ oc:container.Disassembler=Disassembler
oc:container.DiskDrive=Disk Drive
oc:container.Printer=Printer
oc:container.Raid=Raid
oc:container.Relay=Relay
oc:container.Server=Server
oc:container.ServerRack=Server Rack
oc:container.Switch=Switch
@ -247,7 +251,7 @@ key.materialCosts=Show Material Costs
# Item / Block Tooltips
oc:tooltip.AccessPoint=Acts like a Switch, but additionally receives wireless packets and relays wired packets wirelessly.
oc:tooltip.AbstractBusCard=Allows interacting with §fStargateTech 2§7's abstract bus by sending and receiving LIP packets.
oc:tooltip.Acid=A highly toxic pseudo-liquid, usually only consumed by certain pirates. Thanks to its corrosive nature it is perfectly suited for etching circuit boards.
oc:tooltip.Acid=A highly toxic pseudo-liquid, usually only consumed by certain pirates. May prove to be useful in other ways, too, however.
oc:tooltip.Adapter=Used to control non-component blocks, such as vanilla blocks or blocks from other mods.
oc:tooltip.ALU=Adds numbers so you don't have to. It might be better this way.
oc:tooltip.Analyzer=Used to display information about blocks, such as their §faddress§7 and §fcomponent name§7.[nl] Also displays the error that caused a computer to crash if it did not shut down normally.
@ -303,6 +307,7 @@ oc:tooltip.Microchip=The chip formerly known as Integrated Circuit. I have no id
oc:tooltip.Microcontroller=Microcontrollers are computers boiled down to the essentials. They are intended to take care of very specific tasks, running only a single program that is provided on the EEPROM built into them.[nl] §cCan not connect to external components.§7
oc:tooltip.MicrocontrollerCase=Base component for building microcontrollers. Place it into an assembler to add further components and assemble a microcontroller.
oc:tooltip.MotionSensor=Can detect movement of nearby living beings. Requires clear line-of-sight.
oc:tooltip.Nanomachines=Control unit and a bunch of nanomachines for ingestion, if you dare.
oc:tooltip.NetworkCard=Allows distant computers connected by other blocks (such as cable) to communicate by sending messages to each other.
oc:tooltip.PowerAcceptor=Energy conversion speed: §f%s/t§7
oc:tooltip.PowerConverter.BuildCraft=§fBuildCraft MJ§7: §a%s:%s§7
@ -328,6 +333,7 @@ oc:tooltip.RedstoneCard.RedNet=§fRedNet§7 is §asupported§7.
oc:tooltip.RedstoneCard.WirelessCBE=§fWireless Redstone (ChickenBones)§7 is §asupported§7.
oc:tooltip.RedstoneCard.WirelessSV=§fWireless Redstone (SlimeVoid)§7 is §asupported§7.
oc:tooltip.RedstoneCard=Allows reading and emitting redstone signals around the computer or robot.
oc:tooltip.Relay=Allows connecting different networks to each other. Only network messages will be passed along, components will not be visible through this. Use this to separate networks while still allowing communication using Network Cards, for example.
oc:tooltip.Robot=Unlike computers, robots can move around and interact with the world much like a player can.[nl] §cCan not connect to external components.§7
# The underscore makes sure this isn't hidden with the rest of the tooltip.
oc:tooltip.Robot_Level=§fLevel§7: §a%s§7
@ -345,6 +351,7 @@ oc:tooltip.Tier=§8Tier %s
oc:tooltip.NetSplitter=Acts as a dynamic connector. Connectivity of each side can be toggled by hitting it with a wrench. Connectivity of all sides can be inverted by applying a redstone signal.
oc:tooltip.TooLong=Hold [§f%s§7] for a detailed tooltip.
oc:tooltip.Transistor=A basic element in most other computer parts. It's a bit twisted, but it does the job.
oc:tooltip.Transposer=Allows automated transferral of items and fluids between adjacent inventories and fluid containers.
oc:tooltip.UpgradeAngel=Allows robots to place blocks in thin air, even if there is no point of reference.
oc:tooltip.UpgradeBattery=Increase the amount of energy a device can store, allowing it work longer without having to be recharged. [nl] Capacity: §f%s§7
oc:tooltip.UpgradeChunkloader=If a robot moves in a forest and no one is around to see it, does it really move? This upgrades makes sure it does. It keeps the chunk a device is in loaded, but continually consumes energy while active.
@ -444,6 +451,15 @@ achievement.oc.transistor.desc=Create a Transistor to get started. Then listen t
achievement.oc.wirelessNetworkCard=Signals
achievement.oc.wirelessNetworkCard.desc=Time to go where no packet has gone before.
# Death messages. Note that the number of entries here must match the number
# set in the actual damage source in code.
death.attack.oc.nanomachinesOverload.1=%s got too greedy.
death.attack.oc.nanomachinesOverload.2=%s had a nervous breakdown.
death.attack.oc.nanomachinesOverload.3=The nanomachines of %s went out of control.
death.attack.oc.nanomachinesHungry.1=%s was eaten by nanomachines.
death.attack.oc.nanomachinesHungry.2=%s didn't keep their nanomachines fed.
death.attack.oc.nanomachinesHungry.3=%s has been digested.
# NEI Integration
nei.options.inventory.oredict=Show OreDictionary names
nei.options.inventory.oredict.true=True

View File

@ -3,7 +3,7 @@
# Use [nl] to for a line break.
# Blocks
tile.oc.accessPoint.name=Точка доступа
tile.oc.accessPoint.name=§cТочка доступа§7
tile.oc.adapter.name=Адаптер
tile.oc.assembler.name=Сборщик роботов
tile.oc.cable.name=Кабель
@ -23,6 +23,7 @@ tile.oc.hologram2.name=Голографический проектор (2-ой
tile.oc.keyboard.name=Клавиатура
tile.oc.microcontroller.name=Микроконтроллер
tile.oc.motionSensor.name=Датчик движения
tile.oc.netSplitter.name=Сетевой переключатель
tile.oc.powerConverter.name=Преобразователь энергии
tile.oc.powerDistributor.name=Распределитель энергии
tile.oc.print.name=3D модель
@ -35,8 +36,8 @@ tile.oc.screen1.name=Монитор (1-ый уровень)
tile.oc.screen2.name=Монитор (2-ой уровень)
tile.oc.screen3.name=Монитор (3-ий уровень)
tile.oc.serverRack.name=Серверная стойка
tile.oc.switch.name=Коммутатор
tile.oc.netSplitter.name=Сетевой переключатель
tile.oc.switch.name=§cКоммутатор§7
tile.oc.transposer.name=Транспозер
tile.oc.waypoint.name=Путевая точка
# Items
@ -95,6 +96,7 @@ item.oc.Microchip2.name=Микрочип (3-ий уровень)
item.oc.MicrocontrollerCase0.name=Корпус микроконтроллера (1-ый уровень)
item.oc.MicrocontrollerCase1.name=Корпус микроконтроллера (2-ой уровень)
item.oc.MicrocontrollerCase3.name=Корпус микроконтроллера (Креатив)
item.oc.Nanomachines.name=Нанороботы
item.oc.NetworkCard.name=Сетевая карта
item.oc.NumPad.name=Цифровой блок
item.oc.Present.name=Маленькое что-то...
@ -188,6 +190,9 @@ oc:gui.Chat.WarningPower=Подходящие моды, предоставляю
oc:gui.Chat.WarningProjectRed=Вы используете версию Project: Red, несовместимую с OpenComputers. Попробуйте обновить Project: Red.
oc:gui.Chat.WarningRecipes=Произошла ошибка при загрузке одного или нескольких рецептов. Некоторые предметы не крафтятся. Проверьте логи, чобы узнать подробнее.
oc:gui.Chat.WarningSimpleComponent=Мод использует интрефейс §aSimpleComponent§f §eневерно§f. Логика компонента не может быть внедрена. Проверьте логи, чобы узнать подробнее.
oc:gui.Drive.Managed=Файловый режим
oc:gui.Drive.Unmanaged=Блочный режим
oc:gui.Drive.Warning=§lВнимание§r: переключение режимов очищает диск!
oc:gui.Error.ComponentOverflow=Слишком много компонентов подключено к компьютеру.
oc:gui.Error.InternalError=Внутренняя ошибка, пожалуйста посмотрите лог-файл. Возможно, это баг.
oc:gui.Error.NoCPU=Не установлен процессор.
@ -229,6 +234,7 @@ oc:container.Disassembler=Разборщик
oc:container.DiskDrive=Дисковод
oc:container.Printer=Принтер
oc:container.Raid=RAID
oc:container.Relay=Ретранслятор
oc:container.Server=Сервер
oc:container.ServerRack=Серверная стойка
oc:container.Switch=Коммутатор
@ -241,7 +247,7 @@ key.materialCosts=Показать стоимость в материалах
# Item / Block Tooltips
oc:tooltip.AccessPoint=Работает как коммутатор, но и с беспроводными сетями.
oc:tooltip.AbstractBusCard=Обеспечивает взаимодействие с абстрактной шиной из §fStargateTech 2§7 (отправка и приём LIP-пакетов).
oc:tooltip.Acid=Высокотоксичная псевдо-жидкость. Благодаря своей агрессивной природе она идеально подходит для травления печатных плат.
oc:tooltip.Acid=Высокотоксичная псевдо-жидкость. Однако, может быть полезна в некоторых операциях.
oc:tooltip.Adapter=Используется для контроля некомпонентных блоков, таких как обычные блоки или блоков из других модов.
oc:tooltip.ALU=Выполняет арифметические вычисления, так что вам не придётся возиться с ними.
oc:tooltip.Analyzer=Используется для отображения информации о блоках, такой как §fадрес§7 или §fимя компонента§7.[nl] Также отображает ошибку, вызвавшую сбой компонента.
@ -269,6 +275,9 @@ oc:tooltip.Disassembler=Разделяет предметы на исходны
oc:tooltip.Disk=Примитивный носитель, который может быть использован для создания постоянных запоминающих устройств.
oc:tooltip.DiskDrive.CC=§aПоддерживаются§7 дискеты из ComputerCraft.
oc:tooltip.DiskDrive=Позволяет читать и записывать дискеты. Может быть установлен в роботов, это позволит вставлять дискеты позже.
oc:tooltip.DiskUsage=Занято %s/%s байт
oc:tooltip.DiskModeManaged=Режим: файловый
oc:tooltip.DiskModeUnmanaged=Режим: блочный
oc:tooltip.Drone=Дроны это легкие и быстрые устройства, но с ограниченным инвентарем.
oc:tooltip.DroneCase=Корпус, предназначен для сборки дрона в сборщике. Вмещает малое количество компонентов.
oc:tooltip.EEPROM=Маленькое, программируемое хранилище, которое содержит BIOS, для запуска компьютеров.
@ -294,6 +303,7 @@ oc:tooltip.Microchip=Чип, ранее известный как интегра
oc:tooltip.Microcontroller=Микроконтроллеры это основа компьютеров. Они используются для выполнения специфических задач и могут работать только с одной программой, находящейся в EEPROM.[nl] §cНе могут взаимодействовать с внешними компонентами.§7
oc:tooltip.MicrocontrollerCase=Базовый компонент для создания микроконтроллеров. Положите в сборщик, добавьте компонентов и получите микроконтроллер.
oc:tooltip.MotionSensor=Может обнаружить движение ближайших живых существ. Требуется чистая линия видимости.
oc:tooltip.Nanomachines=Блок управления и кучка нанороботов для приему внутрь, если сможете.
oc:tooltip.NetworkCard=Позволяет соединить компьютеры, удалённые друг от друга, в сеть (к примеру, с помощью кабеля) для отправки сообщений между ними.
oc:tooltip.PowerAcceptor=Скорость преобразования энергии: §f%s/t§7
oc:tooltip.PowerConverter.BuildCraft=§fBuildCraft MJ§7: §a%s:%s§7
@ -319,6 +329,7 @@ oc:tooltip.RedstoneCard.RedNet=Мод §fRedNet§7 §aподдерживаетс
oc:tooltip.RedstoneCard.WirelessCBE=Мод §fWireless Redstone (ChickenBones)§7 §aподдерживается§7.
oc:tooltip.RedstoneCard.WirelessSV=Мод §fWireless Redstone (SlimeVoid)§7 §aподдерживается§7.
oc:tooltip.RedstoneCard=Позволяет принимать и излучать сигналы красного камня вокруг компьютера или робота.
oc:tooltip.Relay=Позволяет соединять различные сети между собой. Передаются только сообщения, компоненты между сетями недоступны. Используйте его для разделения сетей с возможностью пересылать сообщения между ними.
oc:tooltip.Robot=В отличие от компьютеров, роботы могут передвигаться и взаимодействовать с миром, как игрок.[nl] §cНе могут взаимодействовать с внешними компонентами.§7
# The underscore makes sure this isn't hidden with the rest of the tooltip.
oc:tooltip.Robot_Level=§fУровень§7: §a%s§7.
@ -336,6 +347,7 @@ oc:tooltip.Tier=§8Уровень %s
oc:tooltip.NetSplitter=Работает как переключатель. Соединение каждой стороны переключается ключем. При подаче сигнала красного камня все соединения инвертируются.
oc:tooltip.TooLong=Удерживайте [§f%s§7], чтобы отобразить описание.
oc:tooltip.Transistor=Базовый элемент для других частей компьютера. Он немного деформирован, но отлично выполняет свою работу.
oc:tooltip.Transposer=Позволяет автоматизировать перемещение блоков и жидкостей между соседними инвентарями и хранилищами жидкости.
oc:tooltip.UpgradeAngel=Позволяет роботам размещать блоки в воздухе, даже если отсутствует точка опоры.
oc:tooltip.UpgradeBattery=Увеличивает количество энергии, которую робот может хранить, это позволяет ему работать дольше без перезарядки.
oc:tooltip.UpgradeChunkloader=Если робот движется в лесу и никто его не видит, действительно ли он движется? Это улучшение гарантирует, что движется. Оно держит чанк, на котором находится робот, загруженным, но постоянно потребляет энергию.
@ -435,6 +447,15 @@ achievement.oc.transistor.desc=Создайте транзистор. Потом
achievement.oc.wirelessNetworkCard=Сигналы
achievement.oc.wirelessNetworkCard.desc=Время идти туда, где никогда не появлялся сигнал.
# Death messages. Note that the number of entries here must match the number
# set in the actual damage source in code.
death.attack.oc.nanomachinesOverload.1=%s был слишком жадным.
death.attack.oc.nanomachinesOverload.2=%s получил нервный срыв.
death.attack.oc.nanomachinesOverload.3=Нанороботы %s вышли из под контроля.
death.attack.oc.nanomachinesHungry.1=%s был съеден нанороботами.
death.attack.oc.nanomachinesHungry.2=%s не кормил нанороботов.
death.attack.oc.nanomachinesHungry.3=%s был переварен нанороботами.
# NEI Integration
nei.options.inventory.oredict=Показывать OreDictionary имена
nei.options.inventory.oredict.true=Да
@ -444,4 +465,4 @@ nei.usage.oc.Manual=Открыть руководство
# Waila Integration
option.oc.address=Адрес
option.oc.componentName=Название компонента
option.oc.energy=Энергия
option.oc.energy=Энергия

View File

@ -1,11 +1,105 @@
local shell = require("shell")
local fs = require("filesystem")
local args = shell.parse(...)
local shell_name = '-' .. fs.name(os.getenv("SHELL"))
local cmd_name = "cd"
local error_prefix = shell_name .. ": " .. cmd_name .. ": "
local args, ops = shell.parse(...)
local path = nil
local verbose = false
-- order of if blocks following POSIX specification on cd
-- this is not a complete support of the POSIX spec - I am
-- not supporting -L and -P options for differentiating between
-- logically and physically following symlink paths
-- but, we do support CDPATH
if #args == 0 then
io.write("Usage: cd <dirname>")
local home = os.getenv("HOME")
if not home then
io.stderr:write(error_prefix .. "HOME not set\n")
return 1
end
path = home
elseif args[1]:len() > 0 and args[1]:sub(1,1) == '/' then
path = args[1]
elseif args[1]:len() > 0 and args[1]:sub(1,1) == "." then
path = args[1]
elseif args[1] == '-' then
verbose = true
local oldpwd = os.getenv("OLDPWD");
if not oldpwd then
io.stderr:write(error_prefix .. "OLDPWD not set\n")
return 1
end
path = oldpwd
else
local result, reason = shell.setWorkingDirectory(shell.resolve(args[1]))
if not result then
io.stderr:write(reason)
local CDPATH = os.getenv("CDPATH")
if CDPATH then
for cd_path in CDPATH:gmatch("[^:]*:?") do
-- [^:]+ would be simpler but CDPATH can define
-- empty paths if the user wants to check . before
-- the end of the cdpath list
if cd_path and cd_path:len() > 0 then
-- remove trailing : now if it was matched
if cd_path:sub(-1) == ':' then
cd_path = cd_path:sub(1, -2)
end
-- if cd_path is empty (POSIX says null) then check ./
-- there is a case where we don't hit this if block for
-- an empty cd_path, i.e. CDPATH="" which SHOULD be considered
-- null for this purpose - but, that scenario would also act the
-- same as no CDPATH and test ./ independently - so we get the
-- same results. I've tested this on gentoo linux and confirmed
-- curiously, empty checks are not verbose
local empty_check = false
if cd_path == "" then
cd_path = "."
empty_check = true
end
-- concat / on cd_path if it doesn't have one
if cd_path:sub(-1) ~= '/' then
cd_path = cd_path .. '/'
end
local test_path = cd_path .. args[1]
-- resolve here because fs.exists doesn't
-- understand . and ..
test_path = shell.resolve(test_path)
if fs.exists(test_path) then
path = test_path
verbose = not empty_check
break
end
end
end
end
if not path then
path = args[1]
end
end
local resolved = shell.resolve(path)
if not fs.exists(resolved) then
io.stderr:write(error_prefix .. path .. ": No such file or directory\n")
return 1
end
path = resolved
local oldpwd = shell.getWorkingDirectory()
local result, reason = shell.setWorkingDirectory(path);
if not result then
io.stderr:write(error_prefix .. reason)
return 1
else
os.setenv("OLDPWD", oldpwd)
end
if verbose then
os.execute("pwd")
end

View File

@ -384,6 +384,10 @@ end
local args, options = shell.parse(...)
local history = {}
local function escapeMagic(text)
return text:gsub('[%(%)%.%%%+%-%*%?%[%^%$]', '%%%1')
end
local function getMatchingPrograms(baseName)
local result = {}
-- TODO only matching files with .lua extension for now, might want to
@ -391,7 +395,7 @@ local function getMatchingPrograms(baseName)
if not baseName or #baseName == 0 then
baseName = "^(.*)%.lua$"
else
baseName = "^(" .. baseName .. ".*)%.lua$"
baseName = "^(" .. escapeMagic(baseName) .. ".*)%.lua$"
end
for basePath in string.gmatch(os.getenv("PATH"), "[^:]+") do
for file in fs.list(basePath) do
@ -404,24 +408,25 @@ local function getMatchingPrograms(baseName)
return result
end
local function getMatchingFiles(baseName)
local result, basePath = {}
local function getMatchingFiles(basePath, name)
local resolvedPath = shell.resolve(basePath)
local result, baseName = {}
-- note: we strip the trailing / to make it easier to navigate through
-- directories using tab completion (since entering the / will then serve
-- as the intention to go into the currently hinted one).
-- if we have a directory but no trailing slash there may be alternatives
-- on the same level, so don't look inside that directory... (cont.)
if fs.isDirectory(baseName) and baseName:sub(-1) == "/" then
basePath = baseName
if fs.isDirectory(resolvedPath) and name:len() == 0 then
baseName = "^(.-)/?$"
else
basePath = fs.path(baseName) or "/"
baseName = "^(" .. fs.name(baseName) .. ".-)/?$"
baseName = "^(" .. escapeMagic(name) .. ".-)/?$"
end
for file in fs.list(basePath) do
for file in fs.list(resolvedPath) do
local match = file:match(baseName)
if match then
table.insert(result, fs.concat(basePath, match))
table.insert(result, basePath .. match)
end
end
-- (cont.) but if there's only one match and it's a directory, *then* we
@ -444,10 +449,21 @@ local function hintHandler(line, cursor)
-- first part and no path, look for programs in the $PATH
result = getMatchingPrograms(line)
else -- just look normal files
result = getMatchingFiles(shell.resolve(partial or line))
local partialPrefix = (partial or line)
local name = partialPrefix:gsub("/+", "/")
name = name:sub(-1) == '/' and '' or fs.name(name)
partialPrefix = partialPrefix:sub(1, -name:len() - 1)
result = getMatchingFiles(partialPrefix, name)
end
local resultSuffix = ""
if searchInPath then
resultSuffix = " "
elseif #result == 1 and result[1]:sub(-1) ~= '/' then
resultSuffix = " "
end
prefix = prefix or ""
for i = 1, #result do
result[i] = (prefix or "") .. result[i] .. (searchInPath and " " or "")
result[i] = prefix .. result[i] .. resultSuffix
end
table.sort(result)
return result

View File

@ -31,6 +31,16 @@ function term.clear()
cursorX, cursorY = 1, 1
end
function term.reset()
if term.isAvailable() then
local maxw, maxh = component.gpu.maxResolution()
component.gpu.setResolution(maxw, maxh)
component.gpu.setBackground(0x000000)
component.gpu.setForeground(0xFFFFFF)
term.clear()
end
end
function term.clearLine()
if term.isAvailable() then
local w = component.gpu.getResolution()

View File

@ -12,7 +12,7 @@ Most programs can be interrupted by pressing Ctrl+Alt+C.
Paste the contents of the clipboard using the middle mouse button or a configurable key (default: insert).
Computers will consume less power while idling - i.e. when os.sleep(n > 0.05) is called.
Screens will consume more power the more lit characters they display.
Most blocks act as 'cables' - use switches and power distributers to create separate networks.
Most blocks act as 'cables' - use relays and power distributors to create separate networks.
Welcome to the dark side - here, have some cookies.
Screens can display Unicode - paste the special chars or use unicode.char.
Run `help` or `man programname` for ingame help on programs shipped with OpenOS - start with `man man`.
@ -25,4 +25,4 @@ Have you tried turning it off and on again?
To disable this greeting, install OpenOS to a writeable medium and delete `/etc/motd`.
Did you know OpenComputers has a forum? No? Well, it's at http://oc.cil.li/.
Please report bugs on the Github issue tracker, thank you!
Beware of cycles when building networks, or you may get duplicate messages!
Beware of cycles when building networks, or you may get duplicate messages!

View File

@ -8,7 +8,7 @@ if #args == 0 then
until not read
else
for i = 1, #args do
local file, reason = io.open(args[i])
local file, reason = io.open(args[i],"rb")--TODO: make b an option
if not file then
io.stderr:write(reason .. "\n")
return

View File

@ -67,6 +67,8 @@ for n = 1, options.count do
end
if options.wait then
os.sleep(tonumber(options.wait))
else
os.sleep(0)
end
end

View File

@ -5,7 +5,8 @@ local text = require("text")
local args, options = shell.parse(...)
local function formatSize(size)
if not options.h then
size = tonumber(size) or size
if not options.h or type(size) ~= "number" then
return tostring(size)
end
local sizes = {"", "K", "M", "G"}

View File

@ -73,6 +73,7 @@ local code = ""
codeHandler = function(char)
if char == "[" then code = code .. char
elseif char == "0" then code = code .. char
elseif char == "3" then code = code .. char
elseif code == "[" and char == "A" then
charHandler = baseHandler
if y - 1 < 1 then return end
@ -139,6 +140,16 @@ codeHandler = function(char)
out:write(text)
out:close()
end
elseif code == "[3" and char == "~" then
charHandler = baseHandler
if x > unicode.len(lines[y]) then
lines[y] = lines[y] .. (lines[y + 1] or "")
table.remove(lines, y + 1)
render(y, atline + edith - y)
return
end
lines[y] = lines[y]:sub(1, x-1) .. lines[y]:sub(x+1)
render(y, 1)
else
charHandler = baseHandler
end
@ -149,7 +160,7 @@ baseHandler = function(char)
code = ""
charHandler = codeHandler
elseif char == "\n" then
line = lines[y]
local line = lines[y]
lines[y] = unicode.sub(line or "", 1, x - 1)
table.insert(lines, y + 1, unicode.sub(line or "", x))
x = 1

View File

@ -199,6 +199,8 @@ local commandList = {}
-- \x1b9[Row];[Col];[Height];[Width]F -- fill
-- \x1b9[Row];[Col];[Height];[Width];[Dest Row];[Dest Col]c -- copy
--Add fake gpu component for compat(?)
function charHandlers.control(char)
if char == "\x1b" then
commandList = {}

View File

@ -2,6 +2,21 @@ local network = require "network"
local computer = require "computer"
local args = {...}
local function formatSize(size)
size = tonumber(size) or size
if type(size) ~= "number" then
return tostring(size)
end
local sizes = {"", "K", "M", "G"}
local unit = 1
local power = 1024
while size > power and unit < #sizes do
unit = unit + 1
size = size / power
end
return math.floor(size * 10) / 10 .. sizes[unit]
end
local function align(txt)return txt .. (" "):sub(#txt+1)end
if #args < 1 then
@ -14,7 +29,7 @@ if #args < 1 then
local pktIn, pktOut, bytesIn, bytesOut = network.info.getInterfaceInfo(node)
print(" RX packets:"..tostring(pktIn))
print(" TX packets:"..tostring(pktOut))
print(" RX bytes:"..tostring(bytesIn).." TX bytes:"..tostring(bytesOut))
print(" RX bytes: ".. tostring(bytesIn) .. " (" ..formatSize(bytesIn).. ") TX bytes: " ..tostring(bytesOut) .. " (".. formatSize(bytesOut) .. ")")
end
elseif args[1] == "bind" and args[2] then
print("Address attached")

View File

@ -1,13 +1,28 @@
--Plan9k userspace init for pipes kernel
--TODO: pcall all + emergency shell(or do it higher, in pipes)
local pipes = require("pipes")
local component = require("component")
local filesystem = require("filesystem")
local component = require("component")
os.setenv("LIBPATH", "/lib/?.lua;/usr/lib/?.lua;/home/lib/?.lua;./?.lua;/lib/?/init.lua;/usr/lib/?/init.lua;/home/lib/?/init.lua;./?/init.lua")
os.setenv("PATH", "/usr/local/bin:/usr/bin:/bin:.")
os.setenv("PWD", "/")
os.setenv("PS1", "\x1b[33m$PWD\x1b[31m#\x1b[39m ")
pipes.log("INIT: Mounting filesystems")
if filesystem.exists("/etc/fstab") then
for entry in io.lines("/etc/fstab") do
if entry:sub(1,1) ~= "#" then
end
end
end
pipes.log("INIT: Starting terminals")
if not filesystem.exists("/root") then
filesystem.makeDirectory("/root")
end
@ -37,7 +52,6 @@ end
local sin, sout
local screens = component.list("screen")
for gpu in component.list("gpu") do
local screen = screens()
@ -85,7 +99,11 @@ end
pcall(services)
local kout = io.popen(function()
pipes.setThreadName("/bin/tee.lua")
if filesystem.exists("/kern.log") then
filesystem.remove("/kern.log.old")
filesystem.rename("/kern.log", "/kern.log.old")
end
pipes.setThreadName("[init]/logd")
io.output(sout)
loadfile("/bin/tee.lua", nil, _G)("/kern.log")
end, "w")

View File

@ -1,5 +1,8 @@
local serialization = require("serialization")
local term = require("term")
local fs = require("filesystem")
local args = {...}
local env = setmetatable({}, {__index = _ENV})
@ -10,6 +13,13 @@ local function optrequire(...)
end
end
if args[1] and fs.exists(args[1]) then --non standard, require -i !!!
local f = io.open(args[1])
local code = load(f:read("*all"), "="..args[1], "t", env)
f:close()
xpcall(code, debug.traceback)
end
local hist = {}
while true do
io.write(tostring(env._PROMPT or "lua> "))

View File

@ -0,0 +1,44 @@
local term = require("term")
function usage()
print(
[[Usage:
more [options] ...
A file perusal filter for CRT viewing.]])
end
local args = {...}
local file = args[1]
if not file then usage() return end
file = io.open(file)
if not file then
print("File not found")
return
end
term.clear()
local _, h = term.getResolution()
io.write("\x1b[1;1H")
print("...",h)
for i = 1, h - 2 do
local line = file:read("*l")
if not line then print("input end")return end
print(line)
end
io.write("\x1b47m\x1b30m--More--\x1b39m\x1b49m")
while true do
local c = io.read(1)
if c == "\n" then
local line = file:read("*l")
if not line then return end
print("\r\x1b[K" .. line)
io.write("\x1b47m\x1b30m--More--\x1b39m\x1b49m")
elseif c == "q" then
return
end
end

Some files were not shown because too many files have changed in this diff Show More