Skip to content

Commit

Permalink
ver 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
NNAKAYAMA committed Jan 2, 2017
1 parent 2935046 commit 010c66f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 61 deletions.
2 changes: 1 addition & 1 deletion moneydiff/src/moneydiff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function MONEYDIFF_INIT()
local diff = nowMoney - g.money;
if diff > 10000 then
local mapName = geMapTable.GetMapProp(g.map):GetName()
CHAT_SYSTEM(string.format("%sで%ssilver取得しました",mapName,acutil.addThousandsSeparator(diff)))
CHAT_SYSTEM(string.format("%s:%ss Get",mapName,acutil.addThousandsSeparator(diff)))
end
g.money = nowMoney;
g.map = session.GetMapName()
Expand Down
Binary file added poisonpotautocharge/poisonpotautocharge.ipf
Binary file not shown.
77 changes: 17 additions & 60 deletions poisonpotautocharge/src/poisonpotautocharge.lua
Original file line number Diff line number Diff line change
@@ -1,72 +1,29 @@
local acutil = require('acutil');
ui.SysMsg("Load poisonpot auto charge")
ui.SysMsg("Load Poisonpot Auto Charge")

function POISONPOTAUTOCHARGE_ON_INIT(addon, frame)
POISONPOT_AUTO_CHARGE()
end

function POISONPOT_AUTO_CHARGE()

if hasPoisonJob() == nil then
return;end

local poisonAmount = getPoisonAmount()
if poisonAmount == nil then
return;end

local poisonpot = GET_POISONPOT_ID();

if poisonpot == nil then
return;end

local cnt = math.floor((1000 - poisonAmount) / 200);
session.AddItemID(poisonpot, cnt);
EXECUTE_POISONPOT_COMMIT()
end

function hasPoisonJob()
local frame = ui.GetFrame("sysmenu");
local frame = ui.GetFrame("sysmenu");
local poisonpot = GET_CHILD(frame, "poisonpot", "ui::CButton");
if poisonpot == nil then
return nil
end
return true
end

function getPoisonAmount()
if not poisonpot then
return;
end

local myEtc = GetMyEtcObject();
local poisonAmount = myEtc['Wugushi_PoisonAmount'];
if poisonAmount < 700 then
return poisonAmount;

local cnt = math.floor((1000 - poisonAmount) / 200);
if cnt < 1 then
return
end
return nil
end

-- 645569 misc_poisonpot

function GET_POISONPOT_ID()
local inventoryItems = session.GetInvItemList();

if inventoryItems == nil then
return nil;end

local poison = session.GetInvItemByName('misc_poisonpot')
local poisonGUID = poison:GetIESID()

local index = inventoryItems:Head();
local itemCount = session.GetInvItemList():Count();

for i = 0, itemCount - 1 do
local inventoryItem = inventoryItems:Element(index);
index = inventoryItems:Next(index);

if inventoryItem == nil then
break;end

local itemObj = GetIES(inventoryItem:GetObject());
if itemObj == nil then
break;end

if string.starts(itemObj.ClassName, "misc_poisonpot") then
return inventoryItem:GetIESID();
end
end
return nil;
end
session.ResetItemList()
session.AddItemID(poisonGUID, cnt);
EXECUTE_POISONPOT_COMMIT()
end

0 comments on commit 010c66f

Please sign in to comment.