I'm making a overcomplicated zombie grinder and need some help with coding. So far I found 2 programs that I'd like to use (load bar, counter) but I cant seem to merge them together. If anyones bored or wants to help out I'll paste the codes below. What I'd like is to have the load bar along the top of a monitor thats 3 wide 1 tall and the counter in the bottom left. Also if its not to much to ask, in the bottom right for every 1 count on the counter it adds 7 on the left. Also, when the counter hits 200 the loadbar hits 100 and a redstone pulse is sent from any direction. Anyways, if anyone could do this I'd be really grateful!!
Counter by Bilwis11
local iCount = 0
local hMonitor = peripheral.wrap("top")
-- Monitor is on top of the computer
term.redirect(hMonitor) --redirect console output to monitor
while true do
event = os.pullEvent()
--if an redstone event is pulled and the input from
--the pressure plate (back) is TRUE, increase count
if event == "redstone" and rs.getInput("back") then
count = count + 1
term.clear()
print("Count: " .. count)
end
--if the input from the reset button (right) is TRUE,
--reset count
if event == "redstone" and rs.getInput("right") then
count = 0
term.clear()
print("Count reset")
end
end
--this doesn't get called because there is no abort
--condition, but term.restore() will reset the console
--output to the computer screen itself
term.clear()
term.restore()
Load bar by wraithbone
function HorzLoadBar(sx, fx, sym)
x,y = term.getCursorPos()
if y >= 18 then
term.clear()
term.setCursorPos(sx,1)
x,y = sx,1
end
term.setCursorPos(sx,y)
write("[")
term.setCursorPos(sx,y)
term.setCursorPos(fx-1,y)
write("]")
mdp = math.floor((sx + fx)/2) - 3
for i = (sx+1),(fx-2) do
term.setCursorPos(i,y)
write(sym)
sleep(0.1) --CHANGE THIS TO EDIT TIME
term.setCursorPos(mdp,y+1)
write(string.format("%d",i/(fx-2) * 100))
write("%")
end
term.setCursorPos(1,y+2)
end
HorzBarLoad(0,50"/")