are you sure because they don't control what the line
for slot = 2, 16 do
does. As I inderstand it "slot" will be initialized to 2 on its first run, if "break" isn't encountered, it'll iterate all the way to 16 which is the second parameter passed to "for". The lines 12, 13, and 14 have no effect on this line.
I am thinking that you want it to somehow remember where it was in the loop when break was encountered. In which case you'll need a global variable call it
lastSlot for instance.
so at the top of your program you would have
lastSlot = 2
and then in your loop declaration it would look like
for slot = lastSlot, 16 do
and right before the "break" command you would have
lastSlot = slot+1
and finally I believe the lines 12, 13 & 14 were meant to check that "slot" wasn't outside of the range 2::16 so they need to be adjusted for
lastSlot. The result possibly being
if lastSlot > 16 then
lastSlot = 2
end