Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- button.setMonitorSide("monitor_0")
- local monitor=peripheral.wrap("monitor_0")
- local screenx,screeny=monitor.getSize()
- local descriptionBox={["x"]=screenx*0.05,["y"]=screeny*0.55,["width"]=screenx*0.93,["height"]=screeny*0.45}
- function writeDescription(desc)
- for y=descriptionBox.y,descriptionBox.y+descriptionBox.height do
- monitor.setCursorPos(1,y)
- for i=descriptionBox.x,descriptionBox.x+descriptionBox.width do
- local x,y=monitor.getCursorPos()
- monitor.setCursorPos(math.floor(i),y)
- monitor.setBackgroundColor(256)
- monitor.write(" ")
- end
- end
- local yIndex=1
- for y=descriptionBox.y,descriptionBox.y+descriptionBox.height do
- local line=desc[yIndex]
- yIndex=yIndex+1
- if line~=nil then
- monitor.setCursorPos(math.floor(descriptionBox.x),y)
- local line=string.sub(line,0,math.floor(descriptionBox.width+0.5))
- monitor.write(line)
- end
- end
- end
- local spawners={}
- spawners[1]={
- ["type"]="Skeleton",
- ["side"]="front",
- ["description"]={
- "ID : A101",
- "Technical name : space skeleton",
- "Drops : arrows & bones.",
- "Rare Drops : bows, various armor sets",
- "Abilites : can fire 2 bows ",
- "Habitat : dark areas on the moon",
- "Notes : This create seems to have intelligence",
- " as it found a way to wear oxygen gear",
- },
- }
- spawners[1]["func"]=
- function(bool)
- redstone.setOutput(spawners[1].side,bool)
- if bool==false then return end
- writeDescription(spawners[1].description)
- end
- spawners[2]={
- ["type"]="Enderman",
- ["side"]="left",
- ["description"]={
- "ID : A102",
- "Technical name : screaming shadow",
- "Drops : ender pearls",
- "Rare Drops : N/A",
- "Abilites : can teleport with limited range ",
- "Habitat : the end",
- "Notes : We believe this creature may have found",
- " a way to teleport between dimensions",
- },
- }
- spawners[2]["func"]=
- function(bool)
- redstone.setOutput(spawners[2].side,bool)
- if bool==false then return end
- writeDescription(spawners[2].description)
- end
- function setup()
- for id,spawner in ipairs(spawners) do
- redstone.setOutput(spawner.side,false)
- if id<=2 then
- button.addButton(0.05+0.5*(id-1),0.08,0.4,0.15,spawner.type,spawner.func,true,true,16384,32,1)
- else
- button.addButton(0.05+0.5*(id-1),0.33,0.4,0.15,spawner.type,spawner.func,true,true,16384,32,1)
- end
- end
- button.addButton(0.95,0.95,0.05,0.08," ",function() os.reboot() end,true,true,16384,32,1)
- end
- setup()
- while true do
- button.run()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement