Help - Search - Members - Calendar
Full Version: Advice needed
AC Tools Everything Macro > General Discussion > C++/Delphi/VB Development
daiiawn
Hiya, please bear with me a little cos ive been out of programming gor a year or so.

i could do with some advice (in as basic terms as possible).

What i want to have is a very simple vb.net app, with a single button on it, that when pressed sends a set key (8 on the num pad for example) to ffxi sothat the game responds as if that key was actually pressed.

I can make the ui etc, but interfacing with ffxi i am lost with. from everything i have read i gather windowhelper.dll will assist with this, but i havent a clue how to do this. I am currently using MSVB 2005 express edition as my ide.



in time i plan on making a couple of ffxi programs, but without being able to interface with ffxi i may struggle tongue.gif. Ultimately i will also want to get info from ffxi to my program (such as hp, tp, mob hp etc) so any advice on that would be great (although not neceserry atm.

Cheers
Pyrolol
Take a look at the program DTACT. The source is literally in the next thread down, and it includes everything you could want. I'm not sure exactly what DrewLTs policy on people borrowing code snippets is though, so you might wanna ask him.
drewlt
I'm cool with whatever - I'd just ask not to release a program with the same name as I have.

Sending keys to ffxi is trickier than you think. You can simulate keys in windows just fine, but the minute you want to send it to a window that is not in focus, it gets harder. FFXI's directx does not use windows messages (so you can't just send a keystroke message to the window). You'll need to hook directinput (windower does this) which is just outside of my knowledge (for now smile.gif ).

gl, I'll help wherever I can.

smile.gif -DT
daiiawn
for the forseable future this is a personal poject so not planning on a public release anytime soon.

i am now at the stage where the communication from my app to ffxi is working as i want, so tomorrow am going to start looking at reading info from ffxi to my app

(initially i want to read any /tell /linkshell /party messages i recieve in ffxi through to my software, then will play about with other things, possible creating a fishing bot)
Pyrolol
Have a look at these offsets. They're not precise, but the information you need (well...the pointer) should be close to them.

ActionsChatLog=0x121CC7
ChatLog=0x011F3F3
TimeLog=0x1210E7

All the code for using them is in DTACT as well tbh xD.
daiiawn
looking through the things that seem to be relevant in the dact code are the following functions in App_Class

GetBaseAddress()

ReadMemory(ByVal address As Integer, ByVal offset As Integer, ByVal DataType As MemDataType, Optional ByVal bytes As Integer = 1)

i have read on these forums that address = Base + Offset

so for chat log would i be looking at using the ReadMemory Function with the following values?

for address - use a Integer value got by adding Base + 0x011F3F3
for offset - use 0x011F3F3
DataType - eString (if i wanted the object returned to be a string?)

what does the optional value bytes determine? is in the number of bites it will read in?


lol sorry if im miles from the mark here, i havent slept well and am feeling a tad delicate
daiiawn
heres a question, its something i had to deal with years ago in my java days and now need to work around again.

i have written the followin basic class to handle spell casting in ffxi,

CODE
Public Class Caster
   Public Sub Cast(ByVal spell As String, ByVal wh As Windower_Helper_Class)
       If spell = "Warp" Then
           wh.SendText("/p Casting " + spell + " on <me> -- Mp at ======> <mpp>")
           wh.SendText("/ma " + spell + " <me>")
       Else
           wh.SendText("/p Casting " + spell + " on <t> -- Mp at ======> <mpp>")
           wh.SendText("/ma " + spell)
       End If

   End Sub
End Class


as yo can see, as well as having a windower object passed to it, it also has thespell (eg Warp or Cure), my question is, how can i send the symbol " to ffxi using the SendText method for things like "Cure II"(i cant just type
CODE
wh.SendText("/p Casting "Cure II" on <t> -- Mp at ======> <mpp>")
because the "s take Cure II out of the string it passes to SendText)


The only way i can think of would be to have " set as a char and then having
CODE
wh.SendText("/p Casting " + char + " Cure II " + char + " on <t> -- Mp at ======> <mpp>")



but i am not entirely sure if this will work (i seem to remember going in circles doing it in java as a youngster)
Ipa
So, you want to embed the double-quote character (ascii 34) inside the string ?

In VB.Net, you do that by simply doubling up the double-quote:

CODE
Dim Test As String = "Hi, I'm a string with an embedded "" double quote"


CODE
wh.SendText("/p Casting """ + spell + """ on <t> -- Mp at ======> <mpp>")
DaMOB
"""

That is weird to me because I am used to \" using the \ as an escape trigger. *shrug*
Pyrolol
The way I do this is by simply adding Chr(34) into the string. I've never tried the "" method, but if Ipa says it works, it probably does :-P.

Ipa
Different languages "escape" special characters differently. The "" in VB.Net is no different than trying to specify a Windows file path containing a backslash in C++ or C#, where you have to escape the backslash escape character by typing it twice as in string path = "C:\\SomeFolder".

It is usually better in terms of efficiency to find the correct escape sequence than append ascii characters - appending a character or string may force a complete copy of the string to be made in memory unless done in the context of the StringBuilder class.
DaMOB
QUOTE (Pyrolol @ Jul 14 2006, 11:23 AM)
The way I do this is by simply adding Chr(34) into the string. I've never tried the "" method, but if Ipa says it works, it probably does :-P.

Ahem, I never questioned him I simply made a statement.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.