Thread Tools Display Modes
10-01-07, 04:31 PM   #1
danielku15
A Defias Bandit
Join Date: Oct 2007
Posts: 2
I/O Write / Read Textfiles

Hi there.
I'm trying to write an addon which sends incoming messages from the msn messenger into a wow interface and send it. The msn part works so far: Incoming messages are written into c:\MsnToWow.txt and if i write a line into c:\WowToMsn.txt ([email protected] Message) it's beeing send to the contact.
My interface looks like this:

Code:
+----------+--MSN--+------------+
| Activate |       | Deactivate |
+----------+-------+------------+
| MailBox  | MessageBox         |
+----------+--------------------+
|                        | Send |
+-------------------------------+
| MessageList                   |
|                               |
|                               |
|                               |
|                               |
|                               |
|                               |
+-------------------------------+
If I enter a mail to the MailBox and a message to the MessageBox and click on send, i need to append the mail and messagebox to the txt file.

And the same problem with the reading. I check every 2 seconds if there are new lines in the MsnToWow.txt file. If there are some i need to read it and add the messages to the messagelist. (The timer compares the GetTime() Value on the OnUpdate event).

I know that the lua io functions are not supported. But would it be possible to write any library which calls native methods out of an dll file(win) / executable(linux). I'm really new to programming Lua and Wow addons but I have a lot of programming experience. But there must be some kind of log-functions which allow to write text files.

Please excuse my bad english but I'm not a native speaker

Greets Daniel
  Reply With Quote
10-01-07, 04:56 PM   #2
Dreadlorde
A Pyroguard Emberseer
 
Dreadlorde's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 2,302
WoW can't communicate with third party programs.
__________________

Funtoo - Plan 9 - Windows 7
  Reply With Quote
10-01-07, 05:42 PM   #3
Polarina
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Aug 2007
Posts: 63
You can use the Lua function time() and change the system time using an external program and make the AddOn read the time all the time.
  Reply With Quote
10-01-07, 05:44 PM   #4
Mazzlefizz
A Pyroguard Emberseer
 
Mazzlefizz's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 3,521
I don't think there's a way to do that without performing some sort of memory inspection, which is obviously against the TOS. For a while, people were able to write add-ons that communicated to mp3 players and other third party apps by using the config file as an intermediary, but Blizzard eventually made that delayed as well.
__________________
MazzleUI Home Page: Mazzlefizz.WoWInterface.com
Info, FAQs, Forums, Download can be found at that link.
  Reply With Quote
10-01-07, 05:46 PM   #5
Mazzlefizz
A Pyroguard Emberseer
 
Mazzlefizz's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 3,521
Originally Posted by Polarina
You can use the Lua function time() and change the system time using an external program and make the AddOn read the time all the time.
Ooooh, tricky.
__________________
MazzleUI Home Page: Mazzlefizz.WoWInterface.com
Info, FAQs, Forums, Download can be found at that link.
  Reply With Quote
10-01-07, 06:28 PM   #6
Kaomie
A Scalebane Royal Guard
 
Kaomie's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 438
Originally Posted by Mazzlefizz
Ooooh, tricky.
And now on Blizzard secure list for next patch
__________________
Kaomie
"WE LOTS OF PEOPLE FROM STRONG SERVER GUILDS" - Trade Channel
  Reply With Quote
10-02-07, 01:54 AM   #7
danielku15
A Defias Bandit
Join Date: Oct 2007
Posts: 2
Got another idea:
http://www.wowwiki.com/HOWTO:_Save_V..._Game_Sessions

I could create a table with the messages. A table for WowToMsn and a table to MsnToWow. And if I send a message. I could add a table entry. Then Read it through another application. The only question is: How are the Variables saved? Are they beeing written into a lua file?
  Reply With Quote
10-02-07, 02:17 AM   #8
Jazradel
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 39
They are written into a lua file everytime you reload the ui.
__________________
  Reply With Quote
10-02-07, 10:07 AM   #9
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Lol, yeah - you'd have to log in/out or reload your UI everytime you wanted to read a new message or send one.
__________________
"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-02-07, 01:33 PM   #10
dafire
Premium Member
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 216
the problem is that blizzard don't want the client with other applications.. since that would be used to write better bot programs.
  Reply With Quote
10-02-07, 01:47 PM   #11
jonathon
A Chromatic Dragonspawn
 
jonathon's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 179
an idea that would get you around the whole wow can't communicate would be to make the msn messenger window always be on top of other windows no matter what. then run wow in windowed mode, but maximised.
  Reply With Quote
10-02-07, 01:53 PM   #12
Dreadlorde
A Pyroguard Emberseer
 
Dreadlorde's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 2,302
You could just use xfire, or make msn/yahoo/aim always on top of other windows.
__________________

Funtoo - Plan 9 - Windows 7
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » I/O Write / Read Textfiles


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