Post by xirinki on Jul 3, 2021 19:27:36 GMT
ResetVars()
mining = false
---equip whatever item you want
function Equip(item) -- stole this from utils.lua
FindItem (item)
if FINDITEM == nil then
print(item .. " not found!")
return
end
local tool_id = FINDITEM[1].ID
local cont_id = FINDITEM[1].CNTID
if cont_id == CHARID then
print(item .. " already equipped!")
return
end
print("Equipping " .. item)
ContextMenu(tool_id, "Equip")
end
--- moves char to a specific coordinate
function startMoving(x, y, z)
if(CHARPOSX == x) then
return true
end
FindMobile("Cavalito")
if FINDMOBILE then
ContextMenu(FINDMOBILE[1].ID, "Mount")
end
Move(x, y, z)
sleep(8000)
end
-----defined this as first coordinate to start the macro, usefull to use it.
function firstMove()
startMoving(111.744, 64.00842, 1977.526)
end
----- use this to target coordinates (may be used also in lumberjack)
function mining(x, y, z)
Equip("pickaxe")
sleep(100)
Macro(28) -- Q
WaitForTarget()
sleep(300)
TargetLoc(x, y, z)
start = TIME
repeat
ScanJournal(TIME)
until string.match(SCANJOURNALMESSAGE, "no metal here")
or TIME - start > 25
or (CHARWEIGHT > 200)
sleep(1000)
end
------verifies the weight (in my case i made this cuz my EASYLOU only gives the right weight if a drag and drop an item to the backpack.
function verifyWeight()
FindItem("Iron Ore", BACKPACKID)
if FINDITEM then
for item in FINDITEM do
Drag(item.ID)
sleep(2000)
Dropc(588134582)
sleep(2000)
Dropc(588134582)
sleep(2000)
FindMobile("Horselito")
if FINDMOBILE then
ContextMenu(FINDMOBILE[1].ID, "Mount")
end
sleep(200)
end
if(CHARWEIGHT <= 300) then return true end
firstMove()
startMoving(102.3928, 64.64116, 1956.556)
startMoving(79.60613, 63.94003, 1957.299)
startMoving(54.39137, 61.43869, 1930.178)
startMoving(59.40689, 61.43869, 1892.905)
dropBank()
startMoving(54.39137, 61.43869, 1930.178)
startMoving(77.34934, 61.44501, 1937.739)
firstMove()
end
end
----- function to get the ores/woods/whatever you want to drop in the bank.
function dropBank()
FindMobile("Thane The Banker")
if FINDMOBILE then
Move(FINDMOBILE[1].ID)
sleep(3000)
end
Say("bank guards")
sleep(3000)
FindItem("Ore", BACKPACKID)
if FINDITEM then
for item in FINDITEM do
Drag(item.ID)
sleep(1000)
Dropc(588273954)
end
end
end
------ from down here put any function from this scrip ***rememeber to leave firstMove() there so it can began from the spot.
while true do
-- Start at mining spot
firstMove()
mining(111.5002, 64.30157, 1981.213)
mining(114.0284, 65.03771, 1978.729)
mining(114.2617, 65.08466, 1974.951)
startMoving(111.6323, 64.00842, 1966.397)
mining(113.6894, 65.96996, 1966.782)
startMoving(112.5171, 63.97911, 1961.86)
mining(114.4771, 65.46259, 1962.733)
startMoving(119.3467, 63.97485, 1954.657)
mining(121.3519, 64.59703, 1957.379)
startMoving(128.3275, 64.00883, 1950.765)
mining(129.6151, 64.68377, 1952.699)
verifyWeight()
end
mining = false
---equip whatever item you want
function Equip(item) -- stole this from utils.lua
FindItem (item)
if FINDITEM == nil then
print(item .. " not found!")
return
end
local tool_id = FINDITEM[1].ID
local cont_id = FINDITEM[1].CNTID
if cont_id == CHARID then
print(item .. " already equipped!")
return
end
print("Equipping " .. item)
ContextMenu(tool_id, "Equip")
end
--- moves char to a specific coordinate
function startMoving(x, y, z)
if(CHARPOSX == x) then
return true
end
FindMobile("Cavalito")
if FINDMOBILE then
ContextMenu(FINDMOBILE[1].ID, "Mount")
end
Move(x, y, z)
sleep(8000)
end
-----defined this as first coordinate to start the macro, usefull to use it.
function firstMove()
startMoving(111.744, 64.00842, 1977.526)
end
----- use this to target coordinates (may be used also in lumberjack)
function mining(x, y, z)
Equip("pickaxe")
sleep(100)
Macro(28) -- Q
WaitForTarget()
sleep(300)
TargetLoc(x, y, z)
start = TIME
repeat
ScanJournal(TIME)
until string.match(SCANJOURNALMESSAGE, "no metal here")
or TIME - start > 25
or (CHARWEIGHT > 200)
sleep(1000)
end
------verifies the weight (in my case i made this cuz my EASYLOU only gives the right weight if a drag and drop an item to the backpack.
function verifyWeight()
FindItem("Iron Ore", BACKPACKID)
if FINDITEM then
for item in FINDITEM do
Drag(item.ID)
sleep(2000)
Dropc(588134582)
sleep(2000)
Dropc(588134582)
sleep(2000)
FindMobile("Horselito")
if FINDMOBILE then
ContextMenu(FINDMOBILE[1].ID, "Mount")
end
sleep(200)
end
if(CHARWEIGHT <= 300) then return true end
firstMove()
startMoving(102.3928, 64.64116, 1956.556)
startMoving(79.60613, 63.94003, 1957.299)
startMoving(54.39137, 61.43869, 1930.178)
startMoving(59.40689, 61.43869, 1892.905)
dropBank()
startMoving(54.39137, 61.43869, 1930.178)
startMoving(77.34934, 61.44501, 1937.739)
firstMove()
end
end
----- function to get the ores/woods/whatever you want to drop in the bank.
function dropBank()
FindMobile("Thane The Banker")
if FINDMOBILE then
Move(FINDMOBILE[1].ID)
sleep(3000)
end
Say("bank guards")
sleep(3000)
FindItem("Ore", BACKPACKID)
if FINDITEM then
for item in FINDITEM do
Drag(item.ID)
sleep(1000)
Dropc(588273954)
end
end
end
------ from down here put any function from this scrip ***rememeber to leave firstMove() there so it can began from the spot.
while true do
-- Start at mining spot
firstMove()
mining(111.5002, 64.30157, 1981.213)
mining(114.0284, 65.03771, 1978.729)
mining(114.2617, 65.08466, 1974.951)
startMoving(111.6323, 64.00842, 1966.397)
mining(113.6894, 65.96996, 1966.782)
startMoving(112.5171, 63.97911, 1961.86)
mining(114.4771, 65.46259, 1962.733)
startMoving(119.3467, 63.97485, 1954.657)
mining(121.3519, 64.59703, 1957.379)
startMoving(128.3275, 64.00883, 1950.765)
mining(129.6151, 64.68377, 1952.699)
verifyWeight()
end