WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   AutoTrainSpells addon (https://www.wowinterface.com/forums/showthread.php?t=40431)

Xaelic 06-07-11 03:19 PM

AutoTrainSpells addon
 
I have find out the script that you can use in game to have u learn all available spells at the trainer. If you press the macro once then until you logout when ever you go to the trainer you will learn the spells automatically. I just need help making the addon and could use some help

Nobgul 06-07-11 04:17 PM

well post the macro. you have. and someone will turn it into a addon for you, maybe.

Xaelic 06-07-11 05:21 PM

Quote:

Originally Posted by Nobgul (Post 238964)
well post the macro. you have. and someone will turn it into a addon for you, maybe.

/run LoadAddOn"Blizzard_TrainerUI" f=ClassTrainerTrainButton f.e = 0 if f:GetScript"OnUpdate" then f:SetScript("OnUpdate", nil)else f:SetScript("OnUpdate", function(f,e) f.e=f.e+e if f.e>.01 then f.e=0 f:Click() end end)end

Ketho 06-08-11 07:14 PM

1 Attachment(s)
.. I will try to help then~

You could register for TRAINER_SHOW, and only then maybe use an OnUpdate handler to click on the button, and cancel the OnUpdate handler again on TRAINER_CLOSED. but that's just my 2 cents...

This link should also be useful, for in the future
  • AutoTrainSpells.lua
    Code:

    local f = ClassTrainerTrainButton
    f.e = 0

    f:SetScript("OnUpdate", function(f, e)
            f.e = f.e + e
            if f.e > .01 then
                    f.e = 0
                    f:Click()
            end
    end)

  • AutoTrainSpells.toc
    Code:

    ## Interface: 40100
    ## Version: 0.1
    ## Title: AutoTrainSpells
    ## Notes: Auto trains your spells
    ## Author: Xaelic
    ## Dependencies: Blizzard_TrainerUI

    AutoTrainSpells.lua


Seerah 06-08-11 07:31 PM

I would actually do:
Quote:

Originally Posted by Ketho (Post 239034)
AutoTrainSpells.toc
Code:

## Interface: 40100
## Version: 0.1
## Title: AutoTrainSpells
## Notes: Auto trains your spells
## Author: Xaelic
## LoadOnDemand: 1
## LoadWith: Blizzard_TrainerUI


AutoTrainSpells.lua


That way the addon doesn't even load until you visit a trainer.

Xaelic 06-08-11 08:17 PM

thanks guys, i will post this with credits to you two

Xaelic 06-08-11 08:55 PM

ok Addon is posted in Miscellaneous
Ty both of u


All times are GMT -6. The time now is 06:30 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI