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

Search the Community

Showing results for tags 'redstone'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • OpenComputers
    • Announcements
    • Feedback
    • IRC
  • Code Central
    • Support
    • Showcase
    • Tutorials
  • Addons & More
    • Addons Mods
    • Architectures
    • OpenEngineering Task Force
  • General
    • Lounge
    • Forum Games
    • Showcase
    • Servers
  • Archives
    • Public Archives

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Minecraft


GitHub


IRC


Fediverse ID


Location


Interests

Found 17 results

  1. Hi, I have issue with bundled cable, my program is 32ch redstone switch (2 bundled cables on output), that switches bundled channel or all, which I specify with argument, on state ON/OFF (also specify with argument) (- input format is in bitcode (1011110) number position specify the channel number, and 1 or 0 specify the channel state, or for all channels "rset all on/off") Program works great on single channel switching, but when I want switch multiple channels, it takes time (about 10 seconds if I want switch all). It only happens if there is state change on specific channel (0 > 1, 1 > 0), if there isn't change (0 > 0, 1 > 1), program passes throught this channel fast. I tried to disconnect end device, but nothing happened. Video on one drive Program on pastebin Sorry for possible grammar mistakes, I'm Czech.
  2. Hello, (I don't speak english very well, sorry in advance for errors) I need a program to controll an iron with the in-game time. But i d'ont know how to ask to the computer the in-game time, someone can build a simple program to turn on redstone signal at 6AM, and turn it off at 8PM ? I need the program will be easy to understand, and esay ton configure, annotations are good for this Thank you in advance, bye !
  3. I want a program on my tablet that when activated, sends a message to a server using a linked card and the server then activates some redstone around a redstone I/O. Can anyone make that?
  4. This program allows generate redstone signal by sides Installing: pastebin run x6SJq5wg and the installer will install all needed files Minimal System requestments: ONLY TIER 2 SCREEN AND VIDEOCARD 2 TIER RAM: 512kb CPU: 1 TIER Redstone card: 1 or 2 tier Credits: Laine_prikol - Author this program Zer0Galaxy - Author gui lib (http://pastebin.com/iKzRve2g)
  5. local rs = component.proxy(component.list("redstone")()) local ceiling = 14 --/15 local floor = 1 local intervalSeconds = 10 local capSide = 4 -- http://ocdoc.cil.li/api:sides local rsLevel = 0 local capLevel = 0 function sleep(timeout) local deadline = computer.uptime() + (timeout or 0) repeat computer.pullSignal(0) until computer.uptime() >= deadline end while true do capLevel = rs.getComparatorInput(capSide) if capLevel >= ceiling then rsLevel = 1 elseif capLevel <= floor then rsLevel = 0 end rs.setOutput(capSide, rsLevel) -- debug stuff rs.setOutput(3, rsLevel) rs.setOutput(5, capLevel) rs.setOutput(2, 1) sleep(1) rs.setOutput(2, 0) -- end debug sleep(intervalSeconds) end Very simple microcontroller program (though as it is my first, it took me a while to figure out how to make it work considering the documentation on microcontrollers is not very good for newbies). Measures the comparator level of an adjacent block (I created it to measure the energy stored in an enderIO capacitor), emits a signal back if the comparator signal is full strength, stops emitting if it is at 0 (or any other configured values). This was made to manage an energy storage system, so that our reactor would not be running all the time at low levels, would not be stopping and starting in tiny bursts, but rather would have larger cycles more infrequently. https://pastebin.com/NucrVHkm The lines between the comments about debugging can be safely removed, but I've left them in case they are in any way educational for someone else. I had a lot of trouble finding example code for microcontrollers, so i figured I'd post this one in case it's helpful to someone else. One thing that tripped me up for a little while was figuring out how to make the program sleep for a while since there is no sleep method available in a microcontroller. I had found this page: http://lua-users.org/wiki/SleepFunction, and tried several of the functions there but each gave me some kind of error after a little while. I ended up copying the sleep function from openOS's library files, and modifying it a little bit... I'm using computer.pullSignal() to take up time, though i don't entirely know yet what this function does i do recognize that it stalls for a little bit so it works well enough for my sleep function's needs. But yeah, for any newbies who may see this in the future, this page http://ocdoc.cil.li/tutorial:custom_oses and scouring openOS's libraries https://github.com/MightyPirates/OpenComputers/tree/master-MC1.7.10/src/main/resources/assets/opencomputers/loot/openos/boot was what ended up helping, as well as a german video sangar made (though i don't speak german)
  6. I'm working on a small bit of code that reads from a IC2 power storage block and displays it's current and maximum storage. I also want it to toggle a Reactor based on either a keypress or a CLI menu option. As the code has to refresh a LOT, I think a keypress option is the easiest way, but I can't, for the life of me, figure it out. Here's what I have so far... os.execute("cls") -- Hook the component local component = require("component") local term = require("term") local side = require("sides") local keyboard = require("keyboard") local event = require("event") local rs = component.redstone local batbox = component.cesu local board = component.keyboard function toggleBox() if rs.getOutput(side.top) == 18 then rs.setOutput(side.top, 0) else rs.setOutput(side.top, 18) end end local function keyCheck() while true do e = event.pull(1, "key_up") if e == "enter" then toggleBox() elseif e == "back" then running = false end end end keyChecker = coroutine.create(keyCheck) function main() running = true while true do -- Get the tank information, results are in table format local tInfo = batbox local cap = tonumber(batbox.getCapacity()) local fill = tonumber(batbox.getStored()) -- Output as you want... a very simple way: print("CESU Power Levels and Controls") print("Energy Stored : "..fill) print("CESU Capacity : "..cap) print("\n Press Enter to toggle reactor.") print("Press Back to return to OpenOS.") term.setCursor(1,1) end end main() And yes, I now see the redundancy of having "cls" there, when I have 'term.setCursor(1,1)' there... What is it that I am missing?
  7. I am using something like this: function pulse(rsComponent, side) rsComponent.setOutput(side, 15); rsComponent.setOutput(side, 0); end pulse(thirdGenerator, sides.bottom); pulse(secondGenerator, sides.bottom); Both "thirdGenerator" and "secondGenerator" are Redstone I/O block cpmponents connected to the computer via cables. Running this will make them give a short pulse at the bottom of the blocks but there is like a 10 tick delay between them. How can I manage to make both of them activate at the same time? Also, is there a way to set a fixed amount of ticks (a really short delay like 3 ticks or something like that) to wait between first and second pulse?
  8. AND HIS NAME IS... GANG SINA! Gangsir here again, I've made a simple script that opens a door when a entity from a list moves near an attached motion detector. This acts as both a method of security and an easy way to automatically open a door. It outputs a redstone signal on the top of the computer/RedstoneIO block when a valid entity moves near it. Usage: proxdoor [-abli] <time to stay open> [Person1] [Person2]... Switches: -a : Accept all mode, door will open for any motion. Whitelist has no effect. Cannot use with -b -b : Blacklist mode, all provided names the door will ignore, accept all others, cannot be used with -a -i : Inverted redstone mode, turns redstone on by default and off on detect. Good for piston doors. -l : Logs all door activity to a file. Useful for security So, if I wanted the door to stay open for 2 seconds, and allow both me and Sangar to open the door, I would run: proxdoor 2 Gangsir Sangar You can have an almost infinite whitelist, limited by your RAM. If you have a very large whitelist, it may be more efficient to run the program in accept all mode or blacklist mode, see above. When setting up, ensure that there is a motion detector on both sides of the door, or it can be seen from both sides. Also ensure it has line of sight, and is within 3 blocks from the door, so that it can trigger. This range can be modified in the program. Screenshots: Requirements: The program can be found here: https://github.com/NoahNMorton/Gangsir_MC_LuaPrograms/blob/master/OpenComputers/HeadlessPrograms/ProximityDoor.lua Or, Wgetted: wget https://raw.githubusercontent.com/NoahNMorton/Gangsir_MC_LuaPrograms/master/OpenComputers/HeadlessPrograms/ProximityDoor.lua proxdoor.lua As a quick p.s., the program is headless, meaning you can remove all graphics components and it will still function fine. Also recommended if using for security that you protect the blocks around the door, the door itself, and the motion detector to prevent people just busting down the door. I recommend the block protector from RFTools, or Thaumcraft warding. As always, make sure to like or comment if you enjoy my programs, I'm always happy to see that. Changelog for those who care: V1.0 Added the program. --- V1.1 Added accept all mode and inverted mode, made whitelist lookup faster. Numerous optimisations. --- V1.2 Added blacklist mode --- V1.3 Added file logging on option ---
  9. This is the program. local component = require("component") local sensor = component.motion_sensor local sides = require("sides") local io = require("io") local term = require("term") local event = require("event") sensor.setSensitivity(0.2) local range=1 ------ Functions ----- function close() local rs1 = component.proxy("bebe4c8f-a23e-4e7a-baec-be0124a0b598") rs1.setOutput(sides.right,0) os.sleep(1) for address in component.list("redstone",true) do local rs = component.proxy(address) rs.setOutput(sides.top,15) end end function open() for address in component.list("redstone",true) do local rs = component.proxy(address) rs.setOutput(sides.top,0) end os.sleep(1) local rs1 = component.proxy("bebe4c8f-a23e-4e7a-baec-be0124a0b598") rs1.setOutput(sides.right,15) end function openMan() open() print("Closing it in 8 seconds") os.sleep(8) close() end function detect() print("Detecting...") while true do local _,_,x,y,z,name=event.pull("motion") if math.abs(x)<=tonumber(range) and math.abs(y)<=tonumber(range) and math.abs(z)<=tonumber(range) then if name == "AetherEus" then open() print("Detected:",name) print("Closing the staircase in 10 seconds") os.sleep(10) close() return false end end end end close() ---- end ---- ---- Menu ---- if component.isAvailable("motion_sensor") then repeat print("Aileen:Program Started. What do I do now?") print("1.Open the staircase.\n2.Star detection mode.\n3.Close the staircase.\n4.Close the program.") local inst=io.read("*n") if inst==1 then term.clear() print("Aileen: Opening.") openMan() os.sleep(1) detect() end if inst==2 then term.clear() print("Aileen: Starting detection mode.") detect() end if inst==4 then term.clear() print("Aileen: Closing the program.") term.clear() end if inst==3 then term.clear() print("Aileen: Closing the staircase.") close() end until inst == 4 else print("Plug in the motion sensor!!!") end return 0 It's simple it activates or deactivates a redstone machanism that opens up a path to a staircase. The two things I want to fix or add is 1. A way to manually cancel the detecting process. 2.Fix that the motion sensor takes to long to detect or I need to jump a lo to make it work.
  10. local component = require("component") local upright = component.proxy("ced03056-f8ea-432b-94c0-a89b9d1b3336")--Change the addresses to match with your Redstone I/O's local upleft = component.proxy("182fc96d-d245-4bed-a69c-71469b286418")-- local downright = component.proxy("3d65cc84-e08d-4d32-9c65-b9c9aba60a18") local downleft = component.proxy("fc7ebe48-702b-4e1e-9911-5c09c602588c") local downright2= component.proxy("1a760530-540e-438a-8cc5-803c75a5767e") local downleft2= component.proxy("9de1f13e-4347-408a-bb0a-46f7b2241a15") function close() downleft.setOutput(1,15) downleft.setOutput(3,15) downright.setOutput(1,15) downright.setOutput(3,15) os.sleep(2) upleft.setOutput(5,15) upright.setOutput(4,15) end function open() upleft.setOutput(5,0) upright.setOutput(4,0) os.sleep(2) downleft.setOutput(3,0) downleft.setOutput(1,0) downright.setOutput(3,0) downright.setOutput(1,0) os.sleep(2) downleft2.setOutput(4,15) downright2.setOutput(5,15) downleft2.setOutput(4,0) downright2.setOutput(5,0) end Let me know what do you think about it I just started learning lua like four days ago when I discovered this mod. I know a bit of C and C++. I've been able to do amazing this and I just fall in love with this mod.
  11. In my Sky Factory 3 world, I would like to fully automate a farm for the Pam's Harvestcraft crops and trees. The problem became how to automate harvesting the nuts/fruits (since EnderIO and similar mods just break the trees). I didn't want to line an orchard with mechanical users, so I turned to OpenComputers after noticing I can program a robot to do it for me. I've spent the past few days trying to learn how to build/program a robot, and finally managed to harvest vanilla at all (by jamming a bunch of move and use commands in one .lua ). The next step was suppose to make it react to a redstone signal (starting its harvest routine when a chest of bonemeal is full, thank you Storage Drawers). However, I can NOT for the life of me figure out how to make a robot react to a redstone signal AT ALL. Even something as simple as printing "true" when it gets one. All the tutorials/help I can find are either 1) Saying what a redstone card is at all, not how to use it, 2) Incomplete snippits of code for a computer system, (which gives me lots of errors when I try to add them into my robot. Could be my incompetence, but that's beside the point) or 3) for ComputerCraft. I only just picked up OpenComputers and Lua 2 days ago, I don't know how to translate ComputerCraft code into OpenComputers code. Any help figuring out how redstone cards work in robots would be greatly appreciated. (And of course any tips on how to make a robot sleep/wait until it gets a redstone signal, then spring into action, would fantastic.)
  12. Hey! I've programmed a ticket system for a train station so I have to make an if query... ..but this if query doesn't work.... [Note: I will check if the redstone signal on the bottom of the computer turned on.] !! Important: No error is displayed !! So whats wrong with my code? Can you help me? local sides = require("sides") local component = require("component") local rs = component.redstone ## Code here while true do if rs.getOutput(sides.bottom, 15) == true then ## Code here end end Thanks in advance! - Wood14Mine
  13. Hello everybody i guess i am wrong here, i moved it to support, programming Well, for the first let me tell you, i'm a bloody beginner in OC and lua, so i hope to get some help here I'm trying to modify a code for my world but when i do, i just get errors So, please, can anybody help me to get this work.... The "buttonAPI" is the part in the background and the "aufzu" is the working part where the functions are told. buttonApi.lua local API = {} local button={} local component = require("component") local colors = require("colors") local term = require("term") local mon = component.gpu local w, h = mon.getResolution() local Green = 0x00AA00 local Red = 0xAA0000 local Black = 0x000000 buttonStatus = nil function API.clear() mon.setBackground(Black) mon.fill(1, 1, w, h, " ") end function API.clearTable() button = {} API.clear() end function API.setTable(name, func, xmin, xmax, ymin, ymax) button[name] = {} button[name]["func"] = func button[name]["active"] = false button[name]["xmin"] = xmin button[name]["ymin"] = ymin button[name]["xmax"] = xmax button[name]["ymax"] = ymax end function API.fill(text, color, bData) local yspot = math.floor((bData["ymin"] + bData["ymax"]) /2) local xspot = math.floor((bData["xmax"] + bData["xmin"] - string.len(text)) /2)+1 local oldColor = mon.setBackground(color) mon.fill(bData["xmin"], bData["ymin"], (bData["xmax"]-bData["xmin"]+1), (bData["ymax"]-bData["ymin"]+1), " ") mon.set(xspot, yspot, text) mon.setBackground(oldColor) end function API.screen() local currColor for name,data in pairs(button) do local on = data["active"] if on == true then currColor = Green else currColor = Red end API.fill(name, currColor, data) end end function API.toggleButton(name) button[name]["active"] = not button[name]["active"] buttonStatus = button[name]["active"] API.screen() end function API.flash(name,length) API.toggleButton(name) API.screen() os.sleep(length) API.toggleButton(name) API.screen() end function API.checkxy(x, y) for name, data in pairs(button) do if y>=data["ymin"] and y <= data["ymax"] then if x>=data["xmin"] and x<= data["xmax"] then data["func"]() return true end end end return false end function API.heading(text) w, h = mon.getResolution() term.setCursor((w-string.len(text))/2+1, 1) term.write(text) end function API.label(w, h, text) term.setCursor(w, h) term.write(text) end return API aufzu.lua: API = require("buttonAPI") local event = require("event") local computer = require("computer") local term = require("term") local component = require("component") local gpu = component.gpu local rs = component.redstone local colors = require("colors") local side = require("sides") function API.fillTable() API.setTable("Tor", tor, 10,20,3,5) API.setTable("Bahn", bahn, 22,32,3,5) API.setTable("Raus", test3, 10,20,8,10) API.setTable("Rein", test4, 22,32,8,10) API.screen() end function getClick() local _, _, x, y = event.pull(1,touch) if x == nil or y == nil then local h, w = gpu.getResolution() gpu.set(h, w, ".") gpu.set(h, w, " ") else API.checkxy(x,y) end end function tor() API.flash("Flash",0.01) rs.setBundledOutput(sides.back, colors.lime, 200) os.sleep(16) rs.setBundledOutput(sides.back, colors.lime, 0) end function bahn() API.toggleButton("Toggle") if buttonStatus == true then rs.setBundledOutput(sides.back, colors.red, 0) else rs.setBundledOutput(sides.back, colors.red, 200) end end function test3() API.flash("Flash") term.setCursor(1,25) term.write("Free Memory: "..computer.freeMemory().." bytes") end function test4() computer.shutdown(true) end term.setCursorBlink(false) gpu.setResolution(80, 25) API.clear() API.fillTable() API.heading("Was soll getan werden?") while true do getClick() end When i click on the, for example, "tor", i just get errors and that is all i get I also tried to give a redstone signal via lua, but here i also get an error, i don't know why. Computer is a Tier 3 and the restone card inside is a Tier 2 Thank you in advice
  14. I am trying to make a program that will output a redstone signal to a light grey cable (from project red) so i can get enhanced portals 3 to activate a portal, but i can't get the redstone to work and i prefer using the computer. (uploading screenshots wouldn't work) error: /home/initialization:4: attempt to index field 'redstone' (a nil value): stack traceback: /home/initialization:4: in main chunk [C]: in function 'xpcall' machine:751: in function 'xpcall' /lib/process.lua:78: in function </lib/process.lua:71> stack traceback: [C]: in function 'error' /lib/process.lua:92: in function </libprocess.lua:71> the code: local component = require ("component") local component = require ("sides") component.redstone.setOutput(sides.back, colors.lightGrey, 16) print("Event Initialized")
  15. Hi, I'm new and I need some help on opencomputers. Can anyone post or make a tutorial on redstone cards? Because I cant find any tutorials on redstone cards which aren't outdated
  16. Introduction Are you creating the secret underground base? A pyramid maze with all kinds of traps? Or just your high security door lock? Then it's very likely that you are using redstone. More complex designs require bigger circuits or computers. (redstone computers?) Programming with redstone cards or blocks is quite straightforward, but it can be quite annoying to always repeat yourself: local component = require("component") local sides = require("sides") local colors = require("colors") local rs = component.redstone rs.setBundledOutput(sides.north, colors.blue, true) --close entrance os.sleep(1) rs.setBundledOutput(sides.north, colors.green, false) --open exit os.sleep(10) rs.setBundledOutput(sides.north, colors.green, true) --close exit os.sleep(1) rs.setBundledOutput(sides.north, colors.blue, false) --open entrance This library makes things easier and your code more expressive: local component = require("component") local rstools = require("mpm.rstools") local rs = component.redstone --inverted to make true == open local entrance = rstools.digital("output", rs, "north", "blue").inverted local exit = rstools.digital("output", rs, "north", "green").inverted entrance(false) --close entrance os.sleep(1) exit:pulse(10, true, false) --open exit for 10 seconds os.sleep(1) entrance(true) --open entrance Documentation Depencencies Software OpenOS Hardware Redstone Component Installation Download the file and save it as the library "mpm.rstools". Download (last update: 29.01.16) github mkdir /home/lib/mpm cd /home/lib/mpm wget 'https://raw.githubusercontent.com/mpmxyz/ocprograms/master/home/lib/mpm/rstools.lua' Known Issues None.
  17. Tis I, Gangsir. I've written a gui program for managing a mob farm's redstone. This program can control lights, doors, modded mob spawners, and a killing mechanism. (Such as grinders from MFR) This is a program that I myself use in my survival world, so I figured I'd share it. ---------------------- Update v1.1: +Added all off and on buttons +Edits to gui. ---------------------- Update v1.2 -Removed all off and on buttons, deemed not necessary +Changed gui library to TankNut's, better lib with more functionality +Tweaks to gui, due to above change -Removed beeping ---------------------- The program can be found at my github, or wget-ed: https://github.com/NoahNMorton/Gangsir_MC_LuaPrograms/blob/master/OpenComputers/MobFarmController.lua wget https://raw.githubusercontent.com/NoahNMorton/Gangsir_MC_LuaPrograms/master/OpenComputers/MobFarmController.lua mobfarm.lua How to use: This script requires TankNut's interface library to run. If you don't have it, the program will try to wget it if you have an internet card installed. If all else fails, it will crash. Note that it's a good idea to reboot the computer after adding a library. The program uses bundled redstone to control each aspect of a standard modded mob farm. Simply connect the computer/redstone io block to the door, lights, mob spawner, and killing mechanism. Set each machine to run on high signal. The computer/redstone io block will output on the bottom. On the other end of the cables, set the red output to be the mob spawner, the orange to the door, the white to the lights, and the black to the killing mechanism. (If you don't have one of these things, just don't connect it, and the button won't do anything.) When a button is pressed, it will turn on the corresponding redstone signal. If the machine's redstone control is not configurable, use a NOT gate. When pressed again, it will turn off the redstone signal. Requirements for the computer: Tier 2 case or tier 3 if using t2 redstone card Tier 2 gpu Tier 2 redstone card or connection to a redstone io block Tier 1 cpu Tier 2 screen(s) or higher Tier 2 Memory x1 or 1.5 tier x2 --------------------------------- Side note: If you like my contributions, make sure to tell me! It inspires me to keep sharing, and helps the forums get more fleshed out. Plus, the more pre-written programs that are around, the more newb-friendly this mod becomes.
×
×
  • Create New...

Important Information

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