This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Emilgardis's profile picture

Any really good tutorials?

Started by Emilgardis, 29 July 2012 - 02:11 PM
Emilgardis #1
Posted 29 July 2012 - 04:11 PM
Hello, I have been working with CC and lua for 2 days now and I am wondering if there are any good tutorials out there.
I've read "recommended tutorials, and I've learned not that much.
I'm looking for a tutorial about perhiperials and using arguments.
If you will, you can tell me how you learned about these things, and help me. Thank you!
::Edit:: btw, By arguments I mean arguments like in the monitor program etc.
djblocksaway #2
Posted 29 July 2012 - 04:33 PM
So your wondering how to change print size on monitors and how to call the peripheral?
ReconTurtle #3
Posted 29 July 2012 - 07:48 PM
So your wondering how to change print size on monitors and how to call the peripheral?

I'd love to know this too. I'm in the same boat as Emilgardis.
Emilgardis #4
Posted 29 July 2012 - 07:53 PM
So your wondering how to change print size on monitors and how to call the peripheral?
I want to just have a good tutorial on peripherals and params.
Like this,

> Get 3 wood -- would give 3 wood
> Get 9 iron -- would give 9 iron
And the code would set the quantity set as x and the item as y and do the code from there
CastleMan2000 #5
Posted 04 October 2012 - 06:20 PM
A way to access arguments is declaring a table with … in it, like this:


local tArgs = {...}

Then you could check to see how many arguments there are:


local tArgs = {...}
if #tArgs > 2 or #tArgs <= 1 then
  error("Not enough/Too many arguments!")
end

So, you want to access them? Well two methods are A. Compare to a value manually, or B. Cycle through a table of elements. I'm going to show B.


local tArgs = {...}
local tItems = {"wood","iron"}
if #tArgs > 2 or #tArgs <= 1 then
  error("Not enough/Too many arguments!")
end
local function dispenseStuff(number)
  --do stuff to dispense the item
end
for i,v in pairs(tItems) do
  if tArgs[2] == v then
    dispenseStuff(tArgs[1])
    break
  end
end
FunshineX #6
Posted 05 October 2012 - 10:16 PM
I have a ton of tutorials on peripherals in my youtube series. There's one on monitors specifically. See sig