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

Fictitious Rotor

Members
  • Content Count

    21
  • Joined

  • Last visited

  • Days Won

    1

Fictitious Rotor last won the day on March 24 2018

Fictitious Rotor had the most liked content!

About Fictitious Rotor

  • Rank
    Junior Member

Contact Methods

  • Minecraft
    Fictitious_Rotor
  • GitHub
    Fictitious-Rotor
  1. This sounds like a nifty idea. Maybe the trigger should be when you put a tablet in an item frame?
  2. You'll want to import the "computer" library using local computer = require("computer") As for the beep - see if you can find it in this doc page: https://ocdoc.cil.li/api:computer
  3. local rs = component.proxy(component.list(“redstone”)()) Local wr = component.proxy(component.list(“modem”)()) --[[ ^ capital letter not allowed! Use 'local' ]] wr.open(2110) local x,w,a,d,f,sent = computer.pullSignal() rs.setOutput(3,100) #output to front --[[ ^ this is a shell comment - lua will try (and fail) to parse this! Learn about Lua comments here: https://www.lua.org/pil/1.3.html ]] while true do if sent = “enon” then --[[ ^ here you've missed the distinction between '=' and '=='. While '=' is an assignment operator (such as "local a = 4") then '==' is an equality expression (such as "if sent == 'enon'") The distinction is made to prevent you from accidentally doing one when you meant the other. ]] rs.setOutput(3,100) elseif sent = “enoff” then --[[ ^ don't forget to fix this one too ]] rs.setOutput(3,0) elseif computer.energy() < 150 then rs.setOutput(3,0) end --[[ ^ you were missing an 'end' here but it was hard to tell until I added indentation. Giving the program some shape makes it easier to spot grammatical mistakes like these ]] end -- I've also removed a lot of the whitespace between each of your lines of code. Bringing it closer together makes it easier to comprehend. I've taken your code, changed the whitespace a little and annotated it with all the mistakes I spotted. Hopefully you'll be able to fix up the code yourself! Also something to beware when pasting code raw - the forum exchanges some symbols to make them more aesthetically pleasing, but this breaks your code - use the "code" button in the editor instead! Hope this helps
  4. Never cottoned on that it was actually in the package.lua api file - I assumed you had to use the API somehow - but many thanks
  5. Is there a file I can change somewhere, either on a computer in the mod or in my minecraft files so that I can modify the LUA_PATH variable? I'd like to add another directory to it!
  6. What you're looking for are daemons/services. These are programs that run in the background while your gui is available in the foreground for you to use as normal. Trouble is, they're kinda complex it took me far too long to understand how to use them! Simpler solutions could be turning all of your functions into separate lua scripts and having a central program execute them one by one, round robin style. As long as the scripts don't take too long, this would probably serve your purpose. Of course if you want proper multithreading (i.e. running everything at once) then simply use multiple computers and you'll find a good deal of the technical issues just melt away. Of course that solution isn't the cheapest...
  7. So a few quick things. First, when you get a problem, please send us a screenshot and logs if possible to make it easier for us to identify your problem. Second, when you're looking at an API in the documentation, be sure to look at the examples that they give as they contain lots of hints! For example, the first snippit.lua in the computer api shows why your program doesn't work. I'll demonstrate a working solution here. Before you can call any methods, you have to assign the computer API to a variable. What they usually do in the documentation is to call the variable 'computer' like so: local computer = require("computer") print(computer.totalMemory()) Because you didn't set the api to a variable first, your program tried to call a variable that doesn't exist and gave up. Should be an easy problem to fix
  8. Seeing as documentation is rather hard to come by for RC, I had a lengthy and highly enjoyable Easter egg hunt trying to figure out how it works - getting so far as to successfully replace autorun with it Thank you for all the help!
  9. Ah yes the '/' at the end of '/mnt/' is very important as it tells the computer that the location is a folder rather than a file. Try doing 'cd /' and then 'cd /mnt/T3' and see if that works.
  10. In fact there IS an error - it's just you can't see it Try doing local fs = require("filesystem") print(fs.mount("T3", "/T3")) And you'll see a different story! So the reason this happens is that your main drive is already mounted at "/". When you try to mount it at "/T3" then it complains... An easy way to get around this it to mount it at "/mnt/T3" like so: local fs = require("filesystem") fs.mount("T3", "/mnt/T3") Btw - you'll find that it's already in /mnt/ as well under a different name. Try doing 'ls /mnt/' In the shell to see what you've got mounted there. Good luck!
  11. Oh dear. I found the link you were talking about and I see what you mean So I believe that the '...' stands for the drive GUID or its label i.e. "277317a0-68b6-40ec-b264-d22fd76d23ff" <--- GUID Or "277" <--- Default label So seeing as my default label is "277", I can put the following in autorun.lua: local fs = require("filesystem") fs.mount("277", "/mnt/mainDrive") Now I highly doubt your hard drive will have a label of "277". If you want to get the label of your hard drive you can type 'df' Into the shell, as instructed in that link you mentioned earlier. The one you're looking for is the one with the highest available space An example if you're still confused... Good luck
  12. Apologies for the (very) late response - got caught up in irl things somewhat! Although it saddens me that autorun isn't behaving the way it's meant to, it's certainly going to stop me tearing my hair out trying to figure out what I did wrong I'll try to figure out how to write the service as you describe and see how I can progress from there - thank you very much for your help!
  13. Hi there, I've been messing around with some basic robots and autorun.lua. My aim was to be able to plug a floppy disk into a robot, start the robot up and have the robot copy the program that would be stored on the floppy disk. Once the file was on the internal drive, the robot would run it. The idea was that I'd be able to set the robot's functionality by hotswapping floppy disks. Trouble is, the robot autorun hasn't really been behaving. When I run the program in the shell, it works every time. However, when the robot starts up it works... sometimes. The program I told it to run just tells it to turn left - but it only does that every second boot or so (not in a regular pattern) I've been trying to figure out why this is happening for a while now and I still don't understand it! I sent the program to sleep for a few seconds to see what goes on during initialisation and found this https://imgur.com/a/WA7SK SpoooOOoky! My best guess at the moment for why it's acting up is the usage of os.execute() Although it still isn't particularly consistent with other parts of the program https://pastebin.com/9DeP5fng Here's some source code so you can have a clue what I'm on about! Oh and the robot is a collection of tier one parts with a floppy drive.
  14. Though all of the other answers were very informative and helpful, yours struck a chord with me in terms of clarity. Thank all you very much for spending so much time helping me out!
  15. Well I can answer your first question - no clue about the second one though HEX is literally binary but in a form that's easier for humans to read. http://www.binaryhexconverter.com/hex-to-binary-converter So just stuff your hex number into this and paste the result into your program.
×
×
  • Create New...

Important Information

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