mrx
New Member
Posts: 9 Likes: 0
|
Post by mrx on Jun 13, 2022 20:24:11 GMT
function scanJournal(startT, endT, search) for i = startT, endT, .25 do ScanJournal(i) for j in search do if string.match(SCANJOURNALMESSAGE, j) then return true end end end return false end
function moveTo(X, Z) while not distanceTo(X, Z) do Move(X, CHARPOSY, Z) sleep(2000) end end
function distanceTo(X, Z) xmin, xmax = math.min(CHARPOSX, X), math.max(CHARPOSX, X) zmin, zmax = math.min(CHARPOSZ, Z), math.max(CHARPOSZ, Z) xtrue = xmax - xmin < 2 ztrue = zmax - zmin < 2
return xtrue and ztrue end
function Equip(item, containerId) FindItem(item, CHARID)
if FINDITEM then -- Already equiped return end
FindItem(item, containerId)
if FINDITEM then ContextMenu(FINDITEM[1].ID, "Equip") sleep(1000) end end
function hasPickaxe() FindItem("pickaxe")
if FINDITEM then return true end
return false end
function mine(clickX, clickY, clickZ) Equip("pickaxe", BACKPACKID) Macro(28) WaitForTarget() TargetLoc(clickX, clickY, clickZ)
local time = TIME while TIME < time + 50 do start = TIME if (scanJournal(start, TIME, {"no metal here"})) then print("No metal here | " .. "Spot time: " .. math.floor(TIME - time) .. " seconds") return end end
print("Timeout | Spot time: " .. math.floor(TIME - time) .. " seconds") end
function mountRide(rideId) if rideId then ContextMenu(rideId, "Mount") end end
--[[ ####################################################################################################### # # # You have to config your mining spots with their click coordinates in order for this script to work. # # You can add as many mining spots as you want, it will go mining through all of them. # # Set up your rideId if you want to use a ride while mining, otherwise leave it as it is. # # The script will stop if you are full weight, if you don't have anymore pickaxes or if you are dead. # # # ####################################################################################################### --]]
miningSpots = { { locationX = "xxxxx", locationZ = "xxxxx", clickX = "xxxxx", clickY = "xxxxx", clickZ = "xxxxx" }, { locationX = "xxxxx", locationZ = "xxxxx", clickX = "xxxxx", clickY = "xxxxx", clickZ = "xxxxx" } }
local initialTime = TIME local maxWeight = 300 local rideId
while CHARGHOST == false do for miningSpot in miningSpots do mountRide(rideId) moveTo(miningSpot.locationX, miningSpot.locationZ) mine(miningSpot.clickX, miningSpot.clickY, miningSpot.clickZ) if CHARWEIGHT > maxWeight or hasPickaxe() == false or CHARGHOST then StopAllScripts() end end end
|
|