Greetings and Salutations!! I THANK you for even viewing and reading my post!!
The Addon that I am trying to develop will, in the end, be able to take upwards of 100,000 Item ID’s and simply display/output the Profession those items belong to in the same order as the list that it belongs with, to another editbox that can be then copied and pasted to a word processor or a txt document with the order maintained. I made a diagram showing what I mean.
So far, what I was able to figure out was how to get the Profession of the Item to print to the default chat console. I believe that is proof that it can be done. Sometimes, for items of mining for example, it will say Metal and Stone. But something like that I can easily manage in a word processor and make it say Mining. A Small issue with the code part I kinda figured out is that here and there it would print a “nil” value. With a reload, it would usually not do that and properly print the attributes of GetItemInfo(). If the nil values still persisted with a reload, I had to logout and log back in on that same character and then it would properly print the attributes.
I also half-managed to get some form of an EditBox so that I can copy from the clipboard to this edit box. It’s not pretty and currently does not work right as I don’t understand how to fix the code.
I also made an attempt, based on how I originally was able to get the Profession Name with the GetItemInfo(), to with the EditBox that I have try and paste into the Edit Box some Item ID’s and have the program recurse through those Item ID’s outputting the Profession Name. But it didn’t work at all….
I also made an attempt to create a Scroll Bar. I’m not sure if it works I think it’s invisible? As when I load the Addon I cannot scroll in the normal chat box until I close the EditBox. Weird huh?
I was looking at wowpedia, as I was being helped, to try and figure out the syntax [maybe not the proper term?] to execute the num = EditBox:GetNumber() function. I am still scratching my head. I bought the 2 books on WoW programming but I was informed to return them to amazon as they are 13 years old and the game has drastically changed so much and that’s why the examples were kinda not working for me really…
At the beginning of my code, which I’ll also put here, I “hardcoded” a value into the variable itemNum just so that I could output the fields from GetItemInfo() to the default chat frame. It definitely shows the Profession of the Item ID, called itemSubType, I just gotta get a lot of em and put it in another edit box that can be copied and pasted to excel or txt document.
So what I was looking for I suppose is resources on how to:
-Properly implement the num=EditBox:GetNumber() function, as the list will be all numbers and I think this function is key
-Make a proper editBox so that I can paste the Item ID numbers into it so that I can create a loop function that will parse this large list
-Make another proper editBox that will display the Profession Name that can be copied to Clipboard
-um…. I can’t think of anything else……
-Enable the buttons to actually do copy and pasting and the conversion when you click on them
This is my first attempt at making an Addon, any help is so very much appreciated!!!
A Picture Illustrating What I Am Trying To Achieve: um…i have a picture on imgur but it wont let me do it…i dont know why
The Code So Far;
print("PROFESSION LOOK UP")
--Test Item ID Number for printing the Profession Type, it's a Raw Rockscale Cod
local itemNum = 6362
--Display Item Info using GetItemInfo(), showing basic info
local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType,
itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice =GetItemInfo(itemNum)
--I know the following is printing to my chatbox only, but i was having a hard time getting the editbox to work so i had to
print (" ")
print ("##Basic Item Info##")
print (" ")
print (itemName)
print (itemLink)
print (itemRarity)
print (itemLevel)
print (itemMinLevel)
print (itemType)
print (itemSubType) --this is KEY to printing the Profession type the Item is apart of
print (itemStackCount)
print (itemEquipLoc)
print (itemTexture)
print (itemSellPrice)
print (" ")
--Display Item Info using GetItemInfo(), showing detaied info
local itemName, itemLink, itemQuality, itemLevel, itemMinLevel, itemType, itemSubType,
itemStackCount, itemEquipLoc, itemTexture, sellPrice, classID, subclassID, bindType,
expacID, setID, isCraftingReagent
= GetItemInfo(itemNum)
print (" ")
print ("##Detailed Item Info##")
print (" ")
print (itemName)
print (itemLink)
print (itemRarity)
print (itemLevel)
print (itemMinLevel)
print (itemType)
print (itemSubType)
print (itemStackCount)
print (itemEquipLoc)
print (itemTexture)
print (classID)
print (subclassID)
print (bindType)
print (expacID)
print (setID)
print (isCraftingReagent)
print (" ")
print ("EDIT BOX VALUE?")
print (itemNum)
print (" ")
--Above this line shows proof that I CAN get the Profession name from the Item ID and print it...
--[[################################################################################################################################]]
--Creation of Frame for EditBox??
ProfLookUp = CreateFrame("Frame", nil, UIParent, "BasicFrameTemplateWithInset");
ProfLookUp:SetSize(500, 560);
ProfLookUp:SetPoint("CENTER", UIParent, "CENTER");
ProfLookUp:SetMovable(true);
--Puts the title of the box in the UI so you can actually see it
ProfLookUp.title = ProfLookUp:CreateFontString(nil, "OVERLAY");
ProfLookUp.title:SetFontObject("GameFontHighlight");
ProfLookUp.title:SetPoint("LEFT", ProfLookUp.TitleBg, 5, 0);
ProfLookUp.title:SetText("Profession Look Up")
--scroll bar with up and down button, Does Not Work unfortunately...?
ProfLookUp.ScrollFrame = CreateFrame("ScrollFrame", nil, ProfLookUp, "UIPanelScrollFrameTemplate");
ProfLookUp.ScrollFrame:SetPoint("TOPLEFT", ProfLookUpDialogBG, "TOPLEFT", 4, -8);
ProfLookUp.ScrollFrame:SetPoint("BOTTOMRIGHT", ProfLookUpDialogBG, "BOTTOMRIGHT", -3, 4);
local child = CreateFrame("Frame", nil, ProfLookUp.ScrollFrame);
child:SetSize(308, 500);
ProfLookUp.ScrollFrame:SetScrollChild(child);
ProfLookUp.ScrollFrame.ScrollBar:ClearAllPoints();
ProfLookUp.ScrollFrame.ScrollBar:SetPoint("TOPLEFT", ProfLookUp.ScrollFrame, "TOPRIGHT", -12, -18);
ProfLookUp.ScrollFrame.ScrollBar:SetPoint("BOTTOMRIGHT", ProfLookUp.ScrollFrame, "BOTTOMRIGHT", -7, 18);
--This should be creating my edit box so that i can copy and paste Profession ID's
ProfLookUp.pasteFrame = CreateFrame("EditBox", nil, ProfLookUp, "InputBoxTemplate");
ProfLookUp.pasteFrame:SetPoint("CENTER", ProfLookUp, "CENTER");
ProfLookUp.pasteFrame:SetWidth(400);
ProfLookUp.pasteFrame:SetHeight(400);
ProfLookUp.pasteFrame:SetMovable(true);
ProfLookUp.pasteFrame:SetAutoFocus(false);
ProfLookUp.pasteFrame:SetMultiLine(1000); --Currently set to accept 1000 rows of 1 Item ID per line?
ProfLookUp.pasteFrame:SetMaxLetters(1000); --Currently set to accept 1000 characters per line of Item ID's?
-- For the Edit Box at the end of the day i need it to accept 100,000 Item ID's with one Item ID per line and that item ID being up to
-- maybe 8 numbers in length or so, prolly 10 max
--This should be creating my button so that i can paste the Item ID's from the Clipboard
ProfLookUp.pasteBtn = CreateFrame("Button", nil, ProfLookUp, "GameMenuButtonTemplate");
ProfLookUp.pasteBtn:SetPoint("CENTER", ProfLookUp, "BOTTOM", 0, 40);
ProfLookUp.pasteBtn:SetSize(120, 30);
ProfLookUp.pasteBtn:SetText("PASTE");
ProfLookUp.pasteBtn:SetNormalFontObject("GameFontNormal");
ProfLookUp.pasteBtn:SetHighlightFontObject("GameFontHighlight");
--[[
--I dont know how to implement getting the number value, which would be the entereed Item ID, from the editbox to print the Profession
--But in the end this needs to traverse a list of Item ID's upwards of 100,000
local num = EditBox:GetNumber()
local itemName, itemLink, itemQuality, itemLevel, itemMinLevel, itemType, itemSubType,
itemStackCount, itemEquipLoc, itemTexture, sellPrice, classID, subclassID, bindType,
expacID, setID, isCraftingReagent
= GetItemInfo(num)
print (" ")
print (" ")
print (" ")
print (itemSubType)
print (num)
]]
--[[
Use WoW game version number
GetBuildInfo
In particular, /dump select(4, GetBuildInfo()) should output the correct version to your chat frame.
Get Lua Version
/script print(_VERSION)
]]
Thank You For Reaching The End!