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

Molinko

Members
  • Content Count

    451
  • Joined

  • Last visited

  • Days Won

    35

Everything posted by Molinko

  1. Please post all your code. In code tags please.
  2. Thanks. It's always referenced as 'the' newline char
  3. Start from scratch. Install OpenOS on fresh hardware. Reboot. Then create your directories and whatnot.
  4. I believe term.read returns its input with a newline char (\n) appended to the end of its output. So, typing 'exit' would return 'exit\n'. One option is to use io.read if you don't need all of the options term.read offers. io.read will return the input without a newline. Or, you can strip the newline and compare as usual. local input = term.read() if input:sub(-2) == 'exit' then -- # I believe input:sub(-2) should strip the last two chars (\n) from the input variable... end
  5. Have you tried getting the robot to pull from specific sides of the block? Some blocks robot can only pull from a specific side.
  6. When you're dumb and overlook the obvious.. thanks. I don't know why I didn't think of that...
  7. It's pretty hard to tell where exactly this is coming from. I dont have br and im too lazy to install a modpack with it.... However, I would usggest littering your code with print statements to see where specifically the code is failing... Try this and see if provides any clues... local modem=component.proxy(component.list("modem")()) local turbine=component.proxy(component.list("br_turbine")()) modem.open(1) local target = false print "main loop start." while true do local e, to, from, _, _, command = computer.pullSignal() if e == "modem_message" then print("modem_message event. fr
  8. I'm pretty sure your problem is here.. data1 = pct -- pct is nil data2 = nrj -- nrj is nil data3 = nrjMax -- nrjMax is nil gpu.set(4,8,nrj) -- This is where the error comes from. "Bad Argument #3 (string expected, got nil.)"... gpu.set(4,10,nrjMax) -- so on.. gpu.set(4,12,pct) -- and so on.. Nowhere in the above code you supplied did you define the values of pct, nrj, or nrjMax. So, they are nil.
  9. From looking at the modem component API you should be able to send up to 8 basic datums in each message. From what I can see in your example It should work fine sending. Could you post your receiving code? The 'modem_message' event has 5 return values before the data you've sent. local _event, localAddress, remoteAddress, portNumber, distance, sentData1, sentData2, sentData3, sentData4 = event.pull("modem_message")
  10. I'm sorry for the headache rather than the help.. local component = require("component") local sides = require("sides") local event = require("event") local term = require("term") local thread = require("thread") local rs = component.redstone local gpu = component.gpu -- Config local delay, isOpen = 5, (rs.getOutput(sides.right) > 0) and true or false local timer = nil term.clear() term.setCursor(1, 1) gpu.setForeground(0x00FF00) print("--------------------------- ToNELvision MICROSYTEMS ---------------------------\n") gpu.setForeground(0xFFFFFF) print("Welcome. Please enter one of t
  11. I edited the original script in my post. I'm confident I fixed open() however I'm not sure if threads can call thread:kill() from within themselves.. So quitting may still be bugged :/
  12. The thread library is included in later versions of openos. Check the forums for openos updater. Download it with internet card. Install it. Lemme know how it goes.
  13. local component = require("component") local sides = require("sides") local event = require("event") local term = require("term") local thread = require("thread") local rs = component.redstone local gpu = component.gpu -- Config local delay = 5 local function open() rs.setOutput(sides.right, 15) os.sleep(delay) rs.setOutput(sides.right, 0) end local inputThread inputThread = thread.create(function() while true do term.clear() term.setCursor(1, 1) gpu.setForeground(0x00FF00) print("--------------------------- ToNELvision MICROSYTEMS ---------------------------\n
  14. The motion sensor must be in line of sight. Solid blocks and maybe even doors will keep the motion sensor from triggering. From a glance the code seems like it should work as expected...
  15. This is wonderfully done and wonderfully useful! I love this reactive style of programming. Would you mind sharing some files of SAD Actors and Queries you've written? I'd love to dig in a bit more if you dont mind..
  16. If you use the network loot disk I believe you can call network.icmp.bind('something'). That address will only be recognized by other computers using the network program
  17. Molinko

    a() or b() ?

    The or keyword is binary and can only work on two variables. Each function you have is returning multiple values and only the first of each are being used and assigned.
  18. There seems to be a bug in the term lib loading a tty window. I think perhaps tty isnt fully loaded yet..? Try using term.read instead of io.. Maybe that'll help... If you get a new error that'd be helpful.
  19. Thanks, you're nice . It was my first language. ^^^ THIS. So much yes. I had a hard time grasping the concept of OOP at first because Lua doesn't have many of the features an OO language like Java and so on.. Personally an OOP-like library is the only real practical way in my opinion to even use OO in Lua. Writing actual program logic doesn't work so well this way.. Gets bloated quick. BUT, an OO library is easy to extend for a use case should you need it. Oh boy I've been trying forever to get this right. When I do I'll let you know . @Dustpuppy I agree. I
  20. yeah.. I was worried it might just look like spaghetti... Yes and No. Yes. The user of the library doesn't need or want to know how the library works to be able to use it and shouldn't have to either. No, because anyone like @Fingercomp who might like to use your library, even if it lacks a specific element, might like to be able to integrate a custom element and not have to write an entire library to do it. A good example would be to think of how similar a 'Label' and a 'Button' object are to each other. They can share ~90% of their code, so why rewrite the other 90% of a button if it
  21. @Fingercomp makes a great point. Without trying to use too much jargon.. OOP or Object Oriented Programming is a style of program or library organization that pairs 'Classes' with 'Instances'. This is hard to explain so I'll use an example that hopefully will demonstrate why OOP can be a powerful paradigm and useful to learn. -- # Person. Our 'Base' class for a set of more complex classes. local Person = {} -- # Use Person(name, age, sex) to use as an instance constructor. Person.__index = Person setmetatable(Person, { __call = function(_, name, age, sex) local person =
  22. This looks great. Taking @Nexarius ' advice is a good idea. No term.clear(). bad, badbadbad. This makes the flicker. This angers the gods. Also, I would suggest using a gui library. Maybe @Gophers' GML or Zer0Galaxys' libforms. One more suggestion would definitely be, again @Nexarius suggestion, to use a lookup table rather than the long if-else chains you have set up. This would help with functions like 'reactorDataTable()' or 'captureKeys()'.
  23. Molinko

    Locate Player

    I think Gorzoid means a 'debug' card
  24. You should check out what openOS does for require. Here. Specifically the package library Check out What's available. <-here Above its what's in the bare lua environment without a loaded os
×
×
  • Create New...

Important Information

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