Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("monitor_98")
- c = peripheral.wrap("top")
- --books = {{"Top Floor Volcano","Vanquished's House","MadMen4327's and Fog","GoofyCats' House","Nukelar's House","Rurede94"},{"MarketPlace","TheNamelessOnes","Dense","Archmaestro","FlynnPark1","Volcano Bottom Floor"},{"Rigg's House","_Aincrad_","keimarrag01"}}
- --names = {{"Volcano G-Level","Vanquished's Home","MadMen and Fog","GoofyCats' Home","Nukelar's Home","Rurede94 n friends"},{"CL Marketplace","TheNamelessOnes' Home","Dense Ores World","Archmaestro's Home","FlynnPark1's Home","Volcano BR-Level"},{"Rigg's Home","_Aincrad_'s Home","Keimarrag01"}}
- books = {{"Main Floor","Mt.Doom Central Hub","B1 Power","B2 Power","Deuterium Room","Evidence Room"},{"Book 2"}}
- names = {{"Main Floor","Mt.Doom Central Hub","B1 Power","B2 Power","Deuterium Room","Evidence Room"},{"Book 2 Name"}}
- xes = {}
- max = 6
- page = 1
- vc = colors.lime
- function reset()
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear()
- end
- function cprint(w,y,text)
- term.setCursorPos((w/2)-(#text/2),y)
- term.write(text)
- end
- function getCenter(w,text,reset)
- if reset == false then
- one = (w/2)-(#text/2)
- two = one+#text
- tbl = {}
- table.insert(tbl,one)
- table.insert(tbl,two-1)
- table.insert(xes,tbl)
- elseif reset == true then
- xes = {}
- end
- end
- for i = 1,c.getInventorySize() do
- if c.getStackInSlot(i) == nil then
- c.pullItem("south",1,1,i)
- break
- end
- end
- while true do
- term.redirect(m)
- reset()
- term.setBackgroundColor(vc)
- term.setCursorPos(1,1)
- size = {term.getSize()} --term has already been redirected.
- for i = 1,size[1] do
- term.write(" ")
- end
- term.setCursorPos(1,size[2])
- for i = 1,size[1] do
- term.write(" ")
- end
- term.setCursorPos((size[1]/2)-4,size[2]-2)
- term.write(" < ")
- term.setCursorPos((size[1]/2)+1,size[2]-2)
- term.write(" > ")
- cprint(size[1],size[2],"by XMedders")
- cprint(size[1],1,"Tele Terminal")
- term.setBackgroundColor(colors.white)
- cprint(size[1],size[2]-1,"Page "..page)
- cprint(size[1],3,"Select a Destination")
- for i = 1,#books[page] do
- term.setBackgroundColor(vc)
- cpos = {term.getCursorPos()}
- cprint(size[1],cpos[2]+2," "..names[page][i].." ")
- getCenter(size[1]," "..names[page][i].." ",false)
- end
- term.restore()
- evnt = {os.pullEvent()}
- if evnt[1] == "monitor_touch" then
- for i = 1,#books[page] do
- if evnt[4] == 3+(2*i) then
- if evnt[3] >= xes[i][1] and evnt[3] <= xes[i][2] then
- print(names[page][i])
- stacks = c.getAllStacks()
- for ss = 1,#stacks do
- --print("test")
- if stacks[ss]["id"] == 6057 or stacks[ss]["id"] == 6058 then
- if stacks[ss]["destination"] == books[page][i] then
- c.pushItem("south",ss,1,1)
- sleep(3)
- c.pullItem("south",1,1,ss)
- end
- end
- end
- end
- end
- end
- if evnt[4] == size[2]-2 then
- if evnt[3] >= (size[1]/2)-5 and evnt[3] <= (size[1]/2)-2 then
- if page == 1 then
- page = #books
- else
- page = page-1
- end
- elseif evnt[3] >= (size[1]/2) and evnt[3] <= (size[1]/2)+3 then
- if page == #books then
- page = 1
- else
- page = page + 1
- end
- end
- end
- end
- getCenter(size[1],"na",true)
- end
Add Comment
Please, Sign In to add comment