- Sky
- Blueberry
- Slate
- Blackcurrant
- Watermelon
- Strawberry
- Orange
- Banana
- Apple
- Emerald
- Chocolate
- Charcoal
Fictitious Rotor
Members-
Content Count
15 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Fictitious Rotor
-
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
-
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
-
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
-
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!
-
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 everythin
-
How could I get the current used RAM of the computer?
Fictitious Rotor replied to augitesoul's question in Programming
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 th -
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!
-
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.
-
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 wha
-
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 ea
-
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!
-
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.
-
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!
-
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.
-
I've been working on robots that don't have interfaces - and instead commune by wireless means. Part of programming these robots has involved writing on an EEPROM My problem lies with getting certain APIs. I've previously encountered things such as modem = component.proxy(component.list("modem")()) to get to an API, but FileSystem doesn't work this way. The program here (ran on a computer) wouldn't work as I put fs = require("component").filesystem Where I should have put fs = require("filesystem") If I make this change, the program works. But if