Here is a very hackish way to do it but it works and doesnt look bad at all.
while true do
print ("How much obsidian do you want?")
input = read()
num = tonumber(input)
shell.run("clear")
print ("Please Wait While I am Processing Your Order")
loadbar=""
if num then
for i=1, num do
percentage= i/num*100
rs.setBundledOutput("back", colors.red)
sleep(0.5)
rs.setBundledOutput("back", colors.yellow)
sleep(0.5)
rs.setBundledOutput("back", colors.blue)
sleep(3.0)
rs.setBundledOutput("back", colors.yellow)
sleep(0.5)
rs.setBundledOutput("back", colors.white)
if percentage<10
then
term.clear()
term.setCursorPos( 1, 1 )
print("Please Wait While I am Processing Your Order")
print("[- ]" .. percentage .. "%")
print(" ")print(" ")print(" ")
print("I Have : " .. num-i .. " More Obsidian to Process ")
end
if percentage>=10 and percentage<20
then
term.clear()
term.setCursorPos( 1, 1 )
print("Please Wait While I am Processing Your Order")
print("[-- ]" .. percentage .. "%")
print(" ")print(" ")print(" ")
print("I Have : " .. num-i .. " More Obsidian to Process ")
else
end
if percentage>=20 and percentage<30
then
term.clear()
term.setCursorPos( 1, 1 )
print("Please Wait While I am Processing Your Order")
print("[--- ]" .. percentage .. "%")
print(" ")print(" ")print(" ")
print("I Have : " .. num-i .. " More Obsidian to Process ")
else
end
if percentage>=30 and percentage<40
then
term.clear()
term.setCursorPos( 1, 1 )
print("Please Wait While I am Processing Your Order")
print("[------ ]" .. percentage .. "%")
print(" ")print(" ")print(" ")
print("I Have : " .. num-i .. " More Obsidian to Process ")
else
end
if percentage>=40 and percentage<50
then
term.clear()
term.setCursorPos( 1, 1 )
print("Please Wait While I am Processing Your Order")
print("[------------ ]" .. percentage .. "%")
print(" ")print(" ")print(" ")
print("I Have : " .. num-i .. " More Obsidian to Process ")
else
end
if percentage>=50 and percentage<60
then
term.clear()
term.setCursorPos( 1, 1 )
print("Please Wait While I am Processing Your Order")
print("[-------------------| ]" .. percentage .. "%")
print(" ")print(" ")print(" ")
print("I Have : " .. num-i .. " More Obsidian to Process ")
else
end
if percentage>=60 and percentage<70
then
term.clear()
term.setCursorPos( 1, 1 )
print("Please Wait While I am Processing Your Order")
print("[-------------------|----- ]" .. percentage .. "%")
print(" ")print(" ")print(" ")
print("I Have : " .. num-i .. " More Obsidian to Process ")
else
end
if percentage>=80 and percentage<90
then
term.clear()
term.setCursorPos( 1, 1 )
print("Please Wait While I am Processing Your Order")
print("[-------------------|------------- ]" .. percentage .. "%")
print(" ")print(" ")print(" ")
print("I Have : " .. num-i .. " More Obsidian to Process ")
else
end
if percentage>=90 and percentage<100
then
term.clear()
term.setCursorPos( 1, 1 )
print("Please Wait While I am Processing Your Order")
print("[-------------------|------------------ ]" .. percentage .. "%")
print(" ")print(" ")print(" ")
print("I Have : " .. num-i .. " More Obsidian to Process ")
else
end
if percentage>=100
then
term.clear()
term.setCursorPos( 1, 1 )
print("Please Wait While I am Processing Your Order")
print("[-------------------|---------------------]" .. percentage .. "%")
print(" ")print(" ")print(" ")
print("I Have : " .. num-i .. " More Obsidian to Process ")
else
end
sleep(1)
i = i+1
end
sleep(2)
term.clear()
term.setCursorPos( 1, 1 )
textutils.slowPrint("Ending Obsidian Production Program ... Done!")
sleep(0.2)
print ("I Just Processed: " .. num .. " Obsidian for you!")
sleep(0.2)
textutils.slowPrint("Re-launching Program...")
print ("--------------------------------------------------")
end
end
fyi
you may have noticed that you could just add a " " instead of calling loadbar. I did this because I plan on messing with this script some more and clean it up some so its not so resource intensive and will dynamically change loadbar ….just an fyi to those out there that would throw up when they see this :(/>/>
EDIT: updated ease of use and load bars