Thread Tools Display Modes
10-07-07, 02:46 AM   #1
Mooid
A Murloc Raider
Join Date: Oct 2007
Posts: 4
Is it possible to connect to a web address?

I've abandoned the GUI portion of the DKP addon I've been working on for now, but is it possible to write into the LUA script a method of contacting a webserver to load and execute LUA script from it?

I first got the idea that this could be done when i saw this line in the Enchantrix addon:

Code:
Enchantrix_RegisterRevision("$URL: http://norganna.org/svn/auctioneer/trunk/enchantrix/EnxMain.lua $", "$Rev: 1984 $")
I just need to load a short string from the website which will pass along the character's name as a variable in a get string and cause the PHP script to access the MySQL database, get that player's current DKP, and return it as a variable to the addon.

I tried using dofile() but it seems that command doesn't work to import from a URL.

Any ideas on how to do this, or is it just not possible?
  Reply With Quote
10-07-07, 03:28 AM   #2
Zyonin
Coffee powered Kaldorei
 
Zyonin's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 1,443
Its possible but not in real time. The only way that info can be passed back and forth between WoW and the outside world is via SavedVariable lua files. However there is a catch. Data is only written to the SavedVariables folder when you:

A: Log out nornally,
B: Exit the game normally, not the old Alt F4 "kill it now" method,
C: Execute a /console reloadui

Then all you need is a program to parse the saved variable lua file and upload it to the site of your choice.

Conversely as part of that parser, you can write data that you have downloaded from your DKP site to the saved variables file, however this has to be done before WoW is loaded. Any data that is written to the saved variables file during gameplay by an outside program will be ignored. WoW cannot interact with outside executables while WoW.exe is loaded. This is done to hamstring Bot and other cheat type programs. It also helps to enhance the overall security of the WoW client.
__________________
Twitter

Last edited by Zyonin : 10-07-07 at 03:33 AM.
  Reply With Quote
10-07-07, 03:33 AM   #3
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by Mooid
I've abandoned the GUI portion of the DKP addon I've been working on for now, but is it possible to write into the LUA script a method of contacting a webserver to load and execute LUA script from it?

I first got the idea that this could be done when i saw this line in the Enchantrix addon:

Code:
Enchantrix_RegisterRevision("$URL: http://norganna.org/svn/auctioneer/trunk/enchantrix/EnxMain.lua $", "$Rev: 1984 $")
I just need to load a short string from the website which will pass along the character's name as a variable in a get string and cause the PHP script to access the MySQL database, get that player's current DKP, and return it as a variable to the addon.

I tried using dofile() but it seems that command doesn't work to import from a URL.

Any ideas on how to do this, or is it just not possible?
In addition to what Xinh said you can also make an .exe to create a .lua file for your addon to use, similar to what most Music addons do at the moment, but you have the same problem as it takes a reload UI to take effect.
  Reply With Quote
10-07-07, 03:36 AM   #4
Zyonin
Coffee powered Kaldorei
 
Zyonin's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 1,443
Originally Posted by Slakah
In addition to what Xinh said you can also make an .exe to create a .lua file for your addon to use, similar to what most Music addons do at the moment, but you have the same problem as it takes a reload UI to take effect.
I had said that via this statement:

Originally Posted by Xinh
Conversely as part of that parser, you can write data that you have downloaded from your DKP site to the saved variables file,
That parser exe can include the ability to write data to the SavedVariables folder when WoW.exe is not using it.
__________________
Twitter
  Reply With Quote
10-09-07, 09:57 AM   #5
Mooid
A Murloc Raider
Join Date: Oct 2007
Posts: 4
Hmm, that raises an interesting question for me then. Thotbott has an addon that collects game data and sends it in to the site. How does that work if you cannot access a URL in realtime?

If there is no way to do this in realtime, then I guess this project is over. The whole idea behind it was to build an addon/web database to manage DKP in-game, in realtime, but if there's no way to access the website directly, then the main goal of the project can't be completed. Then again I don't know jack about LUA lol I couldn't even get slash commands registered much less program anything more complex than loading a variable and making it spam every 5 mins or so lol.
  Reply With Quote
10-09-07, 10:39 AM   #6
Slakah
A Molten Giant
 
Slakah's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 863
Originally Posted by Xinh
I had said that via this statement:



That parser exe can include the ability to write data to the SavedVariables folder when WoW.exe is not using it.
I assume by Saved variables you are talking about the contents of the WTF folder, all I was suggesting is to create a lua file which is part of the addon (instead of being in the WTF folder) which will be read on reload UI and cannot be overwritten by the WoW Client, thus only allowing ingame viewing of the DKP.

Last edited by Slakah : 10-09-07 at 10:41 AM.
  Reply With Quote
10-09-07, 10:39 AM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
I don't use it, but I'm assuming it just doesn't do it in "real time" but rather works the same way everything else does. Accessing the saved variables and/or cache after you're finished playing.

Programs like UniUploader upload saved variables of your choice to websites of your choice automatically when you exit the game.
__________________
"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
10-09-07, 12:10 PM   #8
Gemini_II
A Molten Giant
 
Gemini_II's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 762
Originally Posted by Mooid
Hmm, that raises an interesting question for me then. Thotbott has an addon that collects game data and sends it in to the site. How does that work if you cannot access a URL in realtime?
Website clients like Thottbott, Wowhead, Allakhazam, etc. operate by parsing data in-game (like any other addon) and storing that in Savedvariables. When you exit WoW, you goto the website (or use the client) to upload your data. It is impossible to submit that data from WoW while it's running.
__________________
Retired prior to 3.2, before all challenge was removed.

  Reply With Quote
10-09-07, 01:00 PM   #9
Zyonin
Coffee powered Kaldorei
 
Zyonin's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 1,443
Originally Posted by Slakah
I assume by Saved variables you are talking about the contents of the WTF folder, all I was suggesting is to create a lua file which is part of the addon (instead of being in the WTF folder) which will be read on reload UI and cannot be overwritten by the WoW Client, thus only allowing ingame viewing of the DKP.
You could do that, however then this kind of defeats the purpose of a in0game DKP AddOn as you cannot keep track of DKP changes. You would have to use a second AddOn to keep track of any DKP changes as you raid. In addition every time you update the AddOns's DKP table you would have update the AddOn. Easier to use a parser/updater that uses the data found inside the WTF folder. You can then have that parser convert that Raid's DKP data as a plain XML file or your DKP's systems (EQDKP, NDKP, etc) flavor of choice and upload it your site. You can then have that updater grab the latest update from your website, convert it to lua that is written in the WTF folder and then have that data ready to go next time you raid. That parser/updater would only have to keep track of one file, the SavedVariable that is found in the WTF folder.
__________________
Twitter

Last edited by Zyonin : 10-09-07 at 01:04 PM.
  Reply With Quote
10-09-07, 11:57 PM   #10
Gemini_II
A Molten Giant
 
Gemini_II's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 762
UniUploader?
__________________
Retired prior to 3.2, before all challenge was removed.

  Reply With Quote
10-10-07, 02:35 AM   #11
Zyonin
Coffee powered Kaldorei
 
Zyonin's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 1,443
Originally Posted by Gemini_II
UniUploader?
UniUploader would be the first place I would start.
__________________
Twitter
  Reply With Quote
10-10-07, 08:53 AM   #12
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
http://www.curse.com/downloads/details/96/
__________________
"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
10-10-07, 10:25 AM   #13
Gemini_II
A Molten Giant
 
Gemini_II's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 762
Home of UniUploader, jUniUploader, and WoWRoster:

http://www.wowroster.net/
__________________
Retired prior to 3.2, before all challenge was removed.

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Is it possible to connect to a web address?


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