Skip to content

Commit

Permalink
Lots of changes to both lua and macro.
Browse files Browse the repository at this point in the history
Accounting for zoning, group checks etc.
  • Loading branch information
fol-debug committed Dec 18, 2023
1 parent 79b023b commit 82c8907
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 29 deletions.
30 changes: 15 additions & 15 deletions boomerang.mac
Expand Up @@ -21,21 +21,21 @@ Sub Event_Ended(Line,RewardAmount,RewardType)
/delay 5s
/endmac

:ZoneLoop
/squelch /moveto loc -301.11 5.16
/delay 5s
/keypress use
/delay 3s
/keypress u
/delay 30s
/if (${Zone.Name.Equal[Brell's Arena]}) {
/goto :ZoneLoop
}
/if (${Zone.Name.Equal[Brell's Rest]}) {

/end
}
/return
|-:ZoneLoop
|- /squelch /moveto loc -301.11 5.16
|- /delay 5s
|- /keypress use
|- /delay 3s
|- /keypress u
|- /delay 30s
|- /if (${Zone.Name.Equal[Brell's Arena]}) {
|- /goto :ZoneLoop
|- }
|- /if (${Zone.Name.Equal[Brell's Rest]}) {
|- /endmac
|- /end
|- }
|-/return



Expand Down
69 changes: 55 additions & 14 deletions brellsboomerang/init.lua
Expand Up @@ -14,6 +14,7 @@ Write.prefix = 'brellsboomerang'
Write.loglevel = 'info'

local DoLoop = true
local DoLoopZonedOut = true
local luaName = 'brellsboomerang'
local teamSelected = ''
local loopState = {
Expand All @@ -22,7 +23,8 @@ local loopState = {
[2] = "travelMission",
[3] = "startEvent",
[4] = "doEvent",
[5] = "waitingForRepop"
[5] = "zonedOut",
[6] = "waitingForRepop"
}

local currentState = 0
Expand All @@ -48,15 +50,15 @@ local function campFire()

-- Click destroy campsite.
mq.TLO.Window('FellowshipWnd/FP_Subwindows/FP_DestroyCampsite').LeftMouseUp()
mq.delay(5000, function ()
mq.delay(3000, function ()
return mq.TLO.Window('ConfirmationDialogBox').Open()
end)
if (mq.TLO.Window('ConfirmationDialogBox').Open()) then
mq.TLO.Window('ConfirmationDialogBox/Yes_Button').LeftMouseUp()
end

-- Wait a bit to make sure campfire gone
mq.delay(5000, function ()
mq.delay(3000, function ()
return not mq.TLO.Me.Fellowship.Campfire()
end)
end
Expand All @@ -82,7 +84,7 @@ local function campFire()

-- Click create camp
mq.TLO.Window('FellowshipWnd/FP_Subwindows/FP_CreateCampsite').LeftMouseUp()
mq.delay(5000, function ()
mq.delay(3000, function ()
return mq.TLO.Me.Fellowship.Campfire()
end)
mq.delay(1000)
Expand All @@ -94,7 +96,7 @@ local function campFire()
Write.Warn('\a-gEnd of campfire function but no campfire. Continuing but you\'ll have to wait to get kicked.')
end

mq.delay(1000)
mq.delay(500)
end
end

Expand All @@ -112,7 +114,7 @@ local function checkGroup()
if mq.TLO.SpawnCount('group radius 100')() < groupSize then
Write.Info('\a-gAll members of group are not present. Lets get them here.')
if myID == groupLeaderID then
mq.cmdf('/squelch /dge /nav spawn id %s', groupLeaderID)
mq.cmdf('/squelch /dgga /nav spawn id %s', groupLeaderID)
mq.delay(10000)
end
else
Expand All @@ -121,6 +123,22 @@ local function checkGroup()
end
end

local function checkGroupStatus()
--
local myID = mq.TLO.Me.ID
local groupLeaderID = mq.TLO.Group.Leader.ID
groupSize = mq.TLO.Group()+1
if mq.TLO.SpawnCount('group radius 100')() < groupSize then
Write.Info('\a-gAll members of group are not present. Lets get them here.')
if myID == groupLeaderID then
mq.cmdf('/squelch /dgga /nav spawn id %s', groupLeaderID)
mq.delay(10000)
end
else
Write.Info('\a-gEveryone is present. Lets head back to Campfire.')
end
end

-- Thanks Sic!
local function checkInvis()
--
Expand Down Expand Up @@ -282,22 +300,45 @@ local function DoBoomerang()
if loopState[currentState] == "doEvent" then
Write.Info('\a-gRunning brellsboomerang.mac -- do not interfere. Will campfire once done and restart within 40 minutes.')
mq.cmdf('/squelch /mac boomerang')
mq.delay(900000)
mq.cmdf('/squelch /endmac')
mq.delay(1000)
mq.cmdf('/squelch /makemevisible')
mq.cmdf('/lua stop brellsboomerang')
mq.delay(1000)
mq.cmdf('/squelch /casting "Fellowship Registration Insignia"')
Write.Info('\a-gInstance ending. Waiting for port out.')
mq.delay(1080000)
-- Updating state
Write.Info('\a-gNext up: %s=>%s', loopState[currentState], loopState[currentState+1])
currentState = currentState + 1
mq.delay(1000)
end

if loopState[currentState] == "zonedOut" then
-- Check to see if we have zoned out.
while DoLoopZonedOut do
if mq.TLO.Zone.ID() == 480 then
DoLoopZonedOut = false
end
end
if mq.TLO.Zone.ID() == 480 then
local correctZone = true
Write.Info('\a-gCorrect zone. Next step; make sure we end macro, remove invis, and cast Insignia.')
checkGroupStatus()
mq.delay(5000)
mq.cmdf('/squelch /endmac')
mq.delay(1000)
mq.cmdf('/squelch /makemevisible')
mq.delay(1000)
mq.cmdf('/squelch /casting "Fellowship Registration Insignia"')
else
Write.Info('\a-gSomething has gone wrong. Either dead/LD or plain missing. Ending LUA.')
mq.delay(5000)
mq.cmdf('/squelch /dgga /lua stop %s', luaName)
end
-- Updating state
Write.Info('\a-gNext up: %s=>%s', loopState[currentState], loopState[currentState+1])
currentState = currentState + 1
mq.delay(1000)
end

if loopState[currentState] == "waitingForRepop" then
Write.Info('\a-gWe are currently idling. Repop in about 25 minutes. Will run in 30 mins.')
mq.delay(2000000)
mq.delay(2700000)
-- Updating state
Write.Info('\a-gNext up: %s=>%s', loopState[currentState], loopState[currentState-5])
currentState = currentState - 5
Expand Down

0 comments on commit 82c8907

Please sign in to comment.