Compare commits

...

2 Commits
main ... main

Author SHA1 Message Date
skippylol e833b072a6 updated readme 1 month ago
skippylol 1473e88627 Draws lines to nearest nodes. 1 month ago
  1. 58
      Radar.lua
  2. 6
      readme.md

@ -7,6 +7,12 @@ local Builder = Tinkr.Util.GUIBuilder:New {
} }
local nodes = { local nodes = {
-- Fishing nods
[451678] = {name = "Blood in the Water", type = "fishing" },
[451669] = {name = "Glimmerpool", type = "fishing" },
[451670] = {name = "Calm Surfacing Ripple", type = "fishing" },
[451680] = {name = "Royal Ripple", type = "fishing" },
-- Mining nodes -- Mining nodes
[413047] = {name = "Aqirite", type = "mining"}, [413047] = {name = "Aqirite", type = "mining"},
[434556] = {name = "Aqirite Chunk", type = "mining"}, [434556] = {name = "Aqirite Chunk", type = "mining"},
@ -240,6 +246,9 @@ local function DrawNode(draw, nodeInfo, nx, ny, nz, objectId)
elseif nodeType == "herb" and Builder:GetConfig("show_herbs") == "yes" and Builder:GetConfig("show_herb_" .. objectId) == "yes" then elseif nodeType == "herb" and Builder:GetConfig("show_herbs") == "yes" and Builder:GetConfig("show_herb_" .. objectId) == "yes" then
color = {0, 255, 0} color = {0, 255, 0}
shouldDraw = true shouldDraw = true
elseif nodeType == "fishing" and Builder:GetConfig("show_fish") == "yes" and Builder:GetConfig("show_fish_" .. objectId) == "yes" then
color = {255, 0, 0}
shouldDraw = true
end end
if shouldDraw then if shouldDraw then
@ -257,19 +266,35 @@ local function DrawNode(draw, nodeInfo, nx, ny, nz, objectId)
end end
Draw:Sync(function(draw) Draw:Sync(function(draw)
local px, py, pz = ObjectPosition('player')
local nearestNode = nil
local nearestDist = 100000 -- Start with a very large distance
for _, object in ipairs(Objects()) do for _, object in ipairs(Objects()) do
if ObjectType(object) == 8 then if ObjectType(object) == 8 then
local objectId = ObjectId(object) local objectId = ObjectId(object)
local nodeInfo = GetNodeInfo(objectId) local nodeInfo = GetNodeInfo(objectId)
if nodeInfo and ObjectLootable(object) then if nodeInfo then
local nx, ny, nz = ObjectRawPosition(object) local nx, ny, nz = ObjectPosition(object)
DrawNode(draw, nodeInfo, nx, ny, nz, objectId) local dist = ObjectDistance('player',object)
-- Check if this node is the nearest so far
if dist and dist < nearestDist then
nearestNode = { nodeInfo = nodeInfo, nx = nx, ny = ny, nz = nz, objectId = objectId }
nearestDist = dist
end
end end
end end
end end
-- Draw the nearest node if one was found
if nearestNode then
DrawNode(draw, nearestNode.nodeInfo, nearestNode.nx, nearestNode.ny, nearestNode.nz, nearestNode.objectId)
end
end) end)
-- Modify the SavePreferences function -- Modify the SavePreferences function
local function SavePreferences() local function SavePreferences()
for id, node in pairs(nodes) do for id, node in pairs(nodes) do
@ -295,6 +320,11 @@ local MainSettingsTab = Builder:Tab {
-- description = "Toggle visibility of herb nodes.", -- description = "Toggle visibility of herb nodes.",
default = "yes" default = "yes"
}, },
Builder:Checkbox {
key = "show_fish",
label = "Show School of Fish",
default = "yes"
},
Builder:Checkbox { Builder:Checkbox {
key = "draw_lines", key = "draw_lines",
label = "Draw Lines to Nodes", label = "Draw Lines to Nodes",
@ -343,6 +373,24 @@ local DetailedFilterTab = Builder:Tab {
return elements return elements
end)() end)()
}, },
Builder:Group {
key = "fish_nodes_group",
title = "School of Fish",
content = (function()
local elements = {}
for id, node in pairs(nodes) do
if node.type == "fishing" then
table.insert(elements, Builder:Checkbox {
key = "show_fish_" .. id,
label = node.name,
-- description = "Toggle visibility of " .. node.name,
default = "yes"
})
end
end
return elements
end)()
},
Builder:Button { Builder:Button {
key = "save_preferences_button", key = "save_preferences_button",
text = "Save Preferences", text = "Save Preferences",

@ -1,18 +1,18 @@
# Mining and Herb Radar # Mining and Herb Radar
This Lua script creates a radar-like visualization for mining and herb nodes in World of Warcraft. It's designed to work with the Tinkr framework. This Lua script creates a radar-like visualization for fishing pools, mining and herb nodes in World of Warcraft. It's designed to work with the Tinkr framework.
## Support the Developer ## Support the Developer
If you find this script helpful, please consider supporting the developer: If you find this script helpful, please consider supporting the developer:
🎁 **[Tip the Developer](https://coindrop.to/okrotations)** 🎁 🎁 **[Tip the Developer](https://coindrop.to/skippylol)** 🎁
Your support helps maintain and improve this project. Thank you! Your support helps maintain and improve this project. Thank you!
## Features ## Features
- Displays mining and herb nodes as 3D crystal-like structures in the game world - Displays fishing pools, mining, and herb nodes as 3D crystal-like structures in the game world
- Customizable node visibility through an in-game settings window - Customizable node visibility through an in-game settings window
- Option to draw lines from the player to visible nodes - Option to draw lines from the player to visible nodes
- Distance indicators for each node - Distance indicators for each node

Loading…
Cancel
Save