SHOW:
|
|
- or go back to the newest paste.
1 | shell.run("monitor top pro") | |
2 | mon = peripheral.wrap("top") | |
3 | mon.setCursorPos(1,1) | |
4 | mon.write("Disponibilite :") | |
5 | mon.setCursorPos(1,2) | |
6 | mon.write("patates") | |
7 | mon.setCursorPos(9,4) | |
8 | mon.write("8") | |
9 | mon.setCursorPos(9,5) | |
10 | mon.write("16") | |
11 | mon.setCursorPos(9,6) | |
12 | mon.write("32") | |
13 | mon.setCursorPos(9,7) | |
14 | mon.write("64") | |
15 | ||
16 | function p16() | |
17 | redstone.setOutput("back", true) | |
18 | sleep(3) | |
19 | redstone.setOutput("back", false) | |
20 | end | |
21 | ||
22 | function p8() | |
23 | redstone.setOutput("left", true) | |
24 | sleep(5) | |
25 | redstone.setOutput("left", false) | |
26 | end | |
27 | ||
28 | function p32() | |
29 | redstone.setOutput("right", true) | |
30 | sleep(4.5) | |
31 | redstone.setOutput("right", false) | |
32 | end | |
33 | ||
34 | function p64() | |
35 | redstone.setOutput("bottom", true) | |
36 | sleep(1.5) | |
37 | redstone.setOutput("bottom", false) | |
38 | end | |
39 | ||
40 | while true do | |
41 | event , sides , xpos ,ypos = os.pullEvent("monitor_touch") | |
42 | print("x pos ="..xpos) | |
43 | print("y pos ="..ypos) | |
44 | ||
45 | if ((xpos>6) and (xpos<14)) and (ypos==4) then | |
46 | p8() | |
47 | end | |
48 | ||
49 | if ((xpos>6) and (xpos<14)) and (ypos==5) then | |
50 | p16() | |
51 | end | |
52 | ||
53 | if ((xpos>6) and (xpos<14)) and (ypos==6) then | |
54 | p32() | |
55 | end | |
56 | ||
57 | if ((xpos>6) and (xpos<14)) and (ypos==7) then | |
58 | p64() | |
59 | end | |
60 | ||
61 | end |