Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Electronic_steve Restarter.
- --VER 1.0 UPDATE
- local restartButton = Button:new(613, 97, 15, 15, "R", "Restart")
- WINDOWS=true
- if os.getenv('HOME') then
- WINDOWS=false
- end
- restartButton:action(function(sender)
- stampid = sim.saveStamp()
- saveid()
- if WINDOWS then
- os.execute("TASKKILL /IM \"powder.exe\" /F &&START .\\\"powder.exe\"")
- if not WINDOWS then
- os.execute("killall -s KILL \"powder\" && ./\"powder\"")
- end
- end
- end)
- function saveid()
- local id = tostring(stampid)
- local file = io.open("RestartSave.RES","w")
- if file thecn
- file:write(id)
- file:close()
- end
- end
- function filetester()
- local file = io.open("RestartSave.RES","r")
- if file then
- newstampid = file:read("*l")
- end
- end
- if fs.exists("RestartSave.RES") then
- filetester()
- sim.loadStamp (newstampid)
- tpt.set_pause(1)
- sim.deleteStamp(newstampid)
- end
- interface.addComponent(restartButton)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement