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

Search the Community

Showing results for tags 'bundled cable'.



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 2 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 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
×
×
  • Create New...

Important Information

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