SHOW:
|
|
- or go back to the newest paste.
1 | rednet.open("right") | |
2 | - | x=8767 |
2 | + | id=8767 |
3 | x=20 | |
4 | y=7 | |
5 | dir=1 | |
6 | term.clear() | |
7 | - | print("Forward") |
7 | + | term.setCursorPos(x,y) |
8 | - | rednet.send(x,"Forward") |
8 | + | |
9 | local sEvent, param = os.pullEvent("key") | |
10 | ||
11 | if param == 200 then | |
12 | rednet.send(id,"Forward") | |
13 | - | print("Left") |
13 | + | |
14 | - | rednet.send(x,"Left") |
14 | + | |
15 | ||
16 | if param == 203 then | |
17 | rednet.send(id,"Left") | |
18 | sleep(0.2) | |
19 | - | print("Right") |
19 | + | |
20 | - | rednet.send(x,"Right") |
20 | + | |
21 | if param == 205 then | |
22 | rednet.send(id,"Right") | |
23 | sleep(0.2) | |
24 | end | |
25 | - | print("Back") |
25 | + | |
26 | - | rednet.send(x,"Back") |
26 | + | |
27 | rednet.send(id,"Back") | |
28 | sleep(0.2) | |
29 | end | |
30 | ||
31 | - | print("Dig") |
31 | + | |
32 | - | rednet.send(x,"Dig") |
32 | + | rednet.send(id,"Dig") |
33 | sleep(0.2) | |
34 | end | |
35 | ||
36 | if param == 12 then | |
37 | - | print("Place") |
37 | + | rednet.send(id,"Place") |
38 | - | rednet.send(x,"Place") |
38 | + | |
39 | end | |
40 | ||
41 | if param == 17 then | |
42 | rednet.send(id,"Up") | |
43 | - | print("Up") |
43 | + | |
44 | - | rednet.send(x,"Up") |
44 | + | |
45 | ||
46 | if param == 31 then | |
47 | rednet.send(id,"Down") | |
48 | sleep(0.2) | |
49 | - | print("Down") |
49 | + | |
50 | - | rednet.send(x,"Down") |
50 | + | |
51 | ||
52 | id,recall,distance=rednet.receive() | |
53 | ||
54 | - | if param == 20 then |
54 | + | |
55 | - | print("Shutdown") |
55 | + | if recall=="Right" then |
56 | - | rednet.send(x,"Shutdown") |
56 | + | dir=dir+1 |
57 | end | |
58 | ||
59 | if recall=="Left" then | |
60 | - | if param == 2 then |
60 | + | dir=dir-1 |
61 | - | print("Slot1") |
61 | + | end |
62 | - | rednet.send(x,"Slot1") |
62 | + | |
63 | if dir<1 then | |
64 | dir=4 | |
65 | end | |
66 | - | if param ==3 then |
66 | + | |
67 | - | print("Slot2") |
67 | + | if dir>4 then |
68 | - | rednet.send(x,"Slot2") |
68 | + | dir=1 |
69 | end | |
70 | ||
71 | if dir==1 then | |
72 | - | if param == 4 then |
72 | + | look="^" |
73 | - | print("Slot3") |
73 | + | end |
74 | - | rednet.send(x,"Slot3") |
74 | + | if dir==2 then |
75 | look=">" | |
76 | end | |
77 | if dir==3 then | |
78 | - | if param == 5 then |
78 | + | look="v" |
79 | - | print("Slot4") |
79 | + | end |
80 | - | rednet.send(x,"Slot4") |
80 | + | if dir==4 then |
81 | look="<" | |
82 | end | |
83 | ||
84 | - | if param == 6 then |
84 | + | if recall=="Forward" then |
85 | - | print("Slot5") |
85 | + | if dir==1 then |
86 | - | rednet.send(x,"Slot5") |
86 | + | y=y-1 |
87 | end | |
88 | if dir==2 then | |
89 | x=x+1 | |
90 | - | if param == 7 then |
90 | + | end |
91 | - | print("Slot6") |
91 | + | if dir==3 then |
92 | - | rednet.send(x,"Slot6") |
92 | + | y=y+1 |
93 | end | |
94 | if dir==4 then | |
95 | x=x-1 | |
96 | - | if param == 8 then |
96 | + | end |
97 | - | print("Slot7") |
97 | + | end |
98 | - | rednet.send(x,"Slot7") |
98 | + | |
99 | if recall=="Back" then | |
100 | if dir==1 then | |
101 | y=y+1 | |
102 | - | if param == 9 then |
102 | + | end |
103 | - | print("Slot8") |
103 | + | if dir==2 then |
104 | - | rednet.send(x,"Slot8") |
104 | + | x=x-1 |
105 | end | |
106 | if dir==3 then | |
107 | y=y-1 | |
108 | - | if param == 10 then |
108 | + | end |
109 | - | print("Slot9") |
109 | + | if dir==4 then |
110 | - | rednet.send(x,"Slot9") |
110 | + | x=x+1 |
111 | end | |
112 | end | |
113 | ||
114 | - | if param == 19 then |
114 | + | if recall=="blocked" then |
115 | - | print("Redstone") |
115 | + | end |
116 | - | rednet.send(x,"Redstone") |
116 | + | term.setCursorPos(x,y) |
117 | term.write(look) | |
118 | ||
119 | ||
120 | end |