Lua Please help
Questions/Tutorials for any programming language not covered in other sections.
2 posts
Page 1 of 1
Hello i am wrighting a program for computercraft which uses the language lua i have wrote this
my aim is to build it into a stop watch so it will be (current round: 0:0:0) if anyone fancys fixing the code for me in that format but i could probally figure it out should counter error be fixed
Code: Select all
Which works bare the fact that the counter does not count it just goes to 2 and then stops does anyone know how to fix this or why. mon = peripheral.wrap("top")
term.redirect(mon)
while true do
counter = 1
counter = counter + 1
mon.clear()
mon.setCursorPos(1,1)
mon.setTextScale(2)
print("Welcome to Tekkitwars")
print("")
local nTime = os.time()
print("Current in game Time: "..textutils.formatTime( nTime, false ) )
print("")
print("Counter = "..counter)
sleep(1)
end
my aim is to build it into a stop watch so it will be (current round: 0:0:0) if anyone fancys fixing the code for me in that format but i could probally figure it out should counter error be fixed
Code: Select all
You should use
while true do
counter = 1 // Problem. Counter will be set to 1 on each loop
counter = counter + 1
Code: Select all
counter = 1
while true do
counter = counter + 1
2 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023