Jump to content




Loop repeats one more time


  • You cannot reply to this topic
1 reply to this topic

#1 Zelman89

  • Members
  • 20 posts

Posted 14 July 2013 - 01:53 PM

Full code if interested. The zDrive contains "for k,v then" type loop functions. Not sure if this is a loop paradox issue or something crazy.

Spoiler

everything works so I put in a spoiler but here is my issue.
  function()
	while true do
	  event, char = os.pullEvent("char")
	  if char == "r" then
		shell.run("storageL")
	  elseif char == "h" then
		shell.run("storageL")
	  else
		zDrive.monClear(MO, mon1, mon2)
		zDrive.monClear(1, term, nil)
		term.setCursorPos(1, 1)
		break
	  end
	end
  end

if I press any key not noted it ends the loop and clears the screen but sometimes it runs the first part one more time. Not sure if the cache is not clearing or what. I want to press any key and the screen clears and it ready for the next input. Any ideas what my issue is.

#2 Zelman89

  • Members
  • 20 posts

Posted 14 July 2013 - 01:56 PM

I think I found my issue. Had to add a longer Sleep for the first action to finish so it was trying to break something it couldn't break.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users