Code:
FrameworkTools = {};
FrameworkTools.TeleportKeyPressed = false;
function FrameworkTools:InitGUI()
-- Create the main window
self.GUI_MainWindow = Window();
self.GUI_HerbSpecificsWindow = Window();
-- Set size
self.GUI_MainWindow.width = 250;
self.GUI_MainWindow.height = 300;
self.GUI_HerbSpecificsWindow.width = 250;
self.GUI_HerbSpecificsWindow.height = 250;
-- Main window, so we don't want to make it closable
self.GUI_MainWindow:SetClosable(false);
self.GUI_HerbSpecificsWindow:SetClosable(false);
-- Don't want to mess with anchor, disable resizing
self.GUI_MainWindow:SetResizable(false);
self.GUI_HerbSpecificsWindow:SetClosable(false);
-- Create a checkboxs
self.GUI_CheckboxTrackPickable = Checkbox(self.GUI_MainWindow);
self.GUI_CheckboxTrackRunes = Checkbox(self.GUI_MainWindow);
self.GUI_CheckboxTrackCloth = Checkbox(self.GUI_MainWindow);
self.GUI_CheckboxTrackOre = Checkbox(self.GUI_MainWindow);
self.GUI_CheckboxTrackHerbs = Checkbox(self.GUI_MainWindow);
self.GUI_CheckboxTrackEntoloma = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackThistle = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackBugloss = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackColumbine = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackCornFlower = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackDragonthorn = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackEmetic = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackImp = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackLadys = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackLuminous = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackMountain = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackNamiras = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackNirnroot = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackStinkhorn = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackViolet = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackWaterHyacinth = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackWhiteCap = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackWormwood = Checkbox(self.GUI_HerbSpecificsWindow);
self.GUI_CheckboxTrackWood = Checkbox(self.GUI_MainWindow);
self.GUI_CheckboxTrackWater = Checkbox(self.GUI_MainWindow);
self.GUI_CheckboxTrackChests = Checkbox(self.GUI_MainWindow);
self.GUI_CheckboxTrackSkyshards = Checkbox(self.GUI_MainWindow);
self.GUI_CheckboxTrackPickableDrawLine = Checkbox(self.GUI_MainWindow);
self.GUI_CheckboxTeleport = Checkbox(self.GUI_MainWindow);
-- Set start positions
self.GUI_MainWindow.x = 100;
self.GUI_MainWindow.y = 250;
self.GUI_HerbSpecificsWindow.x = 400;
self.GUI_HerbSpecificsWindow.y = 250;
self.GUI_CheckboxTrackPickable.x = 5;
self.GUI_CheckboxTrackPickable.y = 10;
self.GUI_CheckboxTrackRunes.x = 15;
self.GUI_CheckboxTrackRunes.y = 30;
self.GUI_CheckboxTrackCloth.x = 15;
self.GUI_CheckboxTrackCloth.y = 50;
self.GUI_CheckboxTrackOre.x = 15;
self.GUI_CheckboxTrackOre.y = 70;
self.GUI_CheckboxTrackHerbs.x = 15;
self.GUI_CheckboxTrackHerbs.y = 90;
self.GUI_CheckboxTrackWood.x = 15;
self.GUI_CheckboxTrackWood.y = 110;
self.GUI_CheckboxTrackWater.x = 15;
self.GUI_CheckboxTrackWater.y = 130;
self.GUI_CheckboxTrackChests.x = 15;
self.GUI_CheckboxTrackChests.y = 150;
self.GUI_CheckboxTrackSkyshards.x = 15;
self.GUI_CheckboxTrackSkyshards.y = 170;
self.GUI_CheckboxTrackPickableDrawLine.x = 25;
self.GUI_CheckboxTrackPickableDrawLine.y = 190;
self.GUI_CheckboxTeleport.x = 5;
self.GUI_CheckboxTeleport.y = 240;
self.GUI_CheckboxTrackEntoloma.x = 5;
self.GUI_CheckboxTrackEntoloma.y = 10;
self.GUI_CheckboxTrackThistle.x = 5;
self.GUI_CheckboxTrackThistle.y = 30;
self.GUI_CheckboxTrackBugloss.x = 5;
self.GUI_CheckboxTrackBugloss.y = 50;
self.GUI_CheckboxTrackColumbine.x = 5;
self.GUI_CheckboxTrackColumbine.y = 70;
self.GUI_CheckboxTrackCornFlower.x = 5;
self.GUI_CheckboxTrackCornFlower.y = 90;
self.GUI_CheckboxTrackDragonthorn.x = 5;
self.GUI_CheckboxTrackDragonthorn.y = 110;
self.GUI_CheckboxTrackEmetic.x = 5;
self.GUI_CheckboxTrackEmetic.y = 130;
self.GUI_CheckboxTrackImp.x = 5;
self.GUI_CheckboxTrackImp.y = 150;
self.GUI_CheckboxTrackLadys.x = 5;
self.GUI_CheckboxTrackLadys.y = 170;
self.GUI_CheckboxTrackLuminous.x = 5;
self.GUI_CheckboxTrackLuminous.y = 190;
self.GUI_CheckboxTrackMountain.x = 100;
self.GUI_CheckboxTrackMountain.y = 10;
self.GUI_CheckboxTrackNamiras.x = 100;
self.GUI_CheckboxTrackNamiras.y = 30;
self.GUI_CheckboxTrackNirnroot.x = 100;
self.GUI_CheckboxTrackNirnroot.y = 50;
self.GUI_CheckboxTrackStinkhorn.x = 100;
self.GUI_CheckboxTrackStinkhorn.y = 70;
self.GUI_CheckboxTrackViolet.x = 100;
self.GUI_CheckboxTrackViolet.y = 90;
self.GUI_CheckboxTrackWaterHyacinth.x = 100;
self.GUI_CheckboxTrackWaterHyacinth.y = 110;
self.GUI_CheckboxTrackWhiteCap.x = 100;
self.GUI_CheckboxTrackWhiteCap.y = 130;
self.GUI_CheckboxTrackWormwood.x = 100;
self.GUI_CheckboxTrackWormwood.y = 150;
-- Set controls text
self.GUI_MainWindow:SetTitle("Tools");
self.GUI_HerbSpecificsWindow:SetTitle("Specific Herbs");
self.GUI_CheckboxTrackPickable:SetText("Track pickable objects");
self.GUI_CheckboxTrackRunes:SetText("Runes (Yellow)");
self.GUI_CheckboxTrackCloth:SetText("Cloth (White)");
self.GUI_CheckboxTrackOre:SetText("Ore (Red)");
self.GUI_CheckboxTrackHerbs:SetText("Herbs (Green)");
self.GUI_CheckboxTrackWood:SetText("Wood (Brown)");
self.GUI_CheckboxTrackWater:SetText("Water (Pink)");
self.GUI_CheckboxTrackChests:SetText("Chests (Blue)");
self.GUI_CheckboxTrackSkyshards:SetText("Skyshards (Orange)");
self.GUI_CheckboxTrackPickableDrawLine:SetText("Draw line");
self.GUI_CheckboxTeleport:SetText("Teleport (Press F)");
self.GUI_CheckboxTrackEntoloma:SetText("Entoloma");
self.GUI_CheckboxTrackThistle:SetText("Blessed Thistle");
self.GUI_CheckboxTrackBugloss:SetText("Bugloss");
self.GUI_CheckboxTrackColumbine:SetText("Columbine");
self.GUI_CheckboxTrackCornFlower:SetText("Corn Flower");
self.GUI_CheckboxTrackDragonthorn:SetText("Dragonthorn");
self.GUI_CheckboxTrackEmetic:SetText("Emetic Russla");
self.GUI_CheckboxTrackImp:SetText("Imp Stool");
self.GUI_CheckboxTrackLadys:SetText("Lady's Smock");
self.GUI_CheckboxTrackLuminous:SetText("Luminous Russla");
self.GUI_CheckboxTrackMountain:SetText("Mountain Flower");
self.GUI_CheckboxTrackNamiras:SetText("Namira's Rot");
self.GUI_CheckboxTrackNirnroot:SetText("Nirnroot");
self.GUI_CheckboxTrackStinkhorn:SetText("Stinkhorn");
self.GUI_CheckboxTrackViolet:SetText("Violet Coprinus");
self.GUI_CheckboxTrackWaterHyacinth:SetText("Water Hyacinth");
self.GUI_CheckboxTrackWhiteCap:SetText("White Cap");
self.GUI_CheckboxTrackWormwood:SetText("Wormwood");
-- Show the main window
self.GUI_MainWindow:Show();
self.GUI_HerbSpecificsWindow:Show();
-- Set Herb checkboxes to checked
self.GUI_CheckboxTrackEntoloma.checked = true;
self.GUI_CheckboxTrackThistle.checked = true;
self.GUI_CheckboxTrackBugloss.checked = true;
self.GUI_CheckboxTrackColumbine.checked = true;
self.GUI_CheckboxTrackCornFlower.checked = true;
self.GUI_CheckboxTrackDragonthorn.checked = true;
self.GUI_CheckboxTrackEmetic.checked = true;
self.GUI_CheckboxTrackImp.checked = true;
self.GUI_CheckboxTrackLadys.checked = true;
self.GUI_CheckboxTrackLuminous.checked = true;
self.GUI_CheckboxTrackMountain.checked = true;
self.GUI_CheckboxTrackNamiras.checked = true;
self.GUI_CheckboxTrackNirnroot.checked = true;
self.GUI_CheckboxTrackStinkhorn.checked = true;
self.GUI_CheckboxTrackViolet.checked = true;
self.GUI_CheckboxTrackWaterHyacinth.checked = true;
self.GUI_CheckboxTrackWhiteCap.checked = true;
self.GUI_CheckboxTrackWormwood.checked = true;
-- Register a callback for OnFrame event
Utils.RegisterGlobalEvent("OnFrame", self.Callback_OnFrame);
end
function FrameworkTools:Callback_OnFrame()
-- Check if we are in game
if Game.IsInGame() then
-- Store local player unit
local localPlayer = Game.GetPlayerUnit();
-- Loop through all units
for unit in Game.GetUnits() do
if unit.unitType == UNIT_TYPE_INTERACTABLE_OBJECT and FrameworkTools.GUI_CheckboxTrackPickable.checked then
if FrameworkTools.GUI_CheckboxTrackChests.checked and unit.name == "Chest" then -- 10079, 13077
WorldRendering.DrawBox(unit.position, unit.heading, 1, 4, 0xAA0004FF)--Blue
if FrameworkTools.GUI_CheckboxTrackPickableDrawLine.checked then
WorldRendering.DrawLine(localPlayer.position, unit.position, 0xAA0004FF);
end
elseif FrameworkTools.GUI_CheckboxTrackSkyshards.checked and unit.defId == 13047 then
WorldRendering.DrawBox(unit.position, unit.heading, 1, 4, 0xAAFF8400)--Orange
if FrameworkTools.GUI_CheckboxTrackPickableDrawLine.checked then
WorldRendering.DrawLine(localPlayer.position, unit.position, 0xAAFF8400);
end
end
end
-- Check if it's pickable and if option is enabled
if unit.unitType == UNIT_TYPE_SIMPLE_INTERACTABLE_OBJECT and FrameworkTools.GUI_CheckboxTrackPickable.checked then
--Track individual object types.
if FrameworkTools.GUI_CheckboxTrackOre.checked and isOre(unit.defId) then
WorldRendering.DrawBox(unit.position, unit.heading, 1, 4, 0xAAFF0000)--Red
if FrameworkTools.GUI_CheckboxTrackPickableDrawLine.checked then
WorldRendering.DrawLine(localPlayer.position, unit.position, 0xAAFF0000);
end
elseif FrameworkTools.GUI_CheckboxTrackRunes.checked and isRune(unit.defId) then
WorldRendering.DrawBox(unit.position, unit.heading, 1, 4, 0xAAFFFF00)--Yellow
if FrameworkTools.GUI_CheckboxTrackPickableDrawLine.checked then
WorldRendering.DrawLine(localPlayer.position, unit.position, 0xAAFFFF00);
end
elseif FrameworkTools.GUI_CheckboxTrackWood.checked and isWood(unit.defId) then
WorldRendering.DrawBox(unit.position, unit.heading, 1, 4, 0xAAAD6B00)--Brown
if FrameworkTools.GUI_CheckboxTrackPickableDrawLine.checked then
WorldRendering.DrawLine(localPlayer.position, unit.position, 0xAAAD6B00);
end
elseif FrameworkTools.GUI_CheckboxTrackHerbs.checked and isHerb(unit.defId) and isSpecifiedHerb(unit.defId) then
WorldRendering.DrawBox(unit.position, unit.heading, 1, 4, 0xAA00AD06)--Green
if FrameworkTools.GUI_CheckboxTrackPickableDrawLine.checked then
WorldRendering.DrawLine(localPlayer.position, unit.position, 0xAA00AD06);
end
elseif FrameworkTools.GUI_CheckboxTrackCloth.checked and isCloth(unit.defId) then
WorldRendering.DrawBox(unit.position, unit.heading, 1, 4, 0xAAFFFFFF)--White
if FrameworkTools.GUI_CheckboxTrackPickableDrawLine.checked then
WorldRendering.DrawLine(localPlayer.position, unit.position, 0xAAFFFFFF);
end
elseif FrameworkTools.GUI_CheckboxTrackWater.checked and isWater(unit.defId) then
WorldRendering.DrawBox(unit.position, unit.heading, 1, 4, 0xAAFF21F8)--Pink
if FrameworkTools.GUI_CheckboxTrackPickableDrawLine.checked then
WorldRendering.DrawLine(localPlayer.position, unit.position, 0xAAFF21F8);
end
end
end
end
-- Check if teleport hack is enabled
if FrameworkTools.GUI_CheckboxTeleport.checked then
-- Check if key F is down
if Keyboard.IsKeyDown(0x46) then
-- Set the key as pressed
FrameworkTools.TeleportKeyPressed = true;
-- Get the ground position
local groundPosition = Game.GetGroundTargetLocation();
if groundPosition then
-- Draw an ellipse + line at the ground position
WorldRendering.DrawEllipse(groundPosition, 0.6, 0x77FF00FF);
WorldRendering.DrawLine(localPlayer.position, groundPosition, 0x77FF00FF);
end
-- Check if it's up, and was pressed before (ie: released)
elseif FrameworkTools.TeleportKeyPressed then
local groundPosition = Game.GetGroundTargetLocation();
if groundPosition then
local GamePlayer = Game.GetPlayerUnit();
local playerPosition = GamePlayer.position;
Hacks.Teleport(groundPosition);
local dist = distance(playerPosition, groundPosition);
print("Distance teleported: " .. dist .. " Closest Player Distance: " .. ClosestPlayerDistance(groundPosition));
end
FrameworkTools.TeleportKeyPressed = false;
end
end
end
end
--Creates a set
function Set (list)
local set = {}
for _, l in ipairs(list) do set[l] = true end
return set
end
--Checks if an item's name is an Ore
tools_setOfOre = Set {101, -- Iron Ore
104,-- High Iron Ore
107,-- Orichalcum Ore
110,--Dwarven Ore
67,--Ebony Ore
1401,--calcinium Ore
1402,--Galatite Ore
1403,--Quicksilver Ore
1404}--voidstone ore
tools_setOfRunes = Set {1337,
1338,
1339,
1340,
1341,
1342,
1373,
1374,
1375,
1376,
1377,
1378,
1379,
1380,
1381,
1382,
1417}
tools_setOfCloth = Set {115,--jute
116,--flax
122,--cotton
119,--spidersilk
64,--ebonthread
1398,--kreshweed
1400,--ironweed
1399,--silverwiid
1397}--void bloom
tools_setOfHerbs = Set {514,--entoloma
521,--blessed thistle
97,--bugloss
62,--columbine
524,--corn flower
525,--dragonthorn
515,-- emetic russla
520,--imp stool
522,--lady's smock
519,--luminous russla
526,--mountain flower
517,--namira's rot
478,--nirnroot
95,--stinkhorn
516,--violet coprinus
527,--water hyacinth
518,--white cap
523}--wormwood
tools_setOfWood = Set {94,--maple
96,--oak
98,--beech
99,--hickory
63,--yew
1407,--birch
1406,--ash
1408,--mahogany
1405}--nightwood
tools_setOfWater = Set {213,
695,
780,
785,
918,
1246,
899,
961,
962,
963,
964,
1253}
function isWater(unitId)
if tools_setOfWater[unitId] then
return true
else
return false
end
end
function isOre(unitName)
if tools_setOfOre[unitName] then
return true
else
return false
end
end
function isRune(unitName)
if tools_setOfRunes[unitName] then
return true
else
return false
end
end
function isCloth(unitName)
if tools_setOfCloth[unitName] then
return true
else
return false
end
end
function isHerb(unitName)
if tools_setOfHerbs[unitName] then
return true
else
return false
end
end
function isSpecifiedHerb(unitId)
if unitId == 514 and FrameworkTools.GUI_CheckboxTrackEntoloma.checked then
return true
elseif unitId == 521 and FrameworkTools.GUI_CheckboxTrackThistle.checked then
return true
elseif unitId == 97 and FrameworkTools.GUI_CheckboxTrackBugloss.checked then
return true
elseif unitId == 62 and FrameworkTools.GUI_CheckboxTrackColumbine.checked then
return true
elseif unitId == 524 and FrameworkTools.GUI_CheckboxTrackCornFlower.checked then
return true
elseif unitId == 525 and FrameworkTools.GUI_CheckboxTrackDragonthorn.checked then
return true
elseif unitId == 515 and FrameworkTools.GUI_CheckboxTrackEmetic.checked then
return true
elseif unitId == 520 and FrameworkTools.GUI_CheckboxTrackImp.checked then
return true
elseif unitId == 522 and FrameworkTools.GUI_CheckboxTrackLadys.checked then
return true
elseif unitId == 519 and FrameworkTools.GUI_CheckboxTrackLuminous.checked then
return true
elseif unitId == 526 and FrameworkTools.GUI_CheckboxTrackMountain.checked then
return true
elseif unitId == 517 and FrameworkTools.GUI_CheckboxTrackNamiras.checked then
return true
elseif unitId == 478 and FrameworkTools.GUI_CheckboxTrackNirnroot.checked then
return true
elseif unitId == 95 and FrameworkTools.GUI_CheckboxTrackStinkhorn.checked then
return true
elseif unitId == 516 and FrameworkTools.GUI_CheckboxTrackViolet.checked then
return true
elseif unitId == 527 and FrameworkTools.GUI_CheckboxTrackWaterHyacinth.checked then
return true
elseif unitId == 518 and FrameworkTools.GUI_CheckboxTrackWhiteCap.checked then
return true
elseif unitId == 523 and FrameworkTools.GUI_CheckboxTrackWormwood.checked then
return true
else
return false
end
end
function isWood(unitName)
if tools_setOfWood[unitName] then
return true
else
return false
end
end
function FrameworkTools:main()
-- Initialize the GUI
self:InitGUI();
end
-- Call the main function
FrameworkTools:main();
1.) Throw this into a blank lua script.