Hi everyone. Recently I needed a project, and I thought I'd share the result with the FFXI community. I run the website for Orion's Door, an endgame linkshell on Odin. The site has a chat function for people that are logged on, and I figured there had to be a way to link that chatbox to the in-game linkshell chat.
So I wrote a program I call Chatlink. It takes advantage of Windower's Logger plugin to extract lines from linkshell conversations and post them to the website so they can be shown in the chatbox. This is nothing new, I know. The real trick was getting messages posted in the chatbox to show up in-game. Here's a couple screenshots demonstrating how it looks:
http://orionsdoor.com/forums/files/chatbox_side_425.jpg
http://orionsdoor.com/forums/files/ingame_side_604.jpg
Before anyone asks, no, I'm not going to post the code. That would present a security risk to our website as well as our LS conversation. I will, however, go over my program design so the more technically inclined among you might be able to create your own version.
There are four threads and two queues in my program. The threads are:
1. Website to PC
2. PC to FFXI
3. FFXI to PC
4. PC to Website
Each thread simply does exactly that. The Website to PC thread grabs stuff from the chatbox and puts the relevant strings in a queue. The PC to FFXI thread pops the strings off the queue and pushes them to the game. The other direction follows the same structure. But the big question is, what is an easy way to inject text into the game?
It's actually remarkably simple. There are two scripts: chatlink.script and chattext.script. Chatlink.script looks like this:
pause 2;
exec chattext.script;
exec chatlink.script;
In effect, it executes chattext.script and then loops every two seconds, forever. The key thread, PC to FFXI, simply updates chattext.script with the necessary "input /l <text goes here>" line every two seconds, then writes out a blank file when it's not in use.
If anyone has questions about the design, I'd be happy to point you in the right direction. Keep in mind you'll need a secondary FFXI account and a PC that can host it 24/7, so this definitely isn't for everyone. But I'll admit, accessing linkshell chat over http while I'm at work, or anywhere else on my iPhone is pretty damn fun.
Cheers!