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

Leaderboard


Popular Content

Showing content with the highest reputation since 05/24/19 in all areas

  1. 1 point
    Hey, in these if statements, you need to use relational operators. Since you want to see if you're variable is equal to a certain string, you need the '==' (two equal signs). So you're code would look like this -- local require commands start local component= require (“component”) local sides = require(“sides”) local rs = component.redstone local event = require(“event”) -- local os = require(“os”) remove this, the os lib does not need to be required, I think -- local require commands end -- Main function start local function main() local username, message = event.pull(“chat_message”) -- you head a period (.) between both variables -- problematic loop start if username == “Hakz_Studios” and message == “ Alice Refuel” then component.speech_box.say(“Refueling”) component.chat_box.say(“Refueling”) repeat local username,message = event.pull(“chat_message”) rs.setoutput(sides.bottom, 15) -- you need to give the redstone output a value, otherwise it wont turn on -- also, by putting it into a loop, the redstone output will be set a ton of times -- it helps putting the statement before the repeat until loop until username == “Hakz_Studios” and message == “Stop Refueling” -- restarting function function main() -- idk what is this line about, but i dont think it belongs here elseif username == “Hakz_Studios” and message == “Stop Refuel Systems” os.execute(“Shutdown”) -- it will look for a program called 'Shutdown' with a capital S else function main() -- also, dont know what you want to do here, do you want to start the function again (to have the code repeated endlessly) --problematic loop end end -- main function end end Some small info: you don't have to put brackets around your condition in the if-statements, you can, but it's not necessary. Also, here is a program that repeats the main loop over and over again, as I think that is what you want to do in your original code, if I'm wrong tho and misinterpreting you're code, just ignore my suggestion -- require libs local component = require("component") local rs = component.redstone local sides = require("sides") local event = require("event") -- main function local function main() local username, message = event.pull("chat_message") if username == "Hakz_Studios" and message == "Alice Refuel" then component.speech_box.say("Refueling") component.chat_box.say("Refueling") -- this time I set the redstone output once, and then wait for the message 'Stop refueling' then deactivate the redstoneoutput again rs.setOutput(sides.bottom, 15) repeat username, message = event.pull("chat_message") -- you dont have to use 'local' in front of username and message here, since you already created these variables at the top of the main function -- it will override these values but it actually doesnt matter since from this part you will skip to the end and these initial values for both variables -- wont be needed anymore until username == "Hakz_Studios" and message == "Stop Refueling" rs.setOutput(sides.bottom, 0) -- I assume you want to deactivate the redstone after you're done refueling elseif username == "Hakz_Studios" and message == "Stop Refuel System" then os.execute("Shutdown") -- again, this will start the program "Shutdown" with a capital "S" end -- as you can see, we skip the last else statement, as it will call the main function recursively, resulting in a overflow error pretty fast -- you could get away with returning a call to the main function, but this wouldnt be good practice eiter, I guess end -- we add a last while loop, which will repeat endlessly calling the main function while true do main() end I hope this helps. Also you did great for your first shot at programming!
  2. 1 point
    asie

    Introducing "Lunatic"

    No spoiler in the title. Just watch the video.
  3. 1 point
    uncpio is a rather simple binary CPIO extractor (File begins with 0x71C7 or 0xC771, made with cpio -oHbin). To acquire uncpio, run pastebin get YbrVjRwa /bin/uncpio.lua To use, make the directory you'll be extracting your CPIO archive to, cd into it, then run uncpio path/to/your/file.cpio And it will extract to the current directory. Currently only works in OpenOS, as far as I know.
  4. 1 point
    Zen1th

    Fuchas - The multi task OS

    Fuchas One of the best multitask OS How Fuchas Works Fuchas is a true multitask OS for OpenComputers. By true multitask, i mean it is based on a task manager. To do it simple, the task manager cycle through all the active processes. It also pulls signal with a timeout of 0.05 seconds! (Speed is best). Fuchas is also modular and based on a driver system, the driver library will try automatically choosing the best driver, but it can be configured by user. Meaning programs can easily adapt to addons hardware (e.g. Computronics cards), however for now this aspect of Fuchas isn't really well used, a re-overhaul of it is planned soon. If you don't understand all that just retain something: Unlike OpenOS, it can run tasks at same time. (Technically it's not correct, since there is like a ~0.05s delay between tasks, due to Lua nature) The major "sellpoint" of the OS is booting and being in general VERY VERY FAST I'll do proper metrics soon, but Fuchas on a full T3 (T3 CPU, 2x 3.5 memory, T3 GPU) starts almost instantly (less than ~0.3 sec), compared to ~1sec for OpenOS and ~2sec for MineOS Dedicated. On a machine where call budget is always 0 (using an emulator), MineOS is unusable, OpenOS takes literally ~5sec to write a letter, and Fuchas still seems okay. Again, metrics comin g soon. If you don't believe me just try it Interfaces Fuchas, being modular, is about not fair to have 1 interface. That's why there can be multiple interfaces. Currently only one is included: Fushell (basically like OpenOS shell). Soon to come will be "Concert", which is a GUI interface, better suited for multi-tasking. Currently, the only interface to show, Fushell: You might as well as spotted the "pl" and "kill" command. Yep! Thoses are multitask commands I'm not doing a whole documentation here, but basically "pl" lists tasks (called processes internally) and "kill", well, it kill tasks Installing Whatever from what OS you're installing it. OpenOS: Just type the following: pastebin run EbHYvEE8 MineOS: Coming soon. Links: GitHub, Wiki, Progress to next version
  5. 1 point
    Zen1th

    Fuchas - The multi task OS

    Say hello to liburf's 2nd URF!
  6. 1 point
    Thanks for the review. I will make a version 2 (on same post) to add the changes you suggested and some others changes. I will also soon make a more presentable form of the specification.
  7. 1 point
    This is an object-oriented library, the main priority of which is the maximum possible performance. It works on the double buffering concept, it has a lot of widgets, animations and custom event handlers support. All programs from the screenshots above are implemented with its help. If you want to develop a fast and beautiful program in just a few lines of code without butthurt - then this library is made for you. Detailed illustrated documentation, installation methods and tons of practical examples are available at: https://github.com/IgorTimofeev/GUI
  8. 1 point
    Typically the GUI and your application are separated because of the reactive nature of the GUI library. Most of your code for reacting to GUI events will go into a GUIObjects event handler. -- # ... myButton.eventHandler = function(app, instance, event) if event == "touch" then -- # react to touch event. Alter state, etc... end end I don't have the time to test this my self but you could try using OpenOS threads to give control back to your main script. -- # ... more stuff up here local thread = require 'thread' -- # Gui logic n stuff... -- # This will now run whenever the main script yields i.e event.pulls, os.sleeps, etc.. local guiProc = thread.create(application.start, application) -- # Continue below with main program runtime logic. -- # Be aware that the GUI will only be able to process stuff when this main script yields as Lua is single threaded Multiline text is handled by GUI.textBox rather than GUI.text as far as I can tell. Hope this helps you over the initial hump. Happy to help more if you still need it
  9. 1 point
    asie

    Introducing "Lunatic"

    The optimization patches in OpenComputers's repository are not yet merged into mainline, but you can install lunatic86 regardless! (Just with worse performance.) $ oppm install lunatic86 $ lunatic86 -h
  10. -1 points
    Molinko

    Introducing "Lunatic"

    Hot damn asie, I think you win coolest shit on the forums with this one...
  • Newsletter

    Want to keep up to date with all our latest news and information?

    Sign Up
×
×
  • Create New...

Important Information

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