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

Elektron72

Members
  • Content Count

    20
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Elektron72

  1. Cell is a graphical file manager for OpenComputers that allows you to browse files and open them in other programs, such as the editor or simply running .lua files.

    2018-09-30_14_35_01.thumb.png.c637f284ea31e55849b97a312fff2c64.png

    You can also customize what programs can be used to open files through the programs.cfg file.

    Tutorials:

    • Browsing files/directories
      • Select files/directories by clicking on them in the panel on the right side of the screen
      • If a directory contains a large amount of files or sub-directories, use the arrow buttons to scroll through pages
      • To go up a sub-directory, click the up arrow
      • To change directory to a sub-directory, select the sub-directory, and click on "Open..." in the options panel (bottom left)
    • Using programs
      • Select file/directory
      • Select an option from the options panel (Run, Edit, Delete, etc.)
    • Creating files/sub-directories
      • Navigate to the directory where the file/sub-directory will be created
      • Select "New File..."/"New Directory..." from the functions panel (top left)
      • A prompt for the name will appear at the bottom of the screen. Enter the name for the file/directory
    • Adding programs
      • Open the programs.cfg file in the editor
      • Add a new line for your program
        • Warning: The syntax for the programs.cfg is very strict, and will not accept extra spaces/empty lines
      • Enter this info separated by semicolons:
        1. Program name
        2. Text for the options menu
        3. File types (separated by commas, for all files put "all", for directories put "dir", for specific file types, put the extension including the ".")
        4. Command that runs the program ("?file?" is a wildcard for the selected file/directory)
        5. Additional options (separated by commas, does not require semicolon or comma at the end)
          1. "s" prevents Cell from erasing the screen before running the program
      • For example, the line that add the editor is: 
        OpenOS Editor;Edit...;all;edit ?file?;

         

    Minimum Requirements:

    • Tier 2 Graphics Card
    • Tier 2 Screen
    • Tier 1 CPU
    • 2x Tier 1 Memory
      • Internet card only required for installation

    To install, run 

    wget https://raw.githubusercontent.com/Elektron72/Cell/master/installer.lua installer.lua
    installer.lua

    At the prompt, enter the path where Cell should be installed.

    Since this is currently in beta, report bugs at https://github.com/Elektron72/Cell

  2. local component = require("component")
    local sides = require("sides")
     
    local rs = component.redstone
    local dbg = component.debug
    local computer = component.computer
     
    local x = 0
    local input = sides.left
    local output = sides.right
     
    while true do
      if rs.getInput(input) > 0 then
        x = #dbg.getPlayers()
        print("Players Updated!")
      end
      if x >= 500 then
        rs.setOutput(output, 15)
        os.sleep(5)
        computer.beep()
        computer.stop()
      end
      print(x)
      os.sleep(0.1)
    end

    Requires a redstone card and a debug card.

    Feel free to change the definitions of the sides input and output.

    Download from pastebin with this command:

    pastebin get suXkJWnw fireworks.lua

     

  3. Here is a farm program I wrote that should work with most robots:

    local robot = require("robot")
     
    function moveToStart()
      -- modify this if the charger is in a different place
    end
     
    function moveToCharger()
      robot.turnAround()
      for i = 1, 25 do
        robot.forward()
      end
      robot.turnRight()
      for i = 1, 4 do
        robot.forward()
      end
      robot.turnRight()
    end
     
    function plant()
      robot.forward()
      robot.swingDown()
      robot.suckDown()
      robot.placeDown()
    end
     
    function plantRow()
      for i = 1, 25 do
        plant()
      end
    end
     
    function reverseRight()
      robot.forward()
      robot.turnRight()
      robot.forward()
      robot.turnRight()
    end
     
    function reverseLeft()
      robot.forward()
      robot.turnLeft()
      robot.forward()
      robot.turnLeft()
    end
     
    while true do
      moveToStart()
      plantRow()
      reverseRight()
      plantRow()
      reverseLeft()
      plantRow()
      reverseRight()
      plantRow()
      reverseLeft()
      plantRow()
      moveToCharger()
      os.sleep(2400)
    end

    You can also download it from pastebin: https://pastebin.com/RxNB6bjC

    Note: For some reason, the robot will only pick up items properly if there is an item in the tool slot. (It can be any item, such as a block of dirt, a stick, etc.)

    Video: https://youtu.be/xRiBUSI-1TM

  4. Although this approach would work, the debug card is not necessary because the sensors can tell what player triggered them. The player's name is part of the signal that is sent to the connected computer.

  5. I am making a program where one of the functions is to open the editor. However, I noticed that part of the program's code seems to interfere with the editor. When the editor is opened by my program, it freezes immediately after displaying the file and will not accept any input. What part of the code is responsible for the issue?

    Here is a standalone version of the broken code (https://pastebin.com/CppRwXqh) :

    local filesystem = require("filesystem")
    local shell = require("shell")
    local process = require("process")
    local cellLocation
    local i
    local j
    local tempchar
     
    function createProgramList()
      cellLocation = shell.resolve(process.info().path)
      cellLocation = filesystem.canonical(cellLocation .. "/..")
      print(cellLocation .. "/programs.cfg")
      io.input(cellLocation .. "/programs.cfg")
      programs = {}
      i = 1
      while 1 do
        print("Loading program #" .. tostring(i) .. "...")
        programs[i] = {}
        print("Loading name...")
        while 1 do
          tempchar = io.read(1)
          if tempchar == ";" then
            break
          elseif programs[i][1] ~= nil then
            programs[i][1] = programs[i][1] .. tempchar
          else
            programs[i][1] = tempchar
          end
        end
        print("Loading option name...")
        while 1 do
          tempchar = io.read(1)
          if tempchar == ";" then
            break
          elseif programs[i][2] ~= nil then
            programs[i][2] = programs[i][2] .. tempchar
          else
            programs[i][2] = tempchar
          end
        end
        programs[i][3] = {}
        j = 1
        print("Loading file associations...")
        while 1 do
          tempchar = io.read(1)
          if tempchar == "," then
            j = j + 1
          elseif tempchar == ";" then
            break
          elseif programs[i][3][j] ~= nil then
            programs[i][3][j] = programs[i][3][j] .. tempchar
          else
            programs[i][3][j] = tempchar
          end
        end
        print("Loading run syntax...")
        while 1 do
          tempchar = io.read(1)
          if tempchar == nil or tempchar == "\n" then
            break
          elseif programs[i][4] ~= nil then
            programs[i][4] = programs[i][4] .. tempchar
          else
            programs[i][4] = tempchar
          end
        end
        if tempchar == nil then
          break
        end
        i = i + 1
      end
    end
     
    createProgramList()
    shell.execute("edit /init.lua")

    Also, a file named programs.cfg is necessary in the same directory containing the following text:

    ;;;

     

×
×
  • Create New...

Important Information

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