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

feldim2425

Members
  • Content Count

    30
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by feldim2425

  1. Oh that can also happen, if somewhere the error, generated from os.sleep() or event.pull(), gets catched. In this case the program won't stop, at least not with the first try. Timers and Coroutines / Threads might also survive the Interrupt. To handle that you should check for the "interrupted" event (Fired by pressing Ctrl+C) and stop everything correctly.
  2. Programs usually won't just switch to background. You can try to kill it with CTRL+ALT+C .... this should throw an error and kill the program If you say that it keeps running in the background, how did you find that out? Just asking because it might be some other issue.
  3. I don't think this is possible and I also don't know why you want to pause the computer for that. I think its better if you enforce the limit by returning false or throw an error. But by pausing the computer it will not be able to handle other events like network or touch events. So this would not make much sense.
  4. 1. Require looks if the library has been loaded before and if so it just returns the cached version, otherwise it searches in some predefined paths (usually the current directory, /lib and /usr/lib) for the library, reads the content of the file and uses the load() function to parse and execute the lua code, it caches the returned value from the executed lua / library file (so it is faster if the library is required again) and returns it. You can find the OpenOS implementation in /lib/package.lua 2. You don't have to make any library for a custom filesystem. In theory you can do ev
  5. Some people told me they didn't get a confirmation mail. I tried to reset my passwort to test if the email system of the form is dead and the reset email also never got it into my mailbox. The spam folder is empty so I think oc.cil.li can't send emails.
  6. Hello. So you know how to make a program in ComputerCraft and you want to switch to OpenComputers or just want to know OC better, this tutorial shows you how to use OpenComputers. 0. Some concepts you have to know You can think of Components like Peripherals in CC. They are basically the same require is a function in Lua that returns a module. It can be compared to ComputerCrafts os.loadAPI. But require doen't load an API global like loadAPI, instead it returns the API and it doesn't return the _G table that the api defines. It returns what the loaded File returns like a
  7. The error was a Nullpointer Exception in mods.ocminecart.common.inventory.ComponentInventory in the method getComponentSlot().
  8. I'm rewriting OC-Minecarts for 1.10.2. But the Carts won't boot. If I insert no BIOS it works as intended and tells me, that I have to insert a BIOS EEPROM, same if I insert a BIOS but no OpenOS, but if I insert a OpenOS disk and power the computer cart up. The Startup routine crashes with "Unrecoverable Error java.lang.NullPointerException" I don't know where this is coming from. The log doesn't tell me anything, even if I enable "logCallbackErrors" (and also some other options in debug category). Debugging with breakpoints also didn't help. Forcing LuaJ it printed "machine:14
  9. A very simple webbrowser might be possible but one that supports videos, chrome plugins, javascript and styles not. Remember: OpenComputers can't draw pixel per pixel, only characters. And supporting videos would mean that you have to implement flash and html5. Even if it is possible it might take month or years to implement all that and i think the limited memory of oc wouldn't allow that.
  10. First. You can use an analyzer to see the error message Second. if you open the gui of the rack (not of the server itself) you can connect the component network to one of the 5 sides (front not counted). You have to make sure the Screen is connected to the corresponding side. EDIT: You can open the Rack gui if you click anywhere except the places on the from where you can see a server. In my case the first slot / row
  11. If you read the Item Tooltip of the network debugger, it says that it debuggs the internal network of OC. And is made for Devs. The Network debugger is not even craftable and will only output messages to the log. EDIT: I think this is the wrong Forum section for this. This thread should be in "Support" and not in "Tutorials"
  12. Hi. If you use a Server make sure that you configured the rack correctly. As you see in the screenshot below a server with a network card has two connections. One for the Component network and one for the Network Card itself, while a server without network card only has one connection. Also make sure that the cable is connected to the correct side.
  13. A simpe API to connect to a Websocket Server / Endpoint Forgot to mention: This API requires a Internet Card and Lua 5.3 Example Code: local ws = require("websocket_client"); local event = require("event"); local cl = ws.create(function(ev ,var1) print(ev .. "->" .. var1) end); cl:connect("localhost", 12345, "/"); while true do local ev = {event.pull()}; if ev[1] == "interrupted" then cl:disconnect(); return; elseif ev[1] == "touch" then cl:send("HI"); end end Full API documentation here: https://github.com/feldim2425/OC-Programs/blob/master/w
  14. Yeah. The "require" method is part of OpenOS. But there are some ways around that. 1) I think the component-Library is native (At least for eeproms in a computer case) so you don't have to require it. 2) component.filesystem is a link to the first filesystem found by OpenOS when it starts. So you can find it yourself local fs = component.list("filesystem", true)(); 3) Instead of using the filesystem-Library you should use the filesystem-Component (link to the docs)
  15. You can't download directories. I checked the Pastebin API and it doesn't look like they added directories to the API. And 'wget' uses the same download as your browser does and this method doesn't support downloading folders.
  16. Yes. If you look in the Wiki about signals (ocdoc.cil.li/component:signals) you can see, that the "key_down" event and the "touch" event gives you the playername.
  17. You return null in createEnvironment() but you have the return a ManagedEnvironment. The ManagedEnvironment also needs a Network Node with a component. public class TeslaUpgrade extends li.cil.oc.api.prefab.ManagedEnvironment{ public TeslaUpgrade(){ this.setNode( Network.newNode(this, Visibility.Neighbors).withComponent("teslaUpgrade").create() ); } } I do not know if you have seen the example on GitHub If the upgrade is only for robots you should check in worksWith() if the host class is li.cil.oc.common.tileentity.Robot because there are also upgrade slots in drones, micro
  18. You have to get the inventory controller component not the component of the Jabba barrel. local component = require("component") local inv = component.inventory_controller local stack = inv.getInventorySize(sides.west) print(stack)
  19. Hello everybody! This is the official forum thread for OC-Minecarts. This addon mod adds computer carts and more to OpenComputers. Some features in this mod: Computer carts with an build-in engine and a break. Remote module for railcraft locomotives Network rail to send network messages and power to a computer cart. Interaction with Railcraft: Computer carts can take energy from electric rails. Carts are linkable. Signal for cart lockdown (holding tracks). Linking Upgrade for Computer Carts You can put railcraft emblems on Computer Carts Screenshot: Download and more informa
  20. I think Plan9k is Multiscreen compatible. If you want to use OpenOS remove the lines 31 to 36 in init.lua and replace them with: local screen = "<SCREEN ADDRESS HERE>"
  21. local fs = require("filesystem") function os.dateRL(format) if not fs.get("/").isReadOnly() then local time = io.open("/tmp/.time", "w") time:write() time:close() os.sleep(0.01) return os.date(format, fs.lastModified("/tmp/.time") / 1002.7) else return os.date(format) end end It works. Just require filesystem and "only" in isReadOnly starts with an uppercase letter
  22. You have to import/require the event library. local event = require("event") function touchsig(_, x, y, _, _) print("Xcord: " .. x .. "Ycord: " .. y) end while true do event.listen("touch", touchsig) end
  23. feldim2425

    big reactor

    local component = require("component") local reactor = component.br_reactor local rods = reactor.getNumberOfControlRods() local level ={} for i=0,rods-1 do level = reactor.getControlRodLevel(i) end
  24. feldim2425

    Pressure-plate door

    local component = require("component") local sd = require("sides") local rs = component.redstone local event = require("event") local oldSignal = false local state = false while true do local signal = rs.getInput(sd.front) > 0 --check if we have a redstone signal if signal ~= oldSignal then --make sure we don't trigger twice when the plate was stepped on once ' oldSignal = signal if signal then state = not state --make it so we toggle if signal is true if state then print("Opening door") rs.setOutput(sd.right, 15) else print("Closing
  25. feldim2425

    Pressure-plate door

    You need a loop. Otherwise the program will return before you step on the plate. ` require("component.redstone") ` is wrong. "component" is the library with a variable called redstone. You have to write ` require("component").redstone ` local component = require("component") local sd = require("sides") local rs = require("component").redstone while true do if rs.getInput(sd.front) == 15 then print("Opening door") rs.setOutput(sd.right, 15) else print("Closing door") rs.setOutput(sd.right, 0) end end You can stop the programm with: Ctl + Alt + C (terminate)
×
×
  • Create New...

Important Information

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