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

    • Lizzy Trickster

      Latest Stable OpenComputers Version   11/26/16

      The latest released version of OpenComputers is version 1.7.1 for MC 1.7.10, 1.10.2, 1.11.2 & 1.12.1. See more information here! Beta/Dev builds can be found at the Jenkins Build Server (ci.cil.li)
    • Lizzy Trickster

      !!FORUM DOWNTIME!!   01/16/18

      On 2018-01-27 the forums will be going down at around 1100 GMT0 for up-to 5 hours to allow for hardware configuration changes on the system that hosts these forums as well as various updates to patch recently publicised CPU vulnerabilities. Apologies for the inconvenience that this will cause.  If you would like to keep up-to-date on the progress of the work, join our IRC channel (http://webchat.esper.net/?nick=&channels=oc) or our Discord ( https://discord.gg/0hVukoQ2KYifZFCA ).

Molinko

Members
  • Content count

    254
  • Joined

  • Last visited

  • Days Won

    23

Molinko last won the day on January 5

Molinko had the most liked content!

1 Follower

About Molinko

  • Rank
    Leading Member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

994 profile views
  1. How do I print to a second monitor?

    @payonel Howdy! About the term lib documentation; I was specifically referring to the doc for term.bind. The optional [screen & keyboard] parameters suggested in the doc dont seem to have an actual implementation in the current OpenOS( although at the time of this response i havent bothered to double check that. Just referring to previous hair pulling encounters ). Ill add a ticket tomorrow if I dont totally space. You did warn me about messing with anything under the .internal space of an OpenOS lib, but I like dancing on sharp edges . Love what you're doing with the place too! (OpenOS) Third. Yup. I want a full tty pty abstraction layer for programs but after looking into how to pull it off myself I figured I'd wait for you to do it , lol. This is definitely illuminating for me as, for me at least, this wasn't straight forward to grok just peeping the source. Thanks for that. OpenOS is my first use of any linux like OS arch and I'm learning a lot. I really like the dev system. I want to learn to exploit it a lot more. That example is actually the first use i've personally thought of for it and that only happened because looping several type of components and binding screens, gpus, and keyboards can be quite tedious . Thanks for the input. Always a pleasure.
  2. Trying to Load ae2 Autostock program

    If you had installed then this shouldn't be your issue as (newer versions of) OpenOS caches the boot drive in the eeprom upon installation. Successive boots should boot from the hdd with the os installed. Though the fact that the autostock program itself is running from /tmp and looking for the config in the /autostock dir, which is in root dir (barf), is a sign of either improper installation or perhaps just poor software quality in the port to OC. Preferably user level programs should be installed somewhere above /home or /usr or even /home/usr. Likewise their libraries or configs probably shouldn't be in the root folder. If you're still having issues later then hit me back up here(this thread or PM), and you can walk me through how you're installing the program.. good luck bud
  3. Trying to Load ae2 Autostock program

    Have you installed OpenOS to the hdd with the install command? It looks like the program is installed to /tmp and the directory /autostock indeed doesnt exist because you booted OpenOS from the floppy? Just a guess.
  4. Failing to bind GPU to screen

    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( screen_address ) -- # call .bind from the proxy
  5. "attempt to call field" error

    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 :/
  6. 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 component.list('flux_gate') do local gate = component.proxy(address) table.insert(flux_gates, gate) end -- or local gate_iter = component.list('flux_gate') local fg1, fg2 = component.proxy(gate_iter()), component.proxy(gate_iter())
  7. "attempt to call field" error

    Is this the entire test program?
  8. How do I print to a second monitor?

    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) then local file = assert(fs.open(path .. '/address', 'r'), 'failed to open ' .. path .. '/address.') local address = file:read() file:close() return address end return nil, 'no secondary ' .. ctype .. ' component.' end local gpu2 = component.proxy(getSecondary('gpu')) gpu2.bind(getSecondary('screen')) local function Window(dx, dy, w, h, gpu) gpu = gpu or term.gpu() local window = term.internal.open(dx, dy, w, h) term.bind(gpu, window) window.as_window = term.internal.run_in_window return window end local window = Window(0, 0, 160, 50, gpu2) -- # give window offset & dimensions and gpu proxy. local function log(...) return window:as_window(print, ...) -- # run print with the tty window as our our window end print "This is on the main screen" log "This is on the second screen" hope this is helpful.. Some thing else fun to try and use as well.. -- # considering the above code.. -- # take term char input on two screens at once thread.create(function() window:as_window( term.read ) -- # read input on term 2. blink and all :) end) -- # the windowed term.read will exit either when it returns or if this call returns first closing the above thread. term.read() -- # read from main term input.
  9. Quick way to reprogram drones?

    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).
  10. Quick way to reprogram drones?

    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.
  11. Text Problem

    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.
  12. How can I store each line of a file in an array in Lua?

    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
  13. Trouble with Library

    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.
  14. Trouble with Library

    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()
  15. We Need More Security

    look into the OpenComputers User Access
×