forked from twilson63/ao-effect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
claim-cred.lua
31 lines (28 loc) · 871 Bytes
/
claim-cred.lua
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
ClaimEligible = {}
Claims = {}
CRED = "Sa0iBLPNyJQrwpTTG-tWLQU-1QeUAJA73DdxGGiKoJc"
BaseEndGame = endGame
BaseStartGamePeriod = startGamePeriod
function startGamePeriod()
print("handle claim eligible")
-- add each address in claim eligible in not there
for k,v in pairs(Waiting) do
if Waiting[k] and not Utils.includes(k, ClaimEligible) then
table.insert(ClaimEligible, k)
end
end
BaseStartGamePeriod()
end
function endGame()
-- handle claims here
print("handle claims")
-- add each address in claim eligible in not there
for k,v in pairs(Players) do
if Utils.includes(k, ClaimEligible) and not Utils.includes(k, Claims) then
--send claim for Quest 2
Send({Target = CRED, Action = "Transfer", Quantity = "500000", Recipient = k, Data = "Quest 2 Claim" })
table.insert(Claims, k)
end
end
BaseEndGame()
end