Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Adds import/export buttons and a text box to the save box in IGM games.
- Clicking the export button will display the save code in the text box.
- Save the code to a text file or upload and then if you need to use the backup load this mod first then use the import button.
- The functions created by the mod are modified versions of the save/load functions used by IGM.
- */
- eval('Export=' + Game.Save.toString().replace('localStorage[Game.src]=str;','l(\'savecode\').value=str'));
- eval('Import=' + Game.Load.toString().replace('function ()','function (str)').replace('var str=localStorage[Game.src];',''));
- if(!modloaded){
- l('saveBox').innerHTML +="<div class='button' onclick='Export();'>Export Save</div><div class='button' onclick='Imports();'>Import Save</div><textarea id='savecode' style = 'resize: none'></textarea>";
- var modloaded = true;
- }
- Imports=function(){
- var savecode = prompt("Enter Save Code:","");
- if(savecode && savecode.length > 20){
- Import(savecode);
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement