Played with opening and closing bags and got what you described once but can't repeat it.
I'll try and figure out what combination of Filter and Bag commands causes it. It has to be the
triggers being turned off by an RefreshInv() before previous invdata is finished.
Forgot about the database indexes, doing those next.
You also mentioned an error with "a sharp tooth", I've changed a few things since then. Does this item
still cause the error?
I really don't like the way I wrote this section because it tests if "item["items"][1][ "Level" ]" is
false rather than weather it exists at all (a few of these spread around the script).
I tried to re-write it the other day but got no where with it.
if not item["items"][1][ "Level" ] or GetVariable("UseCache") == "false" then
Is this the correct way to do this test?
This is the section with the line above:
--make sql table and select from db
a = {
["items"] = { "Serial", "Description","Level","Type","Value","Weight","Wear","Flags","Owner","Clan","Timer"},
["spellmod"] = { "itUses", "itLevel", "itSn1", "itSn2", "itSn3", "itSn4", "itSn5" },
["statmod"] = { "stName", "stValue" },
["resistmod"] = { "rsName", "rsValue" },
["drink"] = { "drServings", "drContents", "drCapacity", "drQuantity", "drThirst", "drHunger", "drUnknown" },
["weapon"] = { "wepName", "wepAvgDmg", "wepInflict", "wepDmgType" },
["food"] = { "fdPercentage" },
["container"] = { "ctCapacity", "ctHeaviest", "ctHolding", "ctNumber", "ctTotalWieght", "ctBurden", "ctPercentage" },
}
item = { ["items"] = {},["spellmod"] = {},["statmod"] = {},["resistmod"] = {},["skillmod"] = {},["drink"] = {},["weapon"] = {},["food"] = {},["container"] = {} }
for j in pairs (a) do
s = ""
for v,k in pairs (a[j]) do
s = s .. "\"" .. k .. "\"" .. ","
end
s = s:sub(1, s:len() - 1)
t = { [ "SELECT" ] = { s },
[ "FROM" ] = { j },
[ "WHERE" ] = { "Serial = " .. "'" .. Serial .. "'"}
}
res, s = AardSelect (t)
for i,v in pairs (res) do
if res[i] ~= nil then
table.insert (item[j], res[i])
else
DBmsg ("cancelmouseoverInfoWin: " .. s)
return
end
end
end --select from db
--get details if not already in database
if not item["items"][1][ "Level" ] or GetVariable("UseCache") == "false" then
--don't send more than one invdetails at once
if GetVariable ("GettingDet") == "false" then
SetVariable ("GettingDet", "true")
GetInvDet (Serial)
end
inT (" @gGetting details form MUD... ")
mw.popup (infowin, heading_font_id, font_id, "", t, x, y, TitleColour, BackgroundColour, false, AlignSide, AlignBottom)
return
end
If a record is found "items" table looks like this.
"items":
1:
"Type"="Armor"
"Description"="@WGueldars @wcrafted leather bracer"
"Owner"=""
"Flags"="v3"
"Timer"=""
"Clan"=""
"Weight"=1
"Wear"="wrist"
"Level"=1
"Serial"=155523564
"Value"=15
"statmod":
"container":
"weapon":
"drink":
"food":
"spellmod":
"skillmod":
"resistmod":
If no record is found "items" table looks like this:
"items":
1:
"Serial"=164419843
"Description"="@WGueldars@w crafted leather cap@w"
"statmod":
"container":
"weapon":
"drink":
"food":
"spellmod":
"skillmod":
"resistmod":
If I do GetInfo(271)(Background colour) I get "-1" When I pass this as a colour code to WindowCreate
I get no error so is "-1" black. And how do I change the window (main window no mini) background colour,
not the one for the text.
Theres a set of tags for updating inventory (added them to: http://www.gammon.com.au/forum/?id=9461)
I should be able to add this with out major changes but it does open up a lot of stuff to add.
Being able to know at all times what container an item is in will be cool. |