Created: 13 days ago on 06/05/2025, 08:39:14 PMUpdated: 13 days ago on 06/05/2025, 08:50:30 PM
Description: Load up deciphering tools in your back and all your undecoded maps, click run. The script will decipher all maps in your backpack. Current issue with randomly stopping, need to fix that.
--======================================--
-- Automated Map Deciphering Script --
-- UO Sagas (Compatible Verified) --
-- Author: Khal Draco --
--======================================--
-- CONFIGURATION --
local TOOL_GRAPHIC = 0x0FBF -- Deciphering Tools
local MAP_GRAPHIC = 0x14EB -- Treasure Map (Generic graphic ID)
local PAUSE_BETWEEN = 1500 -- Time to wait between uses (ms)
local TOOL_NAME_MATCH = "deciphering tools" -- Lowercase match for naming fallback
local PLAYER_NAME = "[insert your character name here]" -- Name used to detect already-decoded maps
-- Track already-decoded maps
local seen = {}
-- UTILITY: Find tool in backpack --
local function FindTool()
local tools = Items.FindByFilter({
Graphic = TOOL_GRAPHIC,
RootContainer = Player.Backpack.RootContainer
})
for _, item in ipairs(tools) do
if string.lower(item.Name or "") == TOOL_NAME_MATCH then
return item
end
end
return tools[1] or nil
end
-- UTILITY: Find one undecoded map in backpack --
local function FindNextUndecodedMap()
local maps = Items.FindByFilter({
Graphic = MAP_GRAPHIC,
RootContainer = Player.Backpack.RootContainer
})
for _, map in ipairs(maps) do
if not seen[map.Serial] then
local name = map.Name or ""
if name:lower():find("map") and not name:lower():find("decoded by " .. PLAYER_NAME:lower()) then
return map
else
seen[map.Serial] = true -- skip it in future
end
end
end
return nil
end
-- MAIN LOOP --
Messages.Overhead("Starting auto-decipher...", 93, Player.Serial)
while true do
local tool = FindTool()
if not tool then
Messages.Overhead("No deciphering tools found!", 33, Player.Serial)
break
end
local map = FindNextUndecodedMap()
if not map then
Messages.Overhead("No undecoded maps found.", 53, Player.Serial)
break
end
-- Use tool and wait for valid targeting window
Player.UseObject(tool.Serial)
local targetingReady = false
for i = 1, 10 do
if Targeting.WaitForTarget(200) then
targetingReady = true
break
end
Pause(100)
end
if targetingReady then
Targeting.Target(map.Serial)
seen[map.Serial] = true
local label = map.Name or ""
label = label:gsub("[\n\r]", " ")
if label == "" or label == "Backpack" then
label = "Treasure Map [" .. tostring(map.Serial) .. "]"
end
Messages.Overhead("Deciphering: " .. label, 84, Player.Serial)
Pause(PAUSE_BETWEEN)
else
Messages.Overhead("Targeting did not activate — skipping.", 33, Player.Serial)
seen[map.Serial] = true
end
Pause(PAUSE_BETWEEN)
end
Messages.Overhead("Auto-deciphering complete!", 93, Player.Serial)