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

Molinko

Members
  • Content Count

    451
  • Joined

  • Last visited

  • Days Won

    35

Everything posted by Molinko

  1. Your error is indeed pretty simple. The method component.get returns the full address of a component, which is a string, not an object(table) with methods. In OC it's called a component proxy. Try this out and feel free to ask more questions either in this thread or via PM. local component = require("component") local term = require("term") local gpu_address = component.get("3085") -- # this returns the components full address from an abbreviated one local screen_address = component.get("40c6") local gpu = component.proxy( gpu_address ) -- # get a 'proxy' to the gpu component gpu.bind( sc
  2. Im sorry but this one has me stumped. The error is basically saying that 'br.setActive' is a boolean and not a function. From the wiki we know its a method that takes a boolean so I dunno WTF is going on here. Maybe a version bug between BR and OC or .... I really don't know, sorry :/
  3. To start, components dont really have 'names'. Names aren't unique and we end up with the issue you've mentioned. Components have 'types' and 'addresses'. When using the component library fields like component.flux_gate what is actually happening is the component library is looking up the 'primary' component, really this is just the first component of that type to be found. print( component.flux_gate == component.getPrimary('flux_gate') ) -- # this should print 'true' To find individual components of a certain type you can call component.list local flux_gates = {} for address in co
  4. Is this the entire test program?
  5. The documentation for the term library is incorrect with respect to the latest version of OpenOS. Basically the term library will use whichever screen is bound to the tty output. Its a bit confusing personally. I would recommend reading through the term and tty library to see how they are related. But, to answer your question you can use this.. local component = require "component" local term = require 'term' local thread = require 'thread' local fs = require 'filesystem' local function getSecondary(ctype) local path = '/dev/components/by-type/' .. ctype .. '/1' if fs.exists(path)
  6. Okay, good thinking. I know it's possible, I just can't remember really how to do it Drone Drones are built using a Drone Case in the Assembler. They are entity-based “robots”, a little cheaper but with more limited functionality. They can not interact with external components! They have no secondary storage and so are programmed entirely by using an eeprom. Once assembled, a drone can be reprogrammed by crafting it with a new eeprom (its old eeprom is returned).
  7. I believe crafting your drone, in the player crafting gui or crafting table gui, with the new eeprom will return the old eeprom and place the new one in the drone.
  8. It seems like something the file format or encoding is incorrect. This seems like it may be related to the server you're on. First just try a clean install of openOS on a new drive and see if the issue persists. If it does persist, you should bring it up with your server admin.
  9. local file_path = "/home/myFile.txt" -- # path to your file here local pattern = "match this" -- # your pattern to find local matches = {} local function contains(str, pattern) return string.match(str, pattern) and true or false end for line in io.lines(file_path) do if contains(line, pattern) then table.insert(matches, line) end end That should get you started. Feel free to ask more questions if you like
  10. That sounds like the OC config. If you're developing outside the game in an editor while the game is open then [by default] the in-game files will not sync with the real filesystem until MC is closed. If you want to save files live outside the game and not have to restart the game you can change the config in .../instances/your_pack_here/config/opencomputers/settings.conf. Set the option to "bufferChanges=false". Be sure to read the disclaimer above the option too.
  11. Ive loaded your script and api and they seem to be working as expected.. I see the test button and when i click the 'Working.' message is printed. I'm not getting your error at all. Perhaps reboot, its possible an older dev version of your 'gButtonAPI3' is or was still loaded when you ran your test. if you don't already know, this trick can be helpful while developing apis and testing them as you tweak them. package.loaded.myAPInameHere = nil -- # require is idempotent. purge it! local api = require 'myAPInameHere' api.stuff()
  12. look into the OpenComputers User Access
  13. Okay. I cracked it. I think you're going to have to do some more testing. How: Hold ctrl+c. This tells the os to terminate the running program(yours)... Here are some small tips. local computer = require("computer") print("Whats The Password?") local Password = io.read() -- # this is where ctrl+c can be a problem for you. if Password == "password" then print("Passowrd Accepted") os.sleep(1) else print("Password Denied") computer.stop() -- # This doesn't even work. 'stop' is a device method. You've loaded the 'computer' library. use 'computer.shutdown(true)' instead. end H
  14. I would look into the 'install.lua' program in OpenOS. The path to the program is /bin/install.lua but if you wanna read up on it check out the man file for it \@ /man/install or run the man program from the shell with 'man install'.
  15. Just working on a fork of Igor Timofeevs' double buffering library. Making some changes to work better in OpenOS.
  16. local computer = require ("computer") print("What's The Password?") local password = io.read() -- # HERE is the missing end. Also, use the '==' for equality and single '=' for assignment -- # Also to note, io.read returns a string. password == 123 will error comparing a string to a number. -- # Use password = tonumber(password) or convert the right side of the comparison to a string with tostring(123) -- # if password == "123" then ... or password == tostring(123) ... or tonumber(password) == 123 ... if password == "123" then -- # I just put the pass in quotes to keep it simple. print("Passwo
  17. All files in the lib folder are accessible by name globally in the lua interpreter.
  18. Okay. I think I understand whats going on. You're used to ComputerCrafts' global api system. In CraftOS(Computercrafts default OS), if you want to load a library you call os.loadAPI "myLibrary" and any program executed after that call can access 'myLibrary.myfunction'. OpenOS, and most Lua environments, use the 'require' function to access and load a library within a program. Here's and example. You must use require in each individual file loading a library respectively. This means that if file 'A' used require to load the library 'myLib', file 'B' will also have to require 'myLib' i
  19. Your description is a bit vague. Could you post your code with any current errors?
  20. I don't know of any programs that do this yet but I have been working on one that will be able to do what you want. Can't say when it will be ready though.. maybe a day.. Maybe a week..
  21. local userInput = io.read()
  22. A tip. Look into shell.execute
  23. Molinko

    Detect Delay

    robot.detect is synchronous. meaning it is executed in the order you call() it. Your code prob just has a bug.
  24. So, you want a program that toggles the redstone state on a given side?
  25. Thanks @BrisingrAerowing.
×
×
  • Create New...

Important Information

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