Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function one()
- sleep(2)
- end
- function two()
- os.pullEvent()
- bacon = false
- end
- bacon = true
- name = read()
- sensor = peripheral.wrap("left")
- mon = peripheral.wrap("top")
- while bacon == true do
- per = 0
- stored = 0
- max = 0
- parallel.waitForAny(one, two)
- data = sensor.getPlayerData(name)
- mon.clear()
- shell.run("herp")
- mon.setCursorPos(1,1)
- mon.write("SmugCam")
- mon.setCursorPos(1,3)
- mon.write("Version 1.337")
- mon.setCursorPos(1,2)
- mon.write("Locked on: "..name)
- function head()
- mon.setCursorPos(39,5)
- mon.write("Helmet: "..data["armor"]["helmet"]["name"])
- if data["armor"]["helmet"]["energyStored"] ~= nil then
- stored = data.armor.helmet.energyStored
- max = data.armor.helmet.maxEnergyStored
- per = stored / max
- percent = math.ceil(per * 100)
- mon.setCursorPos(39,6)
- mon.write(tostring(percent).."%")
- end
- if data.armor.helmet.energStored == nil then
- if data["armor"]["helmet"]["electric"] ~= nil then
- if data["armor"]["helmet"]["electric"]["charge"] ~= nil then
- stored = data.armor.helmet.electric.charge
- max = data.armor.helmet.electric.maxCharge
- per = stored / max
- percent = math.ceil(per * 100)
- mon.setCursorPos(39,6)
- mon.write(tostring(percent).."%")
- end
- end
- end
- end
- function chest()
- mon.setCursorPos(49,25)
- mon.write("Chestplate: "..data["armor"]["chestplate"]["name"])
- if data["armor"]["chestplate"]["energyStored"] ~= nil then
- stored = data.armor.chestplate.energyStored
- max = data.armor.chestplate.maxEnergyStored
- per = stored / max
- percent = math.ceil(per * 100)
- mon.setCursorPos(49,26)
- mon.write(tostring(percent).."%")
- end
- if data.armor.chestplate.energyStored == nil then
- if data["armor"]["chestplate"]["electric"] ~= nil then
- if data["armor"]["chestplate"]["electric"]["charge"] ~= nil then
- stored = data.armor.chestplate.electric.charge
- max = data.armor.chestplate.electric.maxCharge
- per = stored / max
- percent = math.ceil(per * 100)
- mon.setCursorPos(49,26)
- mon.write(tostring(percent).."%")
- end
- end
- end
- end
- function leggings()
- mon.setCursorPos(39,40)
- mon.write("Leggings: "..data["armor"]["leggings"]["name"])
- if data["armor"]["leggings"]["energyStored"] ~= nil then
- stored = data.armor.leggings.energyStored
- max = data.armor.leggings.maxEnergyStored
- per = stored / max
- percent = math.ceil(per * 100)
- mon.setCursorPos(39,41)
- mon.write(tostring(percent).."%")
- end
- if data.armor.leggings.energyStored == nil then
- if data["armor"]["leggings"]["electric"] ~= nil then
- if data["armor"]["leggings"]["electric"]["charge"] ~= nil then
- stored = data.armor.leggings.electric.charge
- max = data.armor.leggings.electric.maxCharge
- per = stored / max
- percent = math.ceil(per * 100)
- mon.setCursorPos(49,41)
- mon.write(tostring(percent).."%")
- end
- end
- end
- end
- function boots()
- mon.setCursorPos(39,50)
- mon.write("Boots: "..data["armor"]["boots"]["name"])
- if data["armor"]["boots"]["energyStored"] ~= nil then
- stored = data.armor.boots.energyStored
- max = data.armor.boots.maxEnergyStored
- per = stored / max
- percent = math.ceil(per * 100)
- mon.setCursorPos(39,51)
- mon.write(tostring(percent).."%")
- end
- if data.armor.boots.energyStored == nil then
- if data["armor"]["boots"]["electric"] ~= nil then
- if data["armor"]["boots"]["electric"]["charge"] ~= nil then
- stored = data.armor.boots.electric.charge
- max = data.armor.boots.electric.maxCharge
- per = stored / max
- percent = math.ceil(per * 100)
- mon.setCursorPos(49,51)
- mon.write(tostring(percent).."%")
- end
- end
- end
- end
- function health()
- mon.setCursorPos(1,4)
- mon.write("Health: "..tostring(math.ceil(data.health)).." / "..tostring(math.ceil(data.maxHealth)))
- end
- function distance()
- x = data["position"]["x"] + 916
- y = data["position"]["y"] + 71
- z = data["position"]["z"] + 1071
- mon.setCursorPos(1,5)
- mon.write("X: "..math.ceil(x))
- mon.setCursorPos(1,6)
- mon.write("Y: "..math.ceil(y))
- mon.setCursorPos(1,7)
- mon.write("Z: "..math.ceil(z))
- end
- function heldItem()
- mon.setCursorPos(1,60)
- mon.write("Holding a(n): "..data.heldItem.name)
- mon.setCursorPos(1,61)
- mon.write("Damage: "..data.heldItem.dmg)
- if data.heldItem.energyStored ~= nil then
- stored = data.heldItem.energyStored
- max = data.heldItem.energyStored
- percent = math.ceil(100 * (stored / max))
- mon.setCursorPos(1,64)
- mon.write("Energy Level: "..tostring(percent).."%")
- end
- mon.setCursorPos(1,62)
- mon.write("Item ID: "..data.heldItem.id)
- mon.setCursorPos(1,63)
- mon.write("Quantity: "..data.heldItem.qty)
- end
- head()
- chest()
- leggings()
- boots()
- health()
- distance()
- heldItem()
- end
- shell.run("prog")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement