I haven't been around nor have I touched this in forever. Hopefully this could be of some use.
Edit: I didn't care about readability or ease of use. The whole "making a script" thing was a small adventure for me in order to see what I could create so apologies for any sloppy code or whatever.
Dicovered and fixed a critical bug that if you in any way shape or form disconnect while smelting script would stop working but will keep logging you back in/stay logged in until manual stop.
Now if you were to disconnect, script will stay logged off until it would have completed that inventory, then log in and continue.