Following what I could understand of EN's tutorial, I've crafted the following beginnings of a replacement to Guadah's Item ID Finder:
--
--Functions
--
function ENs_GetItemTypeFromItemID(nItemID)
local nThisType = nil
local nCnt = UO.ScanItems(true) -- visible only
local nIndex = 0
while nIndex < nCnt and nThisType == nil do
local nID,nType,nKind,nContID,nX,nY,nZ,nStack,nRep,nCol = UO.GetItem(nIndex)
if nID == nItemID then nThisType = nType end
nIndex = nIndex + 1
end
return nThisType
end
function DetermineItemID(sMessage) --stolen from EN, like most of my stuff
UO.LTargetKind = 1 -- object
UO.ExMsg(UO.CharID , sMessage) -- Message above character
UO.TargCurs = true -- make a target cursor
while UO.TargCurs == true do wait(10) end -- wait until something is clicked (ie notarget cursor)
UO.LObjectID = UO.LTargetID -- set last object to the object clicked
return UO.LTargetID -- set the return value .. the itemid clicked
end
function msgbox(default, prompt, title, button, icon)
-- Function By Traegon's, Link: http://www.easyuo.com/forum/viewtopic.php?p=376784#376784
if icon == nil then icon = 2 end
if default == true then default = 1 else default = 0 end
ConfirmDialog = Obj.Create("TMessageBox")
ConfirmDialog.Title = title
ConfirmDialog.Button = button
ConfirmDialog.Icon = icon
ConfirmDialog.Default = default
return ConfirmDialog.Show(prompt)
end
function MessageBox(sPrompt, sTitle, sType)
if sType == 'OK' then return msgbox(true, sPrompt, sTitle, 0,4) end
if sType == 'YESNO' then return msgbox(true, sPrompt, sTitle, 4,3) end
end
--
--Script begin
--
repeat
local nMysteryItem = DetermineItemID('Target the item you wish to ID:')
local nItemType = ENs_GetItemTypeFromItemID(UO.LTargetID)
local nResult = MessageBox( 'Item Type is: ' .. nItemType .. '. Identify another item?', 'NObama was here', 'YESNO')
until nResult == 7 --no
Run it. See the message box? How can I do the following:
1 - Add carriage returns to the output, so I can have multiple lines of information displayed in an easy-to-read format?
2 - How can I parse out actual names of items?
My thought is to display something along these lines:
Item Type Is: XXXX
Item Name Is: XXXX
.
.
.
What say you, smart people?