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]
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);
[/spoil]
 
Upvote 0

DeletedUser105392

Guest
It doesn't do anything? I've tried on the map, other pages. I was awaiting the redirect, never occured. Running from quick bar, world 74.
 

DeletedUser80610

Guest
This seems like a very useful script. Thanks.


Only problem I found with it is that after it collects the coords, you can't simply copy & paste them into a script but need to manually type them in (unless this is just a Chrome issue).

Helpful, but not super helpful.

2/5
 
Last edited:

drawing dead

Guest
The problem is the output is an "alert" it needs to be "document.write" like below

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("|")) } } } } } } document.write(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);
 
Last edited:

Mastah

Well-Known Member
Reaction score
93
I'm getting "This script requires v7.2 or higher.
You are running v5"

It worked recently. Is there another approved cord grabber script someone has or possibly fix this one? (Or tell me if I've messed up somehow now when I try to use it)
 

The Quacks

Non-stop Poster
Reaction score
76
This script had a small bug that is now fixed, here is the working version:
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;

If any mod could edit the original post and add this in, it would be nice.
 

Twisted Legacy

Active Member
Reaction score
12
I'm getting "This script requires v7.2 or higher.
You are running v5"

It worked recently. Is there another approved cord grabber script someone has or possibly fix this one? (Or tell me if I've messed up somehow now when I try to use it)

JavaScript:
javascript: var author = "Stotty2009 but most of the code is from: dalesmckay@gmail.com"; var minVer = "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);
Simply changed the Var minVer from 7.2 to 2
(The above version posts to a little pop up message box)

JavaScript:
javascript:var mode, playername, tribename;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("Enter Players Name, Cap Sensitive", "Enter Player Name") + ' '} else if (mode == 't') {tribename = prompt("Enter Tribes Name, Cap Sensitive", "Enter Tribe Name")} else if (mode == 'b') {} else {getMode()}}function trim(str) {return str.replace(/^\s+|\s+$/g, "")}if(game_data.screen == "map") {getMode();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("|"))}}}}}}document.write(coords.join(" "))} else {alert("Run this script from the Map.\nRedirecting now...");location.href = game_data.link_base_pure.replace(/screen\=/i, "screen=map")}void(0)
(The above version posts to a white screen)
 

The Quacks

Non-stop Poster
Reaction score
76
JavaScript:
javascript: var author = "Stotty2009 but most of the code is from: dalesmckay@gmail.com"; var minVer = "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);
Simply changed the Var minVer from 7.2 to 2
(The above version posts to a little pop up message box)

JavaScript:
javascript:var mode, playername, tribename;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("Enter Players Name, Cap Sensitive", "Enter Player Name") + ' '} else if (mode == 't') {tribename = prompt("Enter Tribes Name, Cap Sensitive", "Enter Tribe Name")} else if (mode == 'b') {} else {getMode()}}function trim(str) {return str.replace(/^\s+|\s+$/g, "")}if(game_data.screen == "map") {getMode();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("|"))}}}}}}document.write(coords.join(" "))} else {alert("Run this script from the Map.\nRedirecting now...");location.href = game_data.link_base_pure.replace(/screen\=/i, "screen=map")}void(0)
(The above version posts to a white screen)

The regex to parse the current version was not working, it is corrected in my post
 

Twisted Legacy

Active Member
Reaction score
12
The regex to parse the current version was not working, it is corrected in my post


Both versions above are fully working.. By lowering the Ver needed it corrected the Regex error.. Now it works fully for all versions as its base minimal.

The second version avoids it completely
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
623
If possible, I would recommend to update the original thread with the latest and fully working script version.

It's getting hard to keep track which script version is the correct, confirmed, final working version here.
 

Johnny Tapia

Active Member
Reaction score
5
This script stopped working for me in the Brazilian world 120. Is there anything else that does the same function?

Screenshot_1.png
 

Bobah

Well-Known Member
Reaction score
17
Wait...my mistake, you dont need a script manager for quick bar scripts. sry^^
Just update/reinstall chrome, you can find a step-by-step guide on how to do this here. =)
 
Last edited:
Top