unurohack 1 Posted April 14, 2016 Report Share Posted April 14, 2016 (edited) Hello,I need some help, function below opens an alert with some numbers, but ubot not support alert, so...I want to add the result in a %variable, can do that?Probably should be replaced "alert" with another function..Thank you! javascript:var coords=[];for(x=0;x<TWMap.size[1];x++)for(y=0;y<TWMap.size[0];y++){coord=TWMap.map.coordByPixel(TWMap.map.pos[0]+TWMap.tileSize[0]*y,TWMap.map.pos[1]+TWMap.tileSize[1]*x);if(coord)if(village=TWMap.villages[coord.join("")])if(village.owner==="0")coords.push(coord.join("|" ))}alert(coords.join(' '));void 0 Edited April 14, 2016 by unurohack Quote Link to post Share on other sites
unurohack 1 Posted April 14, 2016 Author Report Share Posted April 14, 2016 (edited) So, i solve the problem with alert, i add document.write, but i need add this result in list. javascript:var coords=[];for(x=0;x<TWMap.size[1];x++)for(y=0;y<TWMap.size[0];y++){coord=TWMap.map.coordByPixel(TWMap.map.pos[0]+TWMap.tileSize[0]*y,TWMap.map.pos[1]+TWMap.tileSize[1]*x);if(coord)if(village=TWMap.villages[coord.join("")])if(village.owner==="0")coords.push(coord.join("|" ))}document.write(coords.join(' '));void 0 Edited April 14, 2016 by unurohack Quote Link to post Share on other sites
deliter 203 Posted April 14, 2016 Report Share Posted April 14, 2016 instead of document.writeuse eval put that entire expression in a @Run JavaScript commandthen after that eval ,maybe something like 'coords' or 'JSON.stringify(cords)' add item to list(%items,$eval("insert here"),"Don\'t Delete","Global") Quote Link to post Share on other sites
pash 504 Posted April 15, 2016 Report Share Posted April 15, 2016 sample javascript alert by $eval command alert($eval("var x = \'hi\'; x;")) set(#Message,"Hi","Global") alert($eval("var x = \'{#Message}\'; x;")) Quote Link to post Share on other sites
unurohack 1 Posted May 9, 2016 Author Report Share Posted May 9, 2016 Thank you! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.