Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wait = true
- idred = 8955
- function start()
- term.clear()
- term.setTextColor(colors.cyan)
- term.setCursorPos(1,1)
- print("Word Programm")
- term.setTextColor(colors.white)
- term.setCursorPos(15,1)
- print("by")
- term.setCursorPos(18,1)
- term.setTextColor(colors.blue)
- print("Nike622000")
- term.setCursorPos(1,2)
- term.setTextColor(colors.white)
- print("Einfach mit der Tastatur schreiben: ")
- term.setCursorPos(1,3)
- term.setTextColor(colors.red)
- print("Entf")
- term.setCursorPos(6,3)
- term.setTextColor(colors.white)
- print("druecken um alles zu loeschen!")
- xPos = 4
- yPos = 7
- xMax,yMax = term.getSize()
- end
- function main()
- while true do
- rednet.open("back")
- --print("Nachrichten werden empfangen!")
- id,message = rednet.receive()
- print(id)
- print(message)
- if id == idred and message == "Tastatur start" then
- wait = false
- i = 0
- start()
- g=1
- for l = 7,yMax-3 do
- term.setTextColor(colors.white)
- term.setCursorPos(1,l)
- if g < 10 then
- print("0"..g..":")
- else
- print(g..":")
- end
- g=g+1
- end
- senden = true
- Beschreibungkomplett = " "
- while senden do
- Eingabe = ""
- Eingabe2 = ""
- if yPos == yMax-2 then
- term.setCursorPos(1,yMax-1)
- term.setTextColor(colors.red)
- print("Maximale Textlaenge erreicht!")
- sleep(2)
- term.setCursorPos(1,yMax-1)
- print(" ")
- term.setCursorPos(1,yMax-1)
- term.setTextColor(colors.red)
- print("Datei wird gesendet!")
- rednet.send(idred,"Tastatur stopp")
- senden = false
- sleep(2)
- rednet.send(idred,"Nachricht wird übermittelt")
- sleep(1)
- rednet.send(idred,Beschreibungkomplett)
- sleep(1)
- rednet.send(idred,"Nachricht wurde übermittelt")
- start()
- os.reboot()
- end
- if xPos == xMax-1 then
- yPos = yPos+1
- xPos = 4
- Eingabe2 = "<E>"
- end
- if i == 16 then
- i = 0
- end
- if i == -1 then
- i = 15
- end
- farbe = 2^i
- term.setCursorPos(1,4)
- term.setTextColor(colors.white)
- print("Farbe mit den Pfeiltasten aendern (hoch/runter): ")
- term.setTextColor(farbe)
- print("momentane Farbe")
- event,key,x,y = os.pullEvent("key")
- if farbechange == 1 then
- Beschreibungkomplett = Beschreibungkomplett.."("..farbe..")"
- farbechange = 0
- end
- g=1
- for l = 7,yMax-3 do
- term.setTextColor(colors.white)
- term.setCursorPos(1,l)
- if l == yPos then
- term.setTextColor(colors.red)
- if g < 10 then
- print("0"..g..":")
- else
- print(g..":")
- end
- else
- term.setTextColor(colors.white)
- if g < 10 then
- print("0"..g..":")
- else
- print(g..":")
- end
- end
- g=g+1
- end
- term.setCursorPos(xPos,yPos)
- term.setTextColor(farbe)
- if key == 211 then
- start()
- g=1
- for l = 7,yMax-3 do
- term.setTextColor(colors.white)
- term.setCursorPos(1,l)
- if g < 10 then
- print("0"..g..":")
- else
- print(g..":")
- end
- g=g+1
- end
- Beschreibungkomplett = " "
- end
- if key == 2 or key == 79 then
- print("1")
- xPos=xPos+1
- Eingabe = "1"
- end
- if key == 3 or key == 80 then
- print("2")
- xPos=xPos+1
- Eingabe = "2"
- end
- if key == 4 or key == 81 then
- print("3")
- xPos=xPos+1
- Eingabe = "3"
- end
- if key == 5 or key == 75 then
- print("4")
- xPos=xPos+1
- Eingabe = "4"
- end
- if key == 6 or key == 76 then
- print("5")
- xPos=xPos+1
- Eingabe = "5"
- end
- if key == 7 or key == 77 then
- print("6")
- xPos=xPos+1
- Eingabe = "6"
- end
- if key == 8 or key == 71 then
- print("7")
- xPos=xPos+1
- Eingabe = "7"
- end
- if key == 9 or key == 72 then
- print("8")
- xPos=xPos+1
- Eingabe = "8"
- end
- if key == 10 or key == 73 then
- print("9")
- xPos=xPos+1
- Eingabe = "9"
- end
- if key == 11 or key == 82 then
- print("0")
- xPos=xPos+1
- Eingabe = "0"
- end
- if key == 16 then
- print("Q")
- xPos=xPos+1
- Eingabe = "Q"
- end
- if key == 17 then
- print("W")
- xPos=xPos+1
- Eingabe = "W"
- end
- if key == 18 then
- print("E")
- xPos=xPos+1
- Eingabe = "E"
- end
- if key == 19 then
- print("R")
- xPos=xPos+1
- Eingabe = "R"
- end
- if key == 20 then
- print("T")
- xPos=xPos+1
- Eingabe = "T"
- end
- if key == 44 then
- print("Z")
- xPos=xPos+1
- Eingabe = "Z"
- end
- if key == 22 then
- print("U")
- xPos=xPos+1
- Eingabe = "U"
- end
- if key == 23 then
- print("I")
- xPos=xPos+1
- Eingabe = "I"
- end
- if key == 24 then
- print("O")
- xPos=xPos+1
- Eingabe = "O"
- end
- if key == 25 then
- print("P")
- xPos=xPos+1
- Eingabe = "P"
- end
- if key == 28 then
- xPos = 4
- yPos = yPos+1
- Eingabe = "<E>"
- end
- if key == 30 then
- print("A")
- xPos=xPos+1
- Eingabe = "A"
- end
- if key == 31 then
- print("S")
- xPos=xPos+1
- Eingabe = "S"
- end
- if key == 32 then
- print("D")
- xPos=xPos+1
- Eingabe = "D"
- end
- if key == 33 then
- print("F")
- xPos=xPos+1
- Eingabe = "F"
- end
- if key == 34 then
- print("G")
- xPos=xPos+1
- Eingabe = "G"
- end
- if key == 35 then
- print("H")
- xPos=xPos+1
- Eingabe = "H"
- end
- if key == 36 then
- print("J")
- xPos=xPos+1
- Eingabe = "J"
- end
- if key == 37 then
- print("K")
- xPos=xPos+1
- Eingabe = "K"
- end
- if key == 38 then
- print("L")
- xPos=xPos+1
- Eingabe = "L"
- end
- if key == 21 then
- print("Y")
- xPos=xPos+1
- Eingabe = "Y"
- end
- if key == 45 then
- print("X")
- xPos=xPos+1
- Eingabe = "X"
- end
- if key == 46 then
- print("C")
- xPos=xPos+1
- Eingabe = "C"
- end
- if key == 47 then
- print("V")
- xPos=xPos+1
- Eingabe = "V"
- end
- if key == 48 then
- print("B")
- xPos=xPos+1
- Eingabe = "B"
- end
- if key == 49 then
- print("N")
- xPos=xPos+1
- Eingabe = "N"
- end
- if key == 50 then
- print("M")
- xPos=xPos+1
- Eingabe = "M"
- end
- if key == 57 then
- print(" ")
- xPos=xPos+1
- Eingabe = " "
- end
- if key == 52 then
- print(".")
- xPos=xPos+1
- Eingabe = "."
- end
- if key == 200 then
- i = i+1
- Beschreibungkomplett = Beschreibungkomplett.."("..farbe..")"
- farbchange = 1
- end
- if key == 208 then
- i = i-1
- farbchange = 1
- end
- if key == 29 then
- term.setCursorPos(1,yMax-1)
- term.setTextColor(colors.red)
- print("Datei wird gesendet!")
- rednet.send(8955,"Tastatur stopp")
- senden = false
- sleep(2)
- rednet.send(8955,"Nachricht wird übermittelt")
- sleep(1)
- rednet.send(8955,Beschreibungkomplett)
- sleep(1)
- rednet.send(8955,"Nachricht wurde übermittelt")
- start()
- os.reboot()
- end
- Beschreibungfarbe = tostring(farbe)
- Beschreibungkomplett = Beschreibungkomplett..Eingabe2..Eingabe
- term.setCursorPos(10,10)
- end
- end
- end
- end
- function wait()
- waitPosition = 0
- waitX, waitY = term.getSize()
- while true do
- if wait==true then
- for i=0,2 do
- if i==waitPosition then
- term.setTextColor(colors.cyan)
- else
- term.setTextColor(colors.white)
- end
- term.setCursorPos(math.floor((waitX-6)/2)+(waitPosition*3),math.floor(waitY/2))
- term.write("o")
- end
- end
- sleep(1)
- end
- end
- parallel.waitForAny(main, wait)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement