r/ComputerCraft • u/Yeet_playfun • May 01 '25
How can i learn ComputerCraft?
i want to learn how to use computer craft and the ballistix addon. i first want to figure out how to make a repeating redstone signal if posible
14
Upvotes
View all comments
Show parent comment
20
u/thegroundbelowme May 01 '25
Well, that's a good start. I'll tell you what I did (though I'm a professional developer, so my approach was probably different from a novice's)
Tips on learning:
("Property %a has value %a"):format("foo", foo). Iffoo = barthis will result in the string "Property foo has value bar". See this section of the docs for the different tokens you can use in format strings.If you have a bunch of related functions cluttering up your main program, consider extracting them into a library. For example, you could create folder called "libs," and in that folder create a file name "itemUtils.lua". That itemUtils could then have functions like
findItemInContainer, orcontainerContainsItem, ormoveItemFromThisToThat. Then at the bottom of the file, you can writeThis basically creates a module that you can then "require" in your main folder, like this:
local iUtils = require("libs/itemUtils"), and you can then call any of the functions by doing e.g.iUtils.findItemInContainer(...)Past that, just check out the various tutorials linked under the "Getting Started" section of https://tweaked.cc/