DeletedUser105718
Guest
- Author
- Stotty2009
- Contributors
- dalesmckay
- Quickbar Entry
-
javascript:var author="Stotty2009 but most of the code is from: dalesmckay@gmail.com",minVer="7.2",win=window.frames.length>0?window.main:window,ver=win.game_data.version.split("_");function getMode(){mode=prompt("b for barb villages, p for player villages, or t for tribe villages","p"),mode=mode.toLowerCase(),checkMode()}function checkMode(){"p"==mode?playername=prompt("which player pl0x?","Stotty2009")+" ":"t"==mode?tribename=prompt("which tribe pl0x?","Crazy Muthas"):"b"==mode||getMode()}function trim(e){return e.replace(/^\s+|\s+$/g,"")}if(getMode(),!ver||parseFloat(ver[1])<minVer)alert("This script requires v"+minVer+" or higher.\nYou are running: v"+ver[1]);else if("map"==win.game_data.screen){var col,row,coord,village,player,points,coords=[];for(row=0;row<TWMap.size[1];row++)for(col=0;col<TWMap.size[0];col++)if((coord=TWMap.map.coordByPixel(TWMap.map.pos[0]+TWMap.tileSize[0]*col,TWMap.map.pos[1]+TWMap.tileSize[1]*row))&&(village=TWMap.villages[coord.join("")])){if(player=null,parseInt(village.owner||"0",10)){player=TWMap.players[village.owner];var ally=TWMap.allies[player.ally]}player?"p"==mode?trim(player.name)==trim(playername)&&coords.push(coord.join("|")):"t"==mode&&ally&&trim(ally.name)==trim(tribename)&&coords.push(coord.join("|")):"b"==mode&&coords.push(coord.join("|"))}alert(coords.join(" "))}else alert("Run this script from the Map.\nRedirecting now..."),self.location=win.game_data.link_base_pure.replace(/screen\=/i,"screen=map");o;
- Public?
- Public
A very useful script for picking the coordinates off the map. This script is different to most as it picks all of the coordinates in the map and you can specify which ones you want (specific tribe village coordinates, specific player village coordinates or barbarian village coordinates). It has a variety of uses though I personally use it for faking a specific area. The only problem with this script is that it only picks the coordinates off your map, so the biggest range for them is 30x30.
[spoil]
[/spoil]
[spoil]
Code:
javascript: var author = "Stotty2009 but most of the code is from: dalesmckay@gmail.com"; var minVer = "7.2"; var win = (window.frames.length > 0) ? window.main : window; var ver = win.game_data.version.match(/[\d|\.]+/g); function getMode() { mode = prompt("b for barb villages, p for player villages, or t for tribe villages", "p"); mode = mode.toLowerCase(); checkMode() } function checkMode() { if (mode == 'p') { playername = prompt("which player pl0x?", "Stotty2009") + ' ' } else if (mode == 't') { tribename = prompt("which tribe pl0x?", "Crazy Muthas") } else if (mode == 'b') { } else { getMode() } } getMode(); function trim(str) { return str.replace(/^\s+|\s+$/g, "") } if (!ver || (parseFloat(ver[1]) < minVer)) { alert("This script requires v" + minVer + " or higher.\nYou are running: v" + ver[1]) } else { if (win.game_data.screen == "map") { var coords = []; var col, row, coord, village, player, points; for (row = 0; row < TWMap.size[1]; row++) { for (col = 0; col < TWMap.size[0]; col++) { coord = TWMap.map.coordByPixel(TWMap.map.pos[0] + (TWMap.tileSize[0] * col), TWMap.map.pos[1] + (TWMap.tileSize[1] * row)); if (coord) { village = TWMap.villages[coord.join("")]; if (village) { player = null; if (parseInt(village.owner || "0", 10)) { player = TWMap.players[village.owner]; var ally = TWMap.allies[player.ally] } if (player) { if (mode == "p") { if (trim(player.name) == trim(playername)) { coords.push(coord.join("|")) } } else if (mode == "t") { if (ally) { if (trim(ally.name) == trim(tribename)) { coords.push(coord.join("|")) } } } } else { if (mode == "b") { coords.push(coord.join("|")) } } } } } } alert(coords.join(" ")) } else { alert("Run this script from the Map.\nRedirecting now..."); self.location = win.game_data.link_base_pure.replace(/screen\=/i, "screen=map") } } void (o);
Upvote
0