Page 1 of 1

Linen Coin Purse

Posted: Sun Apr 10, 2016 10:51 pm
by KOSMOS
Here is the correct lua coding for this file.

linen_coin_purse.lua

Code: Select all

------------------------------------
--    ID: 5736
--    Lin. Purse (Alx.)
--    Breaks up a Linen Purse
-----------------------------------------

-----------------------------------------
-- OnItemCheck
-----------------------------------------

function onItemCheck(target)
local result = 0;
    if (target:getFreeSlotsCount() == 0) then
        result = 308;
    end
return result;
end;

-----------------------------------------
-- OnItemUse
-----------------------------------------

function onItemUse(target)
    target:addItem(2488,math.random(50,99));
end;

Re: Linen Coin Purse

Posted: Fri Apr 15, 2016 8:12 pm
by TeoTwawki
step1: indent the local variable and the return,
step2: remove the excessive spacing from the header,
step3: pull request file change on github,
step4: pat self on back for contributing :)
step5: realize we forgot to include "????" and "profit" in there.

Re: Linen Coin Purse

Posted: Fri Apr 15, 2016 10:50 pm
by KOSMOS
TeoTwawki wrote:step1: indent the local variable and the return,
step2: remove the excessive spacing from the header,
step3: pull request file change on github,
step4: pat self on back for contributing :)
step5: realize we forgot to include "????" and "profit" in there.
Ok think I did it correctly for those two files. Let me know if I messed up on a step or anything in my coding is not to the proper format for this project. I changed everything to 4,8 spaces and pretty sure indented everything correctly though.