Thread Tools Display Modes
10-16-10, 07:43 PM   #1
Narinka
A Chromatic Dragonspawn
Join Date: Oct 2008
Posts: 165
Selling grey items

Maybe someone has some simple script to sell all grey items in inventory? Used GarbageFu before, but maybe can do it with RDX.
  Reply With Quote
10-20-10, 07:02 AM   #2
Narinka
A Chromatic Dragonspawn
Join Date: Oct 2008
Posts: 165
Self response.. Not tested yet, macro actually, but who cares..

/run local p,N,c,n=0 for b=0,4 do for s=1,GetContainerNumSlots(b) do n=GetContainerItemLink(b,s) if n and string.find(n,"9d9d9d") then N={GetItemInfo(n)} c=GetItemCount(n) p=p+(N[11]*c)UseContainerItem(b,s) print(n) end end end print(GetCoinText(p))
  Reply With Quote
11-17-10, 05:28 PM   #3
horse21
An Aku'mai Servant
Join Date: Dec 2009
Posts: 34
automation

How would one going about automating this, rather than using a macro every time? i.e. open vendor window, script sells all gray items automatically
  Reply With Quote
11-17-10, 11:23 PM   #4
Troox
A Cyclonian
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 41
Thats what i use in my Autoexec Script for RDX, hope its usefull for you

Code:
local function GreySell()
  for bag=0,4 do
    for slot=0,GetContainerNumSlots(bag) do
      local link = GetContainerItemLink(bag, slot)
      if link and select(3, GetItemInfo(link)) == 0 then
        ShowMerchantSellCursor(1)
        UseContainerItem(bag, slot)
      end
    end
  end
end

local f = CreateFrame("Frame")
f:RegisterEvent("MERCHANT_SHOW")
f:SetScript("OnEvent", GreySell)
if MerchantFrame:IsVisible() then GreySell() end

Last edited by Troox : 11-20-10 at 06:35 AM. Reason: Missed the local f = CreateFrame("Frame") Line, sorry ;)
  Reply With Quote
11-19-10, 10:44 PM   #5
horse21
An Aku'mai Servant
Join Date: Dec 2009
Posts: 34
Insertion

Thanks!

Couple of questions:
1) What part of the script designates the item quality ( grey )? Would be good to know if I'd like to do something with item qualities in scripts later on. I'm guessing it has to do with this line:
if link and select(3, GetItemInfo(link)) == 0 then
but I don't know the syntax enough to know what objects are being used and what part is actually the checking to see if the item is grey.

2) How to I make OpenRDX use this? It looks like this script is setting up the function to do the lifting of selling the items, then connecting the function to the event of opening a merchant window. The part I'm unclear on, is how to actually put it into RDX in a way that will make it use the script.

Sorry for the kind of long questions, I'm a programmer and interested in doing scripting like this, just don't know LUA or the WoW API. Thanks!

P.S. Just to feed my own programming curiosity, can you hook multiple scripts to an event using the same syntax? e.g. could I add a function called SellGreen and add another line like:
f:SetScript("OnEvent", SellGreen)
  Reply With Quote
11-20-10, 06:33 AM   #6
Troox
A Cyclonian
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 41
1) http://www.wowwiki.com/API_GetItemInfo
With Select you choose the third value from GetItemInfo, here ItemRarity. Goes from 0 to 7. http://www.wowwiki.com/API_TYPE_Quality

2) Open the Package Explorer, create a new Package or choose a existing one, right click it and choose "Info Package". On the Bottom you find "Run autoexec script". Activate it. Create in this package a new Object -> Script and name it "autoexec". In this Script (Rightclick/Edit) goes your code. Now it should be startet after a ReloadUI. If you want to add another function you need to change the name. f: was only a example.

eeeks, bad school english sorry

Take a look on my last post, missed a Line -> local f = CreateFrame("Frame")

Last edited by Troox : 11-20-10 at 06:35 AM.
  Reply With Quote
11-20-10, 12:52 PM   #7
horse21
An Aku'mai Servant
Join Date: Dec 2009
Posts: 34
Ah! That line is what was messing me up; kept saying that f couldn't be found!

Thanks for all of the info! I'm sure I'll be shuffling through that wiki in the future.
  Reply With Quote

WoWInterface » Featured Projects » OpenRDX » OpenRDX Community » OpenRDX: Community Chat » Selling grey items


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off