Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("back")
- print("Fernsteuerung gestartet...")
- os.sleep(1.5)
- bewegung="Ebene"
- arbeit="Abbau"
- write("Geben Sie die ID der Drohne ein: ")
- id = io.read()
- id=id+0
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- while true do
- local event, key = os.pullEvent( "key" )
- schalter=0
- if schalter==0 and bewegung=="Ebene" and key == keys.numPadAdd then
- bewegung="Hohe"
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- schalter=1
- end
- if schalter==0 and bewegung=="Hohe" and key == keys.numPadAdd then
- bewegung="Ebene"
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- schalter=1
- end
- if schalter==0 and arbeit=="Abbau" and key == keys.numPad6 then
- arbeit="Bau"
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- schalter=1
- end
- if schalter==0 and arbeit=="Bau" and key == keys.numPad6 then
- arbeit="Scan"
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- schalter=1
- end
- if schalter==0 and arbeit=="Scan" and key == keys.numPad6 then
- arbeit="Abbau"
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- schalter=1
- end
- if schalter==0 and arbeit=="Abbau" and key == keys.numPad4 then
- arbeit="Scan"
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- schalter=1
- end
- if schalter==0 and arbeit=="Scan" and key == keys.numPad4 then
- arbeit="Bau"
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- schalter=1
- end
- if schalter==0 and arbeit=="Bau" and key == keys.numPad4 then
- arbeit="Abbau"
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- schalter=1
- end
- if bewegung=="Ebene" and key == keys.up then
- rednet.send(id,"vor")
- end
- if bewegung=="Ebene" and key == keys.down then
- rednet.send(id,"back")
- end
- if key == keys.left then
- rednet.send(id,"links")
- end
- if key == keys.right then
- rednet.send(id,"rechts")
- end
- if bewegung=="Hohe" and key == keys.up then
- rednet.send(id,"hoch")
- end
- if bewegung=="Hohe" and key == keys.down then
- rednet.send(id,"runter")
- end
- if arbeit=="Abbau" and key == keys.numPad5 then
- rednet.send(id,"abbau")
- end
- if arbeit=="Abbau" and key == keys.numPad8 then
- rednet.send(id,"abbauUp")
- end
- if arbeit=="Abbau" and key == keys.numPad2 then
- rednet.send(id,"abbauDown")
- end
- if arbeit=="Bau" and key == keys.numPad5 then
- rednet.send(id,"bau")
- end
- if arbeit=="Bau" and key == keys.numPad8 then
- rednet.send(id,"bauUp")
- end
- if arbeit=="Bau" and key == keys.numPad2 then
- rednet.send(id,"bauDown")
- end
- if arbeit=="Scan" and key == keys.numPad5 then
- rednet.send(id,"scan")
- id,msg = rednet.receive()
- print(msg)
- os.sleep(3.0)
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- end
- if arbeit=="Scan" and key == keys.numPad8 then
- rednet.send(id,"scanUp")
- id,msg = rednet.receive()
- print(msg)
- os.sleep(3.0)
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- end
- if arbeit=="Scan" and key == keys.numPad2 then
- rednet.send(id,"scanDown")
- id,msg = rednet.receive()
- print(msg)
- os.sleep(3.0)
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- end
- if key == keys.numPad0 then
- shell.run("clear")
- rednet.send(id,"Inventar")
- id,msg = rednet.receive()
- print(msg)
- id,msg = rednet.receive()
- write("Menge: ")
- print(msg)
- os.sleep(3.0)
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- end
- if key == keys.numPadDivide then
- os.sleep(0.1)
- shell.run("clear")
- write("Geben Sie eine Nummer ein (1-16): ")
- number = io.read()
- number=number+0
- wahl=0
- if number==1 then
- rednet.send(id,"slot1")
- wahl=1
- end
- if number==2 then
- rednet.send(id,"slot2")
- wahl=1
- end
- if number==3 then
- rednet.send(id,"slot3")
- wahl=1
- end
- if number==4 then
- rednet.send(id,"slot4")
- wahl=1
- end
- if number==5 then
- rednet.send(id,"slot5")
- wahl=1
- end
- if number==6 then
- rednet.send(id,"slot6")
- wahl=1
- end
- if number==7 then
- rednet.send(id,"slot7")
- wahl=1
- end
- if number==8 then
- rednet.send(id,"slot8")
- wahl=1
- end
- if number==9 then
- rednet.send(id,"slot9")
- wahl=1
- end
- if number==10 then
- rednet.send(id,"slot10")
- wahl=1
- end
- if number==11 then
- rednet.send(id,"slot11")
- wahl=1
- end
- if number==12 then
- rednet.send(id,"slot12")
- wahl=1
- end
- if number==13 then
- rednet.send(id,"slot13")
- wahl=1
- end
- if number==14 then
- rednet.send(id,"slot14")
- wahl=1
- end
- if number==15 then
- rednet.send(id,"slot15")
- wahl=1
- end
- if number==16 then
- rednet.send(id,"slot16")
- wahl=1
- end
- os.sleep(0.3)
- if wahl==0 then
- print("Fehlgeschlagen")
- else
- print("Erfolgreich")
- end
- os.sleep(0.7)
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- end
- if key == keys.numPadSubtract then
- rednet.send(id,"tanken")
- id,msg = rednet.receive()
- print(msg)
- os.sleep(3.0)
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- end
- if key == keys.numPad7 then
- shell.run("clear")
- rednet.send(id,"fuel")
- id,msg = rednet.receive()
- write("Tankfuellstand: ")
- print(msg)
- os.sleep(3.0)
- shell.run("clear")
- print("Aktuelle Einstellungen:")
- write("Bewegungsmodus: ")
- print(bewegung)
- write("Arbeitsmodus: ")
- print(arbeit)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment