Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mode=2
- anz=1
- dir="W"
- function draw1()
- --Head
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setTextColor(colors.white)
- term.setCursorPos(1,1)
- term.write("Position")
- term.setCursorPos(1,2)
- term.write("Controll")
- term.setCursorPos(11,1)
- term.write("Hight")
- term.setCursorPos(11,2)
- term.write("Controll")
- --NOSW
- term.setTextColor(colors.yellow)
- term.setCursorPos(4,4)
- term.write("S")
- term.setCursorPos(4,5)
- term.write("|")
- term.setCursorPos(2,6)
- term.write("O- -W")
- term.setCursorPos(4,7)
- term.write("|")
- term.setCursorPos(4,8)
- term.write("N")
- --UP Down
- term.setTextColor(colors.orange)
- term.setCursorPos(14,4)
- term.write("@")
- term.setCursorPos(14,5)
- term.write("|")
- term.setCursorPos(14,7)
- term.write("|")
- term.setCursorPos(14,8)
- term.write("V")
- --mode
- term.setTextColor(colors.white)
- term.setCursorPos(1,10)
- term.write("X Manuell")
- term.setCursorPos(3,11)
- term.write("Automatik")
- --credits
- --term.setTextColor(colors.lime)
- --term.setCursorPos(8,12)
- --term.write("by SimssmiS")
- end
- --draw1()
- function draw2()
- term.setBackgroundColor(colors.black)
- term.clear()
- --Dir
- term.setTextColor(colors.white)
- term.setCursorPos(1,1)
- term.write("Dir: "..dir)
- term.setCursorPos(3,3)
- term.write("S")
- term.setCursorPos(2,4)
- term.write("O W")
- term.setCursorPos(3,5)
- term.write("N")
- --Option
- term.setCursorPos(9,3)
- term.write("Raise")
- term.setCursorPos(9,4)
- term.write("Move")
- term.setCursorPos(9,5)
- term.write("Move+Dig")
- --Anzahl
- term.setCursorPos(11,7)
- term.write("++")
- term.setCursorPos(11,9)
- term.write("--")
- tmp=""..anz
- if string.len(tmp)==1 then
- tmp="0"..anz
- end
- term.setCursorPos(6,8)
- term.write("Anz: "..tmp)
- --mode
- term.setCursorPos(1,10)
- term.write(" Manuell")
- term.setCursorPos(1,11)
- term.write("X Automatik")
- end
- function getInput()
- event,side,x,y=os.pullEvent("monitor_touch")
- return x,y
- end
- function touch1()
- draw1()
- x,y=getInput()
- if x>=1 and x<=11 and y==10 then
- mode=1
- elseif x>=1 and x<=11 and y==11 then
- mode=2
- end
- end
- function touch2()
- draw2()
- x,y=getInput()
- if x==3 and y==3 then
- dir="S"
- elseif x==2 and y==4 then
- dir="O"
- elseif x==4 and y==4 then
- dir="W"
- elseif x==3 and y==5 then
- dir="N"
- elseif x==11 and y==7 then
- anz=anz+10
- elseif x==12 and y==7 then
- anz=anz+1
- elseif x==11 and y==9 then
- anz=anz-10
- elseif x==12 and y==9 then
- anz=anz-1
- end
- if x>=1 and x<=11 and y==10 then
- mode=1
- elseif x>=1 and x<=11 and y==11 then
- mode=2
- end
- end
- while true do
- if mode==1 then
- touch1()
- elseif mode==2 then
- touch2()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement