E
Evil Puncker
Guest
Using tfs 1.3, can you guys please help me converting those 3 scripts into its meta-table counterpart? thanks:
I tried doing it by using the compat.lua file but my head just went boom lol (full script in case its matter)
and second question: is it safe to change db.query into db.storeQuery? because I saw nothing related to it into the compat.lua
Lua:
if getContainerSize(getPlayerSlotItem(player, CONST_SLOT_BACKPACK).uid) then
for i = 0, getContainerSize(getPlayerSlotItem(player, CONST_SLOT_BACKPACK).uid) do
local thing = getContainerItem(getPlayerSlotItem(player, CONST_SLOT_BACKPACK).uid, i)
container[i] = getContainerItem(getPlayerSlotItem(player, CONST_SLOT_BACKPACK).uid, i)
if isContainer(container[i].uid) then
if not table.contains(names, container[i].itemId) then
table.insert(names, container[i].itemId)
window:addChoice(sum, ""..string.gsub(" "..string.lower(ItemType(container[i].itemid):getName()), "%W%l", string.upper):sub(2).."")
end
sum = sum + 1
end
end
else
player:sendCancelMessage("Not find main backpack.")
return false
end
Lua:
local container, bp, sequencer = {}, {}, 1
local bp2 = {}
for i = 0, getContainerSize(getPlayerSlotItem(player, CONST_SLOT_BACKPACK).uid) do
local thing = getContainerItem(getPlayerSlotItem(player, CONST_SLOT_BACKPACK).uid, i)
container[i] = getContainerItem(getPlayerSlotItem(player, CONST_SLOT_BACKPACK).uid, i)
if isContainer(container[i].uid) then
itemtester = Item(container[i].uid)
bp[sequencer] = itemtester
bp2[sequencer] = itemtester:getId()
sequencer = sequencer + 1
end
end
Lua:
local container, bp, sequencer = {}, {}, 1
local bp2 = {}
for i = 0, getContainerSize(getPlayerSlotItem(player, CONST_SLOT_BACKPACK).uid) do
local thing = getContainerItem(getPlayerSlotItem(player, CONST_SLOT_BACKPACK).uid, i)
container[i] = getContainerItem(getPlayerSlotItem(player, CONST_SLOT_BACKPACK).uid, i)
if isContainer(container[i].uid) then
itemtester = Item(container[i].uid)
bp[sequencer] = itemtester
bp2[sequencer] = itemtester:getId()
sequencer = sequencer + 1
end
end
I tried doing it by using the compat.lua file but my head just went boom lol (full script in case its matter)
and second question: is it safe to change db.query into db.storeQuery? because I saw nothing related to it into the compat.lua