Thread Tools Display Modes
07-11-05, 08:12 AM   #1
Kaelten
Jack's raging bile duct
 
Kaelten's Avatar
Featured
Join Date: May 2005
Posts: 782
DoTradeSkill == MassiveHeadache.

Hey guys I've got an issue with aparticular function in wow's api


I'm trying to institue a queue for KCET and it kinda works.... kinda.

Has anyone experianced any quirks with DoTradeSkill()?

it seems to work the first and maybe the second time but then it just doesn't work again.


If anyone has any ideas please let me know.


Thanks much.
__________________
WowAce.com & CurseForge.com Adminstrator
Developer of Ace3, OneBag3, and many other addons and libraries
Project lead and Mac developer for the Curse Client

Anyone that needs what they want
And doesn't want what they need
I want nothing to do with
 
07-11-05, 09:21 AM   #2
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
Haven't played with it too much, but wowwiki says you can use it as
DoTradeSkill(index, repeat); which I assume means you can specify the number of times to repeat the process. Is this not working?

Last edited by Beladona : 07-11-05 at 09:29 AM.
 
07-11-05, 08:58 PM   #3
Kaelten
Jack's raging bile duct
 
Kaelten's Avatar
Featured
Join Date: May 2005
Posts: 782
It does. but for some reasons when I try to use it again it won't work the second time until I trigger the reopening of the tradewindow.... sometimes it will work twice

i'm going to test it more now that I'm at home but if anyone else has any kinda feedback please let me know.
__________________
WowAce.com & CurseForge.com Adminstrator
Developer of Ace3, OneBag3, and many other addons and libraries
Project lead and Mac developer for the Curse Client

Anyone that needs what they want
And doesn't want what they need
I want nothing to do with
 
10-25-11, 04:18 PM   #4
wellbeing
A Cliff Giant
Join Date: Oct 2009
Posts: 71
Rezzing this thread. Solutions? Anyone?


Originally Posted by Kaelten View Post
It does. but for some reasons when I try to use it again it won't work the second time until I trigger the reopening of the tradewindow.... sometimes it will work twice

i'm going to test it more now that I'm at home but if anyone else has any kinda feedback please let me know.
 
10-25-11, 05:37 PM   #5
killerpet1986
A Fallenroot Satyr
 
killerpet1986's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 22
Originally Posted by wellbeing View Post
Rezzing this thread. Solutions? Anyone?
Hi wellbeing,

what exactly is the problem you are having? If you describe it I may be able to help you.

Bear in mind that this requires a hardware event similar to spells so you cannot do this:

Code:
*Press a button*

DoTradeSkill()

*Delay*

DoTradeSkill() (Automatically)
What you need to do is this:

Code:
*Press a button*

DoTradeSkill()

*Press a button*

DoTradeSkill()
 
10-25-11, 06:17 PM   #6
wellbeing
A Cliff Giant
Join Date: Oct 2009
Posts: 71
I suppose that IS the answer in itself.

I'm trying to craft tons of a single item, refilling automatically from the mailbox and sending off the creations. It's on the second call to dotradeskill() that I'm getting the interface action error.

Is there no way around this?

eidt* keep in mind that this is for personal use only. i need not have it be user friendly.

Originally Posted by killerpet1986 View Post
Hi wellbeing,

what exactly is the problem you are having? If you describe it I may be able to help you.

Bear in mind that this requires a hardware event similar to spells so you cannot do this:

Code:
*Press a button*

DoTradeSkill()

*Delay*

DoTradeSkill() (Automatically)
What you need to do is this:

Code:
*Press a button*

DoTradeSkill()

*Press a button*

DoTradeSkill()
 
10-25-11, 06:31 PM   #7
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
I wrote a wrapper API to craft an item by the spell ID found in the recipe link. What it does is open the tradeskill briefly, block the actual tradeskill frame from showing, clear all filters, scan for the specific recipe by spell ID, then crafts any number of times. If the tradeskill doesn't exist or it's only to craft once, it automatically closes the tradeskill. If it's to craft multiple times, it'll wait until UPDATE_TRADESKILL_RECAST fires with GetTradeskillRepeatCount() returning 1. This happens even when crafting is interrupted.

Even though count is required to actually craft anything, it'll accept nil to just return whether the player had the recipe or not.

lua Code:
  1. local DoTradeSkillByID; do
  2.     function DoTradeSkillByID(trade,id,count)
  3. --      Prevent the TradeSkill UI from loading
  4.         UIParent:UnregisterEvent("TRADE_SKILL_SHOW");
  5.         UIParent:UnregisterEvent("TRADE_SKILL_CLOSE");
  6.  
  7. --      Trigger TradeSkill open
  8.         CastSpellByID(trade);
  9.  
  10. --      Clear all filters
  11.         SetTradeSkillInvSlotFilter(-1,1,1);
  12.         SetTradeSkillSubClassFilter(-1,1,1);
  13.         SetTradeSkillItemNameFilter("");
  14.         SetTradeSkillItemLevelFilter(0,0);
  15.         TradeSkillOnlyShowMakeable(false);
  16.         TradeSkillOnlyShowSkillUps(false);
  17.  
  18. --      Scan for recipe
  19.         local found,run=false,false;
  20.         for i=1,GetNumTradeSkills() do
  21.             local link=GetTradeSkillRecipeLink(i);
  22.             if link and tonumber(link:match("|Henchant:(%d+)|h"))==id then
  23.                 if count and not IsFlying() then
  24.                     SelectTradeSkill(i);--  This should help read the correct amount of repeats through UPDATE_TRADESKILL_RECAST
  25.                     DoTradeSkill(i,count);
  26.                     run=true;
  27.                 end
  28.                 found=true;
  29.                 break;
  30.             end
  31.         end
  32.  
  33. --      Trigger TradeSkill close
  34.         if not run or not count or count<=1 then CloseTradeSkill(); end
  35.  
  36. --      Restore events
  37.         UIParent:RegisterEvent("TRADE_SKILL_SHOW");
  38.         UIParent:RegisterEvent("TRADE_SKILL_CLOSE");
  39.  
  40.         return found;
  41.     end
  42.  
  43.     local eventframe=CreateFrame()
  44.     eventframe:RegisterEvent("UPDATE_TRADESKILL_RECAST");
  45.     eventframe:SetScript(self,event
  46.         if event=="UPDATE_TRADESKILL_RECAST" and GetTradeskillRepeatCount()<=1 and not (TradeSkillFrame and TradeSkillFrame:IsShown()) then
  47.             CloseTradeSkill();
  48.         end
  49.     );
  50. end
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 10-25-11 at 06:36 PM.
 
03-30-20, 06:25 AM   #8
kamamir
A Kobold Labourer
Join Date: Mar 2020
Posts: 1
hello I have tried this code but this part shows an error

eventframe:SetScript(self,event
if event=="UPDATE_TRADESKILL_RECAST" and GetTradeskillRepeatCount()<=1 and not (TradeSkillFrame and TradeSkillFrame:IsShown()) then
CloseTradeSkill();
end
);

error : ')' expected near 'if'

I just started Lua programming, I tried to read about events and SetScript but didn't found the problem.

I tried ONUPDATE event but some how, some functions like CastSpell and DoTradeSkill does not work
btw i'm writing an Addon for 3.3.5a

I also could not use CastSpellByID, and I replaced it with CastSpell
I tried C_TimerAugment.lua but it did not work either

Last edited by kamamir : 03-30-20 at 06:27 AM.
 
03-30-20, 11:08 AM   #9
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Discussion of Private Servers, in any manner other than theoretical, is completely against our rules. We are an Official Fan Site. We follow Blizzard's rules, on top of our own rules.

Threads requesting assistance with Private Servers get locked. Repeated postings get you banned.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

 

WoWInterface » Developer Discussions » Lua/XML Help » DoTradeSkill == MassiveHeadache.

Thread Tools
Display Modes

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