Giter Site home page Giter Site logo

Comments (4)

Tarkz avatar Tarkz commented on June 26, 2024 1

I did get a redstone command to work from my Advanced Pocket Computer using the Basalt UI. So I just have to assume the issue is with my program on the Advanced Computer controlling the gate. Thank you for the help with the basalt.debug() earlier.

from basalt.

Erb3 avatar Erb3 commented on June 26, 2024

It appears that basalt.debug is a bit broken. However, the code below works on my machine:

local basalt = require("basalt")
local main = basalt.createFrame()

local btnGate = main
  :addButton()
  :setPosition(2,2)
  :setText("[ Shutdown ]")
  :setBackground(colors.yellow)
  :onClick(function(self, event, button, x, y)
    os.shutdown()
  end)

basalt.autoUpdate()

Be sure to update os.shutdown() with something more useful, like your function open("gate")

from basalt.

Tarkz avatar Tarkz commented on June 26, 2024

It appears that basalt.debug is a bit broken. However, the code below works on my machine:

local basalt = require("basalt")
local main = basalt.createFrame()

local btnGate = main
  :addButton()
  :setPosition(2,2)
  :setText("[ Shutdown ]")
  :setBackground(colors.yellow)
  :onClick(function(self, event, button, x, y)
    os.shutdown()
  end)

basalt.autoUpdate()

Be sure to update os.shutdown() with something more useful, like your function open("gate")

I took out the debugs and tried it with the os.shutdown() and confirmed that worked. I put back in my open("gate") function and it seems to run the function, but skips over the rednet broadcast call.

rednet.broadcast("open","Gatekeeper")

is there something else I have to do to have basalt broadcast rednet commands?

from basalt.

Tarkz avatar Tarkz commented on June 26, 2024

It appears that basalt.debug is a bit broken. However, the code below works on my machine:

local basalt = require("basalt")
local main = basalt.createFrame()

local btnGate = main
  :addButton()
  :setPosition(2,2)
  :setText("[ Shutdown ]")
  :setBackground(colors.yellow)
  :onClick(function(self, event, button, x, y)
    os.shutdown()
  end)

basalt.autoUpdate()

Be sure to update os.shutdown() with something more useful, like your function open("gate")

I took out the debugs and tried it with the os.shutdown() and confirmed that worked. I put back in my open("gate") function and it seems to run the function, but skips over the rednet broadcast call.

rednet.broadcast("open","Gatekeeper")

is there something else I have to do to have basalt broadcast rednet commands?

In case it helps the open("gate") function is:

function open(sTarget)
if sTarget == "gate" then
rednet.broadcast("open", "Gatekeeper")
end
end

A really simple function for now. And I have the rednet.broadcast() call working when I use a pocket computer with the basic lua terminal as well as other CC based programs.

from basalt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.