Hey Leute, ich möchte euch heute etwas über Computer Craft erzählen
CC (Kurz Computer Craft) ist ein Minecraft Mod von dan200, welcher einen Computer in Minecraft einbaut.
Mit dem Computer könnte ihr Redstone Schaltungen steuern oder Sicherheitssystem bauen.
CC nutzt für die Computer die Programmiersprache "Lua". Diese Sprache wird auch in Garry's Mod verwendet.
Code
- local Version = "1.0"
- local Password = "Test"
- local MasterPass = "Lolx3"
- local RedstoneSide = "left"
- local RedstoneTime = 3
- -- Door Code
- local oldPullEvent = os.pullEvent
- os.pullEvent = os.pullEventRaw
- local function rsAction()
- rs.setOutput( RedstoneSide, true )
- sleep( RedstoneTime )
- rs.setOutput( RedstoneSide, false )
- end
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- print(" Door Control " .. Version )
- print("")
- print("")
- write(" Passwort: ")
- local pw = read("*")
- print("")
- if pw == Password then
- print(" ** Passwort OK!")
- rsAction()
- elseif pw == MasterPass then
- print(" ** Beende ...")
- break
- else
- print(" ** Passwort ist falsch!")
- end
- sleep(2)
- end
- os.pullEvent = oldPullEvent