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


  • Content Count

  • Joined

  • Last visited

Everything posted by ayangd

  1. Easily move your robot using very short commands! rim('10(5flfl)') The code above demonstrates how your robot can do: By only one line of command! Easily import the source code: rim = require('<this file>').interpret rim('ud') -- Go up and down E.g robot excavation: rim('32(15(16(xf)lfl)15(xf)xd2l)', robot.swingDown) Documentation is inside the source code (head). https://pastebin.com/L2JtJA61
  2. If you're talking about a robot that presses the `tilde` key, then no. Robot's can't use oreExcavator mod.
  3. If you're talking about the total slots available, `robot.inventorySize()` is the answer. But, if you're talking about the empty slots available, scanning slots one by one is an option. Here is a simple code for that: local robot = require('robot') local function getEmptySlots() local emptySlots = 0 for i = 1, robot.inventorySize() do if robot.count(i) == 0 then emptySlots = emptySlots + 1 end end return emptySlots end Hope this helps. Have a nice day!
  4. Well, if you're in the newest version of OpenComputes, there's no way to do it. Reference to the problem: https://github.com/MightyPirates/OpenComputers/issues/649 Hope this helps. Have a nice day!
  5. As Molinko said, this code goes to an EEPROM. To do this, follow these steps: Get a fresh EEPROM (not Lua BIOS included one). Get a computer with OpenOS loaded. Put the fresh EEPROM to the computer. run `edit /dev/eeprom` and paste the code there. But, I assume you already have it, you will just need to modify it. As the instruction said, modify the user list on top with your name and/or people you want to grant access to. If it's `Bob`, then write `{ "Bob" }`. Note: CaSe SeNsItIvE. Done. After setting up the EEPROM, set up another computer for the EEPROM, by following these steps: Set up a fresh computer (Tier 1 is okay), with door on top, or a redstone connection to other contraption. Put a CPU (Tier 1 is okay), a Memory (Tier 1 is okay too), and a redstone card. Put a number (1 or more) of GPU and screen. Turn on the computer Done! To use this code, sneak-rightclick the screen with barehand to trigger it, or open the screen gui, then click the screen. After trying the code you've shared, I found some oddities and, my suggestion, is to change to my modified code here: local user = { "user1", "user2", "user3" } local red = component.proxy(component.list("redstone")()) local scr = {} local gpu = {} for a in component.list("screen") do table.insert(scr, a) end for a in component.list("gpu") do table.insert(gpu, component.proxy(a)) end for i = 1, #gpu do if scr[i] ~= nil then gpu[i].bind(scr[i]) end end function showState(s) for i, g in ipairs(gpu) do g.setResolution(40, 20) if s then g.setForeground(0x00FF00) g.set(16, 10, "Access granted.") else g.setForeground(0xFF0000) g.set(16, 10, "Access denied.") end end end function sleep(x) local tgt = computer.uptime() + x while computer.uptime() < tgt do computer.pullSignal(tgt - computer.uptime()) end end while true do showState(false) local sigType, _, x, y, btn, nick = computer.pullSignal(5) if sigType == "touch" then for i, v in ipairs(user) do if v == nick then showState(true) red.setOutput(1, 255) sleep(2) red.setOutput(1, 0) end end end end Hope this solves your problem. Well, have a nice day then!
  6. You can either make your own library, or look mine. https://github.com/ayangd/oc-automate_everything/blob/master/oldfloppy/util/navigate.lua Basically, what it does, is to wrap the robot's movement API, and updates the position value when the function is called. If you really lazy, or want my code, tell me. I'll tell you how to use mine. I hope it helps. Have a nice day!
  • Create New...

Important Information

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