Thread Tools Display Modes
10-01-08, 05:51 PM   #1
Phenomena
A Murloc Raider
Join Date: Oct 2008
Posts: 5
Reading Files

Hey there this is my first attempt at writing an AddOn for WoW. So I started out with the basic "Hello World!" and now I'd like to expand on that, instead of just having the function output a predefined string how could I make it output the string from a .txt file?
  Reply With Quote
10-01-08, 05:52 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
WoW cannot read from text files.
__________________
"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-01-08, 06:35 PM   #3
dewin
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 6
Originally Posted by Seerah View Post
WoW cannot read from text files.
To build on that:

To avoid any sort of scripting/etc, Blizzard tries really hard to prohibit communications between addons and the 'outside world'.

The closest think you can do to communication with the outside world is having an outside app read/write an addon's savedvariables file, but that will only kick in while logged out of WoW and (possibly) during reload UI. This is how some data miners work, such as the census app, Thott, etc.
  Reply With Quote
10-01-08, 09:08 PM   #4
Vyper
A Rage Talon Dragon Guard
 
Vyper's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 317
Originally Posted by dewin View Post
To build on that:

To avoid any sort of scripting/etc, Blizzard tries really hard to prohibit communications between addons and the 'outside world'.
I think it has more to do with security than anything else. If you cannot read/write files or open sockets from an addon, you cannot harm the users computer (ok I suppose you can try to overheat their CPU by calculating the last digit of Pi, but other than that...)
  Reply With Quote
10-01-08, 09:15 PM   #5
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
No, not just security... Also botting, etc.
__________________
"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-01-08, 09:21 PM   #6
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Originally Posted by Vyper View Post
If you cannot read/write files or open sockets from an addon, you cannot harm the users computer
What's about ... uhmm ... buffer overflows or similar stuff?
  Reply With Quote
10-01-08, 11:05 PM   #7
MoonWitch
A Firelord
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 455
Originally Posted by Vyper View Post
(ok I suppose you can try to overheat their CPU by calculating the last digit of Pi, but other than that...)
Originally Posted by Duugu View Post
What's about ... uhmm ... buffer overflows or similar stuff?
Ooooh, I feel my evil side emerge :P
  Reply With Quote
10-01-08, 11:09 PM   #8
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
I'm your father, Luke.
  Reply With Quote
10-02-08, 08:33 AM   #9
Vyper
A Rage Talon Dragon Guard
 
Vyper's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 317
Originally Posted by Duugu View Post
What's about ... uhmm ... buffer overflows or similar stuff?
In theory, in a memory managed language like lua a buffer overflow is not a possibily, especially if you look at how lua tables work (they're not normal arrays). Now do I gaurentee there is not a bug in the WoW implementation that makes something like that possible? Of course not! However there shouldn't be . Also since addons are run in the WoW memory space, the OS should be preventing access to any memory outside of WoW, again leaving the (theoretical) worst they can do even if such a bug exists as crashing WoW.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Reading Files


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