-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathextra_ipcs.lua
More file actions
63 lines (54 loc) · 2.01 KB
/
extra_ipcs.lua
File metadata and controls
63 lines (54 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
require 'utils'
require 'hard_ipc'
import "System"
local GBR = 'GatherBuddyReborn'
local GBR_ENABLED = GBR .. '.IsAutoGatherEnabled'
local GBR_WAITING = GBR .. '.IsAutoGatherWaiting'
local GBR_SET_AUTO_GATHER = GBR .. '.SetAutoGatherEnabled'
function gbr_gather(max_time)
require_ipc(GBR_SET_AUTO_GATHER, nil, { 'System.Boolean' })
invoke_ipc(GBR_SET_AUTO_GATHER, true)
wait_gbr_idle(max_time)
invoke_ipc(GBR_SET_AUTO_GATHER, false)
end
function wait_gbr_idle(max_wait)
require_ipc(GBR_WAITING, 'System.Boolean', {})
require_ipc(GBR_ENABLED, 'System.Boolean', {})
local ti = nil
if max_wait ~= nil then
ti = ResetTimeout()
end
repeat
if ti ~= nil then
CheckTimeout(max_wait, ti, CallerName(), "wait_gbr_idle timed out")
end
wait(1)
local waiting = invoke_ipc(GBR_WAITING)
local enabled = invoke_ipc(GBR_ENABLED)
until not enabled or waiting
end
local STYLIST = 'Stylist'
local STYLIST_IS_BUSY = STYLIST .. '.IsBusy'
local STYLIST_UPDATE_CURRENT_GEARSET = STYLIST .. '.UpdateCurrentGearset'
function stylist_update_current_gearset()
Player.Gearset:Update()
require_ipc(STYLIST_IS_BUSY, 'System.Boolean', {})
require_ipc(STYLIST_UPDATE_CURRENT_GEARSET, nil, { 'System.Boolean' })
local ti = ResetTimeout()
invoke_ipc(STYLIST_UPDATE_CURRENT_GEARSET, true)
repeat
CheckTimeout(30, ti, CallerName(), "Stylist is busy")
wait(0.5)
until not invoke_ipc(STYLIST_IS_BUSY)
end
function stylist_is_busy()
require_ipc(STYLIST_IS_BUSY, 'System.Boolean', {})
return invoke_ipc(STYLIST_IS_BUSY)
end
local AUTORETAINER = 'AutoRetainer'
local AUTORETAINER_GETCONFIG = AUTORETAINER .. '.GetConfig'
local AUTORETAINER_GETCONFIG_SHUTDOWN = AUTORETAINER_GETCONFIG .. '.ShutdownOnSubExhaustion'
function autoretainer_shutdown()
require_ipc(AUTORETAINER_GETCONFIG_SHUTDOWN, 'System.Boolean', {})
return invoke_ipc(AUTORETAINER_GETCONFIG_SHUTDOWN)
end