View difference between Paste ID: 92ZLXrgR and aNZZpBLM
SHOW: | | - or go back to the newest paste.
1
-- MFR Autospawner control panel using AE, for CC 1.63+ (No Bundled cable support).
2
-- Outputs Redstone signal in varying strength down bottom of computer. Use a MFR Programmable Rednet Controller to translate RS strength signals into Bundled cable colour channels corresponding to table below:
3
-- white/RSS 1: remove safari net
4-
monitor = peripheral.wrap("top")
4+
-- orange/RSS 2: mob 1 Wither skeleton
5
-- magenta/RSS 3: mob 2 Blaze
6
-- lightBlue/RSS 4: mob 3 Enderman
7
-- yellow/RSS 5: mob 4 Ghast
8
-- lime/RSS 6: mob 5 Slime
9
-- pink/RSS 7: mob 6 Blizz
10
-- gray/RSS 8: mob 7
11
-- lightgray/RSS 9: mob 8 Villagers
12
13
--Details on "physical" build: http://forum.feed-the-beast.com/threads/rhns-continued-adventures-a-build-journal-guide-collection-etc.42664/page-10#post-658213
14
15
16
mouseWidth = 0
17
mouseHeight = 0
18
19
function detectDevice(DeviceName)
20
DeviceSide="none"
21
for k,v in pairs(redstone.getSides()) do
22
 if peripheral.getType(v)==DeviceName then
23
   DeviceSide = v
24
   break
25
 end
26
end
27
  return(DeviceSide)
28
end
29
30
MonitorSide=detectDevice("monitor")
31
 
32
if MonitorSide~="none" then
33
      monitor=peripheral.wrap(MonitorSide)
34
   print ("Monitor on the " .. MonitorSide .. " connected.")
35
else
36
   print("No monitor found")
37
end
38
39
monitor.clear()
40
41
42
monitor.setCursorPos(1,1)
43
44
w,h=monitor.getSize()
45
46
print(w)
47
print(h)
48
49
-- Draw buttons
50
monitor.setBackgroundColour((colours.lime))
51
monitor.setCursorPos(2,2)
52
monitor.write(" Wither Skelly  ")
53
54
monitor.setBackgroundColour((colours.lime))
55
monitor.setCursorPos(2,4)
56
monitor.write(" Blaze          ")
57
58
monitor.setBackgroundColour((colours.lime))
59-
-- white: remove safari net
59+
60-
-- orange: mob 1 Wither skeleton
60+
61-
-- magenta: mob 2 Blaze
61+
62-
-- lightBlue: mob 3 Enderman
62+
63-
-- yellow: mob 4 Ghast
63+
64-
-- lime: mob 5 Slime
64+
65-
-- pink: mob 6 Blizz
65+
66-
-- gray: mob 7
66+
67-
-- lightgray: mob 8 Villagers
67+
68
monitor.write(" Green Slime    ")
69
70
monitor.setBackgroundColour((colours.lime))
71
monitor.setCursorPos(2,12)
72-
    	redstone.setBundledOutput("bottom", colors.white)
72+
73
74-
	redstone.setBundledOutput("bottom", colors.orange)
74+
75
monitor.setCursorPos(2,14)
76
monitor.write(" Mob 7          ")
77-
      	redstone.setBundledOutput("bottom", colors.white)
77+
78
monitor.setBackgroundColour((colours.lime))
79-
	redstone.setBundledOutput("bottom", colors.magenta)
79+
80
monitor.write(" Villagers      ")
81
82-
      	redstone.setBundledOutput("bottom", colors.white)
82+
83
monitor.setCursorPos(2,18)
84-
	redstone.setBundledOutput("bottom", colors.lightBlue)
84+
85
86
monitor.setBackgroundColour((colours.black))
87-
      	redstone.setBundledOutput("bottom", colors.white)
87+
88
89-
	redstone.setBundledOutput("bottom", colors.yellow)
89+
90
-- Check click function
91
92-
      	redstone.setBundledOutput("bottom", colors.white)
92+
93
-- white/RSS 1: remove safari net
94-
	redstone.setBundledOutput("bottom", colors.lime)
94+
-- orange/RSS 2: mob 1 Wither skeleton
95
-- magenta/RSS 3: mob 2 Blaze
96
-- lightBlue/RSS 4: mob 3 Enderman
97-
      	redstone.setBundledOutput("bottom", colors.white)
97+
-- yellow/RSS 5: mob 4 Ghast
98
-- lime/RSS 6: mob 5 Slime
99-
	redstone.setBundledOutput("bottom", colors.pink)
99+
-- pink/RSS 7: mob 6 Blizz
100
-- gray/RSS 8: mob 7
101
-- lightgray/RSS 9: mob 8 Villagers
102-
      	redstone.setBundledOutput("bottom", colors.white)
102+
103
104-
	redstone.setBundledOutput("bottom", colors.gray)
104+
105
  if mouseWidth > 1 and mouseWidth < 18 and mouseHeight == 2 then
106
    -- button 1 clicked
107-
      	redstone.setBundledOutput("bottom", colors.white)
107+
    	redstone.setAnalogOutput("bottom", 1)
108
	sleep(1)
109-
	redstone.setBundledOutput("bottom", colors.lightGray)
109+
	redstone.setAnalogOutput("bottom", 2)
110
  elseif mouseWidth > 1 and mouseWidth < 18 and mouseHeight == 4 then
111-
	redstone.setBundledOutput("bottom", colors.white)
111+
112
      	redstone.setAnalogOutput("bottom", 1)
113
	sleep(1)
114-
      	redstone.setBundledOutput("bottom", colors.white)
114+
	redstone.setAnalogOutput("bottom", 3)
115
   elseif mouseWidth > 1 and mouseWidth < 18 and mouseHeight == 6 then
116
    -- button 3 clicked
117
      	redstone.setAnalogOutput("bottom", 1)
118
	sleep(1)
119
	redstone.setAnalogOutput("bottom", 4)
120
   elseif mouseWidth > 1 and mouseWidth < 18 and mouseHeight == 8 then
121
    -- button 4 clicked
122
      	redstone.setAnalogOutput("bottom", 1)
123
	sleep(1)
124
	redstone.setAnalogOutput("bottom", 5)
125
   elseif mouseWidth > 1 and mouseWidth < 18 and mouseHeight == 10 then
126
    -- button 5 clicked
127
      	redstone.setAnalogOutput("bottom", 1)
128
	sleep(1)
129
	redstone.setAnalogOutput("bottom", 6)
130
   elseif mouseWidth > 1 and mouseWidth < 18 and mouseHeight == 12 then
131
    -- button 6 clicked
132
      	redstone.setAnalogOutput("bottom", 1)
133
	sleep(1)
134
	redstone.setAnalogOutput("bottom", 7)
135
   elseif mouseWidth > 1 and mouseWidth < 18 and mouseHeight == 14 then
136
    -- button 7 clicked
137
      	redstone.setAnalogOutput("bottom", 1)
138
	sleep(1)
139
	redstone.setAnalogOutput("bottom", 8)
140
   elseif mouseWidth > 1 and mouseWidth < 18 and mouseHeight == 16 then
141
    -- button 8 clicked (Villagers, auto stop after sleep period)
142
      	redstone.setAnalogOutput("bottom", 1)
143
	sleep(1)
144
	redstone.setAnalogOutput("bottom", 9)
145
	sleep(40)
146
	redstone.setAnalogOutput("bottom", 1)
147
   elseif mouseWidth > 1 and mouseWidth < 18 and mouseHeight == 18 then
148
    -- button 9 stop clicked
149
      	redstone.setAnalogOutput("bottom", 1)
150
  end
151
end
152
153
154
155
repeat 
156
157
158
  event,p1,p2,p3 = os.pullEvent()
159
  
160
   if event=="monitor_touch" then
161
   
162
     mouseWidth = p2 -- sets mouseWidth 
163
     mouseHeight = p3 -- and mouseHeight 
164
     checkClickPosition() -- this runs our function
165
     
166
   end
167
168
   
169
    
170
until event=="char" and p1==("x")