Well, I didn't solved the problem but I found a way to get what I was looking for (not really, I'm inventing what I want as I create more code

):
- Code: Select all
TestFrame=CreateFrame("Frame")
pressing=0
TestFrame:SetScript("OnUpdate",function()
if (IsShiftKeyDown())then
if (GetMouseFocus():GetID()~=0)then
if (pressing==0)then
texture, count = GetContainerItemInfo(GetMouseFocus():GetParent():GetID(), GetMouseFocus():GetID())
if (count~=nil)then
DEFAULT_CHAT_FRAME:AddMessage(count..GetContainerItemLink(GetMouseFocus():GetParent():GetID(), GetMouseFocus():GetID()))
pressing=1
end
end
end
elseif (pressing==1)then
pressing=0
end
end)
I will explain line by line as I understand it for the people that can't understand...
1 Create a frame with the name "TestFrame"
2 Create a variable equal to 0 with the name "pressing"
3 Open the code for the OnUpdate of the frame "TestFrame" (trigger the code below 60 times per second, every frame of the game)
4 Runs the code below if the shift is being pressed
5 Runs the code below if the mouse is over a slot/item (if you have the mouse out of the slots/items you will get the value 0)
6 Runs the code below if the variable "pressing" is equal to 0 (it was when we created so no problem, this is to prevent a lot of links in the chat because you don't press the shift only one frame)
7 Create a variable "count" (the texture doesnt matter, I just coldn't figure out how to do this...) that is equal to the ammount of items in the sslot (normally 1, only more if you have items stacked)
8 Runs code below if the ammount of items is different from nothing (that way I can know if I actually have an item in that slot)
9 Add a message to the chat saying the ammount of items (stacked) and the name/link of the item (but only for you, the other players don't see it on chat)
10 Changes the value of the variable "pressing" so that it won't writte more than one time when pressing shift once (line 6 blocks it

)
11 End the if of line 8
12 End the if of line 6
13 End the if of line 5
14 If the if on line 4 is false then try this one (if your not pressing the shift and your not holding it)
15 Then the variable "pressing" equals 0, so that you can press shift again
16 End the if on line 4
17 End the always running code below line 3
I found out that line 7 actually has a bug. If I have the mouse over one of the 4 bags but not on the slot (all exept the backpack) then it will think I have it over the slot of backpack. On bag 2 thinks I'm on slot 2 of backpack but wharever... EDIT: ...And if I have the mouse over some action buttons... That's why I was trying to figure it out, you can't go around a bug and try another way, you have to find that way because there's no other way, but for some reason all of this is so well hidden over the internet and when I try to study someone else's addon it's like 1500lines and 10files. WHY!? For example, GetContainerFreeSlots doesn't work. It may have been added on an later patch, I don't know. What I mean is that the things that exist seems to have been created by the people who make addons, because it looks like all you can do with an addon is already created, you can't do more. People say it's hard to program (maybe you don't, idk) but what's really hard is to find the way the language works, because nobody wanna help you, only hint you in the right direction. You have to read and read a lot that doesn't matter because there's no famous site with all docummentaited (bad english :S) and most of the people won't even read this or try my code, they just see something they know in the code and tell me something that isn't what I asked, like an link. Don't answer me saying this is offencive because I won't care how you misunderstood what Im trying to say. If you wanna try to help me that would be great, but I can't count on this threat because I know, at the end, I have to search like crazy. I just wanted to create a good, simple addon created especially for the Nostalrius server and that wouldn't be big, or hard to read the files (and free and that kind of stuff, I'm out)