viewing paste Unknown #49403 | Lua

Posted on the
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 64 65
    main = function()
    iiFiles = {
    "System/itemInfo_custom.lua",
    "System/itemInfo_KR.lua",
    }
 
    _TempItems = {}
    _Num = 0
 
    — check existing item
    function CheckItem(ItemID, DESC)
    if not (_TempItems[ItemID]) then
    _TempItems[ItemID] = DESC
    _Num = _Num + 1
    else
    myTbl = {}
    for pos,val in pairs(_TempItems[ItemID]) do
    myTbl[pos] = val
    end
 
    for pos,val in pairs(DESC) do
    if not (myTbl[pos]) or myTbl[pos] == “” then
    myTbl[pos] = val
    end
 
    end
 
    _TempItems[ItemID] = myTbl
    end
 
    end
    — end check
 
    — Read all files
    for i,iiFile in pairs(iiFiles) do
    d = dofile(iiFile)
    end
    — Read all files
 
    — process _TempItems
    for ItemID,DESC in pairs(_TempItems) do
    –print(“ItemID”,ItemID,”Name”,DESC.identifiedDisplayName)
    result, msg = AddItem(ItemID, DESC.unidentifiedDisplayName, DESC.unidentifiedResourceName, DESC.identifiedDisplayName, DESC.identifiedResourceName, DESC.slotCount, DESC.ClassNum)
    if not result then
    return false, msg
    end
    for k,v in pairs(DESC.unidentifiedDescriptionName) do
    result, msg = AddItemUnidentifiedDesc(ItemID, v)
    if not result then
    return false, msg
    end
    end
    for k,v in pairs(DESC.identifiedDescriptionName) do
    result, msg = AddItemIdentifiedDesc(ItemID, v)
    if not result then
    return false, msg
    end
    end
    end
    — process _TempItems
 
    _TempItems = nil
 
    return true, “good”
    end
Viewed 293 times, submitted by Pneuma.