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

Useful Tutorials & Resources

Started by Advert, 20 February 2012 - 01:34 PM
Advert #1
Posted 20 February 2012 - 02:34 PM
View this list on Google Drive

  1. Installing ComputerCraft
              • I don't see what I'm looking for here! Unfortunately, since this thread is young, it does not have a wealth of knowledge to share. Create a new thread; or post a topic asking! More stuff will be added as it is created. Tutorials wanted:
              • Installing Programs To Your Computer
              • Saving/writing to files
              • Making some commonly requested programs: i.e 'Lock' program, …
              Updates:
              1/29/2013: Corrected link for Keycode list.
              3/6/2012: Added Keycode list.
              2/20/2012: Moved How to Create an API to it's own thread.
              2/26/2012: Added Modem tutorial; Fixed error due to forums eating numbers.
              Edited by
              FuzzyPurp #2
              Posted 20 February 2012 - 02:46 PM
              Sticky?
              Advert #3
              Posted 20 February 2012 - 03:12 PM
              Sticky?
              Once I add some more stuff to it, I guess ;)/>/>
              Espen #4
              Posted 20 February 2012 - 05:31 PM
              I'm currently rewriting / improving my post about preventing program terminations, including an explanation for the reasons and an additional solution.
              Initially I planned on just posting it in the old thread as a followup.
              Shall I post it as a tutorial for your list instead? I'd PM it to you beforehand.
              Advert #5
              Posted 20 February 2012 - 05:40 PM
              I'm currently rewriting / improving my post about preventing program terminations, including an explanation for the reasons and an additional solution.
              Initially I planned on just posting it in the old thread as a followup.
              Shall I post it as a tutorial for your list instead? I'd PM it to you beforehand.
              That would be awesome; but you need not PM it to me (I wouldn't mind proof-reading it, though), you can post a thread in the tutorial section, then I'll update this with a link to it ;)/>/>
              luza #6
              Posted 21 February 2012 - 01:24 PM
              Anyone has got problems if I translate some of them to german so that non-english speakers can use them too?
              Advert #7
              Posted 21 February 2012 - 02:05 PM
              Anyone has got problems if I translate some of them to german so that non-english speakers can use them too?
              I don't have a problem with you translating my stuff; but you should ask each author individually.
              FuzzyPurp #8
              Posted 21 February 2012 - 02:58 PM
              Anyone has got problems if I translate some of them to german so that non-english speakers can use them too?

              Web browsers should auto translate or ask to their native language. May be unnecessary.
              Advert #9
              Posted 21 February 2012 - 02:58 PM
              Anyone has got problems if I translate some of them to german so that non-english speakers can use them too?

              Web browsers should auto translate or ask to their native language. May be unnecessary.

              No. Just no. Have you seen what that translation comes up with?
              FuzzyPurp #10
              Posted 21 February 2012 - 02:59 PM
              Anyone has got problems if I translate some of them to german so that non-english speakers can use them too?

              Web browsers should auto translate or ask to their native language. May be unnecessary.

              No. Just no. Have you seen what that translation comes up with?

              Haha no, i only know English & Spanish.
              luza #11
              Posted 21 February 2012 - 03:17 PM
              Anyone has got problems if I translate some of them to german so that non-english speakers can use them too?

              Web browsers should auto translate or ask to their native language. May be unnecessary.

              No. Just no. Have you seen what that translation comes up with?
              exspecially because all the programming terms are in english and the browser will try to translate them aswell.
              schrolock #12
              Posted 29 February 2012 - 03:22 PM
              is it awaylable to code a program with that you can send a redstone signal for a time and than set pause and start again after a time??
              Espen #13
              Posted 29 February 2012 - 03:33 PM
              @schrolock:
              This will turn on the redstone output on the back of the computer for .5 seconds and then turn it off again.
              Then it will wait for 1 second and repeat the process. It will do all of this in an infinite loop.
              local pulseLength = 0.5 -- Length of redstone pulse in seconds.
              local delayLength = 1   -- Length of delay between pulses in seconds.
              local side = "back"	 -- Side of the computer we want to control redstone signals for.
              
              while true do
                redstone.setOutput( side, true )
                sleep( pulseLength )
                redstone.setOutput( side, false )
                sleep( delayLength )
              end

              Now, if you want to be able to listen for events while the redstone pulses, then it gets a bit more complicated.
              Because sleep() waits itself for an event, we can't use it if we wait for events ourselves.
              Well, we could, but then our event loop wouldn't be interactive and we would always have to wait until sleep() finishes.
              Therefore we can implement sleep() ourselves by making use of os.startTimer() instead:
              
              local pulseLength = 0.5 -- Length of redstone pulse in seconds.
              local delayLength = 1   -- Length of delay between pulses in seconds.
              local side = "back"	 -- Side of the computer we want to control redstone signals for.
              
              local pulseTimer = os.startTimer( pulseLength )
              local delayTimer
              redstone.setOutput( side, true )	-- Redstone initially turned on (will be turned back off after the first time pulseTimer fires).
              while true do
                local sEvent, param = os.pullEvent()
              
                if sEvent == "timer" and param == pulseTimer then
              	redstone.setOutput( side, false )   -- Turn off redstone output
              	delayTimer = os.startTimer( delayLength )   -- (Re-)Start delayTimer.
                end
              
                if sEvent == "timer" and param == delayTimer then
              	redstone.setOutput( side, true )	-- Turn on redstone output
              	pulseTimer = os.startTimer( pulseLength )   -- Restart pulseTimer.
                end
              
                if sEvent == "char" and param == "q" then break end
              end
              

              Yet another (and for some use cases easier) way would be to make use of the 'parallel' API and let both the redstone pulse and our own event listener run in spearate threads.
              We have to wrap their respective code in functions then, though:
              
              function redstonePulser()
                local pulseLength = .5 -- Length of redstone pulse in seconds.
                local delayLength = 1   -- Length of delay between pulses in seconds.
                local side = "back"	  -- Side of the computer we want to control redstone signals for.
              
                while true do
              	redstone.setOutput( side, true )
              	sleep( pulseLength )
              	redstone.setOutput( side, false )
              	sleep( delayLength )
                end
              end
              
              function eventProcessing()
                local side = "back"	 -- Side of the computer we want to control redstone signals for.
                local maxProgramTimer = os.startTimer( 60 )
              
                while true do
              	local sEvent, param = os.pullEvent()
              	
              	if sEvent == "char" and param == "q" then   -- 'q' breaks out of the loop, ends the function and therefore the whole program.
              	  break
              	end
              	
              	if sEvent == "timer" and param == maxProgramTimer then  -- After 60 seconds, breaks out of the loop, ends the function and therefore the whole program.
              	  break
              	end
                end
              end
              
              parallel.waitForAny( redstonePulser, eventProcessing )
              
              Edited on 29 February 2012 - 03:00 PM
              Wolvan #14
              Posted 13 March 2012 - 08:41 AM
              I start translating this post after school. Into german
              Sry for double posting but here is the translation
              Wolvan #15
              Posted 13 March 2012 - 02:06 PM
              • Verschiedene Dinge
              • Ich finde nicht was ich suche!
              • Da der Thread noch jung ist gibt es hier noch nicht soviel Wissen. Erstelle einen neuen Thread; oder schreibe ein Thema Posting! Mehr Sachen werden hinzugefügt wenn etwas geschrieben wird. gesuchte Tutorials:
              • Programme auf Computer installieren
              • Speichern/Schreiben von Dateien
              • Ein paar gefragte Programme erstellen, zum Beispiel Passwort-Schlösser, …
              Updates:
              6.3.2012: Keycodeliste hinzugefügt.
              20.2.2012: How to create an API in eigenen Thread verschoben.
              26.2.2012: Modemtutorial hinzugefügt; Fehler von verschwunden Nummern behoben.


              Translation Updates:
              13.03.2012: Erstmals veröffentlicht; Links behoben
              [right]Translation into german by Wolvan[/right]
              Advert #16
              Posted 13 March 2012 - 02:08 PM
              You killed some links :mellow:/>/>.
              Wolvan #17
              Posted 16 March 2012 - 01:47 PM
              You killed some links :D/>/>.
              Sry but no. I fixed them already
              theoriginalbit #18
              Posted 16 December 2012 - 01:10 AM
              Tutorials wanted:
              • Installing Programs To Your Computer
              • Saving/writing to files
              • Making some commonly requested programs: i.e 'Lock' program
              when you say installing programs, what do u mean? as in getting from pastebin? or having one program load another program onto like a turtle?
              AngelMalus #19
              Posted 29 December 2012 - 02:39 PM
              Tutorials wanted:
              • Installing Programs To Your Computer
              • Saving/writing to files
              • Making some commonly requested programs: i.e 'Lock' program, …

              Same question, Installing programs to your computer? Do you mean the actual physical computer? like /appdata/minecraft/saves… folder?
              Saving/writing files. Do you mean the fs api, like saving and loading data? or backing up files?
              and could you provide a commonly requested programs list?
              Doyle3694 #20
              Posted 28 January 2013 - 04:37 AM
              Lyqyd, I saw you added keycode map, link to the one on CC wiki rather than MC wiki, it is more correct(numpad enter)
              Lyqyd #21
              Posted 02 February 2013 - 10:09 AM
              Lyqyd, I saw you added keycode map, link to the one on CC wiki rather than MC wiki, it is more correct(numpad enter)

              I don't believe it was me who added the map (though perhaps it was, dunno). Either way, it links to the correct place now.

              Tutorial Request: Creating clickable buttons in ComputerCraft. It seems we have gotten a strong uptick in the frequency of these questions in the past week or so, so I'd appreciate it if someone could (create and) link one here. If it is a high-quality tutorial, it may be added to the OP of this topic. I'm going to try to put together a few tutorials for common questions and get them in the OP. Hopefully, we can cut down on the number of repeat questions.
              Engineer #22
              Posted 11 March 2013 - 08:04 AM
              You guys should include this tutorial
              http://www.computercraft.info/forums2/index.php?/topic/10654-storing-variables-in-a-file/page__fromsearch__1
              Storing variables in a file by LBPHacker
              LBPHacker #23
              Posted 11 March 2013 - 08:06 AM
              You guys should include this tutorial
              http://www.computerc...__fromsearch__1
              Storing variables in a file by LBPHacker

              Why thanks! :D/>
              LBPHacker #24
              Posted 11 March 2013 - 08:15 AM
              Hmmmm… Just have realized that this topic actually exists…


              Creating clickable buttons in ComputerCraft.
              Challenge accepted!
              Engineer #25
              Posted 11 March 2013 - 08:18 AM
              Hmmmm… Just have realized that this topic actually exists…


              Creating clickable buttons in ComputerCraft.
              Challenge accepted!

              LOL was about to write one :P/>

              We'll see wich one is better
              xD
              LBPHacker #26
              Posted 11 March 2013 - 08:37 AM
              Ummm… One quesition… Should I write an API or something like that? Not sure if I can explain buttons and basic GUI with a simple tutorial…
              austinv11 #27
              Posted 26 June 2013 - 07:56 PM
              Direwolf20's Computercraft Tutorial Vids:http://www.youtube.com/watch?v=wrUHUhfCY5A&feature=share&list=PLaiPn4ewcbkHYflo2jl0OuNaHK6Mj-koG
              For his button api:http://youtu.be/1nuMDtmnEjg