Quantcast
I'd like to integrate a python script into an addon - WoWInterface
Thread Tools Display Modes
01-22-21, 07:45 PM   #1
cheesewiz
A Murloc Raider
Join Date: Jan 2021
Posts: 3
Lightbulb delete please

solved, figured out how to do it

Last edited by cheesewiz : 02-27-21 at 11:18 PM.
  Reply With Quote
01-23-21, 09:14 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,340
In short, you don't.

The game reads information from the various SavedVariables files for addons when your character logs in. After that, the files aren't used until your character logs out or you /reload at which time all the files are overwritten with what is currently "in-game".

Because of this you can't usefully write to the files while playing.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 01-23-21 at 09:17 AM.
  Reply With Quote
01-23-21, 09:49 AM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,577
The only problem your request has is getting the data into the game automatically, as Fizzle explained this isn't possible. But it doesn't stop you from manually adding items into an addon that creates a list ( table ) that it uses to do what you want it to do.

Suggested Avenue:
a) Outside of game your python script is doing its stuff and lets you know what you need to know
b) You then manually put that information into the addon that has a section that handles storing of information for using later.
c) Another routine in the same addon, then uses that information to handle the auction house tasks


As to your numerated queries
1) You may be able to target someone nearby by name using /target in a macro, otherwise, you may have to target them manually.
2) Your addon can have a button on it that using a keybinding can call a function that starts the search functionality you want and addons are allowed to do.
3) How lightweight it will be I don't know but whether you are scanning for one or more item types you will likely be scanning the auction house to get the information you need.


How you would go about this in more detail I can't help you with as I only briefly looked at the auction house system as I don't need to customize how that part of the game works.
__________________
  Reply With Quote
01-23-21, 01:18 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,816
How exactly is your Python script getting this information?
__________________
"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

  Reply With Quote
01-23-21, 03:53 PM   #5
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,340
I think we're talking about Blizzards external APIs

As far as I can tell, you can't post auctions just view current auctions.

The script could probably output to a table in a SavedVariables file but you would still have to log into the game to post anything. I've never really looked into it so...
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
01-23-21, 11:11 PM   #6
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,340
As in posting a buy order?

It doesn't seem from the documentation that there is any method to alter information on the server. That has to be done in game which uses Lua, not python.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
01-24-21, 04:18 PM   #7
sezz
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 147
Originally Posted by Fizzlemizz View Post
As in posting a buy order?

It doesn't seem from the documentation that there is any method to alter information on the server. That has to be done in game which uses Lua, not python.
When the python script finds item X on server Y for a price less then Z it creates/updates a shopping list in [not yet existing addon's] SavedVariables lua -> we don't need to care about this.

So basically he has a table containing the items he wants to buy (up to a maximum price) and is looking for a solution to do so using lua by pressing a button multiple times.

(At least that's how I understand it. Sound totally possible for me, but I haven't played around with the "new" ingame AH API yet.)
  Reply With Quote
03-18-21, 01:21 PM   #8
cheesewiz
A Murloc Raider
Join Date: Jan 2021
Posts: 3
problem solved, delete please.

Last edited by cheesewiz : 03-31-21 at 02:31 PM.
  Reply With Quote
03-18-21, 07:57 PM   #9
Ketho
A Molten Giant
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 975
Originally Posted by cheesewiz View Post
solved, figured out how to do it

Weird how people just remove their question when they solve it
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » I'd like to integrate a python script into an addon

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