The Wiki for Tale 6 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.

If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.

User:Obol/VTMacros

From ATITD6
Jump to navigationJump to search

I had to make a few tweaks to some of the VT scripts.

Flax Stable

In the luaScripts folder edit the common_gps.inc file, replace the findCoords function with the following. It as looking for year 1 and 2 on the clockloc window, so I added years 3 and 4, it we get to year 5 you will need to add another if statement.
Example:
 if(not anchor) then
  anchor = findText("4, ");
 end

function findCoords()
  lsPrintln("findCoords");
  local result = nil;
  local anchor = findText("1,");
  if(not anchor) then
    anchor = findText("2, ");
  end
  if(not anchor) then
    anchor = findText("3, ");
  end
  if(not anchor) then
    anchor = findText("4, ");
  end
  if(not anchor) then
    anchor = findText("Year");
  end
  if anchor then
    lsPrintln("anchor");
    local window = getWindowBorders(anchor[0], anchor[1]);
    local lines = findAllText(nil, window, NOPIN);
    for i=1,#lines do
      lsPrintln("LINE " .. i .. " : " .. table.concat(lines[i], ","));
    end
    local str = lines[#lines][2];
    lsPrintln("lines: " .. str);
    local a, b, x, y = string.find(str, ": ([0-9-]+)\, ([0-9-]+)");
    result = makePoint(tonumber(x), tonumber(y));
    if not result[0] or not result[1] then
      result = nil;
      lsPrintln("Failed to find coords");
    end
  end
  return result;
end