Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI('usr/mobController/Prison.lua')
- textScale=0.5
- hdr={
- [[ _____ _ __ __ ]],
- [[/ ___( ) / _|/ _|]],
- [[\ `--.|/ _ __ _ _| |_| |_ ]],
- [[ `--. \ | '_ \| | | | _| _|]],
- [[/\__/ / | | | | |_| | | | | ]],
- [[\____/ |_| |_|\__,_|_| |_| ]],
- }
- mon = peripheral.wrap('top')
- monX, monY = mon.getSize()
- panel1 = window.create(mon, 1, 1, monX, #hdr)
- panel2 = window.create(mon, 1, #hdr+1, monX*0.3333, monY)
- panel3 = window.create(mon, monX*0.3333+1, #hdr+1, monX, monY)
- panels={panel1, panel2, panel3}
- panel_props = {
- {panel=panel1, background = colors.lightGray, textColor=colors.blue},
- {panel=panel2, background = colors.blue, textColor=colors.white},
- {panel=panel3, background = colors.gray, textColor=colors.white},
- --{panel=panel4, background = colors.orange, textColor = colors.white}
- }
- mon.setTextScale(textScale)
- term.redirect(panel1)
- term.setBackgroundColor(panel_props[1].background)
- term.setTextColor(panel_props[1].textColor)
- term.clear()
- term.setCursorPos(3,3)
- print('hello')
- for k,v in pairs(hdr) do
- print(v)
- end
- for k,v in pairs(panels) do
- for a,b in pairs(panel_props) do
- if b.panel == v and v~=panel1 then
- term.redirect(v)
- term.setBackgroundColor(b.background)
- term.setTextColor(b.textColor)
- term.setCursorPos(1,1)
- term.clear()
- end
- end
- end
- mon.setCursorPos(1,1)
- while true do
- scs, prisons = Prison.getPrisons()
- if not scs then
- scs, prisons = Prison.readChest(chest)
- end
- t = term.current()
- term.redirect(panel2)
- term.clear()
- term.setCursorPos(1,1)
- print(' Mobs ')
- for k, v in pairs(prisons) do
- if string.find(v.meta.displayName, 'blizz') then
- displayName = 'Blizz'
- else
- displayName = v.meta.displayName:gsub('Mob Imprisonment Tool ', '')
- displayName = displayName:gsub('[()]', '')
- end
- print(displayName)
- end
- p2x, p2y = term.getSize()
- term.setCursorPos(p2x/2-3, p2y-#hdr)
- print('reset')
- term.redirect(t)
- event, periph, x, y = os.pullEvent('monitor_touch')
- panel3.write(event, periph, x, y,'\n')
- if event then
- if x<monX*0.33 and y>#hdr+1 and y<=#hdr+1+#prisons then
- t = term.current()
- term.redirect(panel3)
- prison = prisons[y-(#hdr+1)]
- if not prison then
- print('No prison selected')
- else
- term.clear()
- term.setCursorPos(1,1)
- print(prison.meta.displayName)
- print(prison.slot)
- end
- term.redirect(t)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement