Jump to content




Simple Program Help


  • You cannot reply to this topic
4 replies to this topic

#1 b0b349

  • New Members
  • 2 posts

Posted 26 July 2012 - 07:26 AM

So i was trying to make basically an automatic smelter, but I needed the redstone to repeat a certain number of times so i whipped together this along with the rest of the class. When i run it it gets to the point where the redstone turns on, then it freezes. Please Help!
local r = 1
function repeatt(par1)
repeat
rs.setOutput("bottom",true)
sleep(1)
rs.setOutput("bottom",false)
r = r+1
until r == par1
end

function main()
term.clear()
term.setCursorPos(1,1)
print("how many items are you smelting?")
time = read()
full = time*5
complete = full+10
term.clear()
term.setCursorPos(1,1)
write("You Smelting time will be approx ")
write(complete)
write(" seconds.")
repeatt(time)
sleep(complete)
repeatt(time)
shell.run("menu")
end
main()


#2 BigSHinyToys

  • Members
  • 1,001 posts

Posted 26 July 2012 - 07:52 AM

Found the bugs
this works
Spoiler


#3 brett122798

  • Members
  • 300 posts
  • LocationIn the TARDIS at an unknown place in time.

Posted 26 July 2012 - 07:53 AM

View PostBigSHinyToys, on 26 July 2012 - 07:52 AM, said:

Found the bugs
this works
Spoiler
Hah, earlier I was looking at the code and was pretty confused on what would be wrong but now it makes much more sense.

#4 b0b349

  • New Members
  • 2 posts

Posted 26 July 2012 - 07:54 AM

View PostBigSHinyToys, on 26 July 2012 - 07:52 AM, said:

Found the bugs
this works
Spoiler
thank you very much, i sat down for I don't know how long trying to figure this out.

#5 BigSHinyToys

  • Members
  • 1,001 posts

Posted 26 July 2012 - 07:59 AM

glad to have been of assistance
I guess I'm good at finding bugs because most of my own code is full of them lol XD





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users