6 posts
Posted 04 December 2013 - 11:08 AM
Hello everyone on the computercraftforums.
I recently started getting into computercraft, but since i haven't got any experience in codint what soever i was wondering. What is the best thing/way to begin learning. If i see a basic simple programm like a lock i understand what most of the code means. But writing something like it myself is something i'm still a far way from. Any suggestions on how to start learning lua are more than welcome.
-Robskie
23 posts
Location
(Insert egocentric quote here)
Posted 04 December 2013 - 01:01 PM
I started learning Lua just by reading it. With computercraft, you have to understand that there are two parts, Lua, and the Computercraft API's. Learn some basic stuff, like print() conditional statements (if then), how to create a loop, then understand how and API works, how to use parameters, and functions. A common resource I use is
http://www.lua.org/manual/5.1/ for basic Lua stuff, and
http://computercraft.info/wiki/Category:APIs because this covers most of the code in Computercraft. Once you understand the basics of Lua, look into some of the simpler API's, such as the Term API, the OS API and the Redstone API. Monitors, printers, and modems use the Peripheral API, but modems have a seperate API, the Rednet API. Download simple programs and study code structures. Note that to download, you need to have the HTTP API enabled (whole seperate story) I liked the beggining of Funshine X's tutorials
https://www.youtube.com/playlist?list=PL69E38751E0C625FEPM Me if you want more
1852 posts
Location
Sweden
Posted 04 December 2013 - 01:49 PM
Well this depends on which way you like to learn / learn best from, It may be tutorial videos, texts or even just looking through someones code to learn.
Lua is the best language to start with when you learn programming since it's easy to learn IMO and it'll help to learn other languages easier after that.
But yeah.. I already see that there is useful links in the post above.
It would probably be best to start with the lua.org site when learning and then just mess around with it in CC to test it the codes you produce.
995 posts
Location
Canada
Posted 04 December 2013 - 11:41 PM
To learn, I used a mix of FunshineX's CC Tutorials, a PDF I have of the latest PIL (3rd Edition) and just by reading some CC Code, even complex stuff I don't completely understand, such as NitrogenFingers's Gold Runner. Also, let the interpreter scream at you, then debug the messages. Most are them are pretty logical, like this common one:
Attempt to call nil.
Simply, you are trying to call a nil function. It depends on how you learn best, as Hellkid98 said. Also for learning,
I recommend you enable the HTTP API in ComputerCraft.cfg, so you can download programs to look at easily.
6 posts
Posted 05 December 2013 - 10:07 AM
Thanks very much for the replies guys!