Jump to content

DLL Call


Recommended Posts

  • Moderators

why did you post THREE!!!!! times???

that is a sure fired way to get a bunch of smart ass answers instead of useful answers.

I'm quite sure he didn't intend to post it 3 times, if you look at the times of posts, they were really close together which means he probably had a lag in posting.

@OP, I deleted the other two.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • 2 weeks later...

i get a value of "0"

Try this:

$dll = DllOpen("FFACE.dll")
$result = DllCall($dll, "int", "GetPlayerHPMax", "int", 0, "int", 0)
msgbox(0, "", $result[0])  ; number of chars returned
DllClose($dll)

But i am not sure, i can not test it, also because i don't have FFACE.dll.

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

I tried it but the code you provided just stalled and closed. Then i tried it with int:cdecl and it still came back as "0"

I read used PE Explore on the dll and found that it entry point is "10002DF0h" and the index is "105" can i use this information?

Edited by onestcoder

Need a website: http://www.iconixmarketing.com

Link to comment
Share on other sites

i get a value of "0" when i should get "782"

I am assuming it has to do with this http://calamity-ls.com/wiki/index.php/Main_Page DLL/project.

As I have no active FFXI subscription at the moment, I cannot fully test it, but try this.

$dll = DllOpen("FFACE.dll")

$running = DllCall($dll, "int", "InitFFACE") ;Initialize the DLL. Will return false if FFXI isnt running.
if @error = 0 Then ; Check for errors
    if $running[0] Then ;Check to see if FFXI is running.
        $result = DllCall($dll, "int", "GetPlayerHPMax") ;If it is, lets call our function.
        if @error= 0 Then 
            MsgBox(0, "", $result[0])  ;Display our Max HP
        EndIf
    Else
        MsgBox(0, "Couldnt Find FFXI", "FFXI Is NOT Running")  ; FFXI wasnt running, lets inform ourselves :)
    EndIf
Else
    MsgBox(0, "Some Error Occured", "@error = " + @error) ; An error occured, lets display the error number.
EndIf

DllClose($dll)
Edited by Insomniac
Link to comment
Share on other sites

I am assuming it has to do with this http://calamity-ls.com/wiki/index.php/Main_Page DLL/project.

As I have no active FFXI subscription at the moment, I cannot fully test it, but try this.

$dll = DllOpen("FFACE.dll")

$running = DllCall($dll, "int", "InitFFACE") ;Initialize the DLL. Will return false if FFXI isnt running.
if @error = 0 Then ; Check for errors
    if $running[0] Then ;Check to see if FFXI is running.
        $result = DllCall($dll, "int", "GetPlayerHPMax") ;If it is, lets call our function.
        if @error= 0 Then 
            MsgBox(0, "", $result[0])  ;Display our Max HP
        EndIf
    Else
        MsgBox(0, "Couldnt Find FFXI", "FFXI Is NOT Running")  ; FFXI wasnt running, lets inform ourselves :)
    EndIf
Else
    MsgBox(0, "Some Error Occured", "@error = " + @error) ; An error occured, lets display the error number.
EndIf

DllClose($dll)

I gave this a try and I didnt get an error, but it still returns a "0" :)

Need a website: http://www.iconixmarketing.com

Link to comment
Share on other sites

:P

Damn, now I gotta reactivate my FFXI account, just to try and fix this..... :)

the VB.net code looks like this: i dont know it this helps.

Public Declare Ansi Function HPMax Lib "FFACE.dll" Alias "GetPlayerHPMax" () As Integer

-

Edited by onestcoder

Need a website: http://www.iconixmarketing.com

Link to comment
Share on other sites

after a few hours of patching FFXI I finally got up and running.

Ran my version of the script once, and it output the expected number (108 I think it was, yes my char is a noob^^)

One last thing to check: Did you make sure you got the latest version of the DLL and that you were actually logged in to the game properly?

Link to comment
Share on other sites

after a few hours of patching FFXI I finally got up and running.

Ran my version of the script once, and it output the expected number (108 I think it was, yes my char is a noob^^)

One last thing to check: Did you make sure you got the latest version of the DLL and that you were actually logged in to the game properly?

I have the right version of the dll, but I use Windower Version 3.3 to log into FFXI. I was fully logged in. How did you log in?

Need a website: http://www.iconixmarketing.com

Link to comment
Share on other sites

the "normal" way, through POL

I got it working Wooot!! Thank You Insomniac.

HAve you had a chance to look at the GetTarGetName function.

Is there away to get the text back? I don't understand the buffer ref int size...

[DllImport("FFACE.dll", EntryPoint = "GetTargetName")]
public static extern void sName(byte[] buffer, ref int size);
 
public static string Name()
{
    int s = 20;
    byte[] b = new byte[21];
    sName(b, ref s);
    return System.Text.Encoding.ASCII.GetString(b, 0, s - 1);
}

-

Need a website: http://www.iconixmarketing.com

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...