onestcoder Posted December 21, 2007 Posted December 21, 2007 How can i do a dll call in autoit like this example from C# C# [DllImport("FFACE.dll", EntryPoint = "GetSpellRecast")] public static extern short SpellRecast(eSpellList index); Need a website: http://www.iconixmarketing.com
DW1 Posted December 21, 2007 Posted December 21, 2007 why did you post THREE!!!!! times??? that is a sure fired way to get a bunch of smart ass answers instead of useful answers. AutoIt3 Online Help
Moderators SmOke_N Posted December 21, 2007 Moderators Posted December 21, 2007 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.
onestcoder Posted December 21, 2007 Author Posted December 21, 2007 how about DllCall()? My dsl was acting up and I didnt know is posted until it was to late Need a website: http://www.iconixmarketing.com
DW1 Posted December 21, 2007 Posted December 21, 2007 My dsl was acting up and I didnt know is posted until it was to lateDon't mind me, I'm just an ass...Every now and then, we get somebody double posting, thinking, somehow this will get them an answer quicker.Since you were not doing that, I am sorry for jumping to conclusions AutoIt3 Online Help
timgames Posted December 23, 2007 Posted December 23, 2007 (edited) *snip* already found it sorry Edited December 23, 2007 by timgames
onestcoder Posted January 7, 2008 Author Posted January 7, 2008 i get a value of "0" when i should get "782" $dll = DllOpen("FFACE.dll") $result = DllCall($dll, "int", "GetPlayerHPMax") msgbox(0, "", $result[0]) ; number of chars returned DllClose($dll) Need a website: http://www.iconixmarketing.com
MrCreatoR Posted January 7, 2008 Posted January 7, 2008 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 Russian Community My Work... Spoiler Projects: 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 ProgramUDFs: 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 Examples: 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 ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team
onestcoder Posted January 7, 2008 Author Posted January 7, 2008 (edited) 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 January 7, 2008 by onestcoder Need a website: http://www.iconixmarketing.com
Insomniac Posted January 7, 2008 Posted January 7, 2008 (edited) 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 January 7, 2008 by Insomniac
onestcoder Posted January 7, 2008 Author Posted January 7, 2008 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
Insomniac Posted January 7, 2008 Posted January 7, 2008 I gave this a try and I didnt get an error, but it still returns a "0" Damn, now I gotta reactivate my FFXI account, just to try and fix this.....
onestcoder Posted January 7, 2008 Author Posted January 7, 2008 (edited) 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 January 7, 2008 by onestcoder Need a website: http://www.iconixmarketing.com
Insomniac Posted January 7, 2008 Posted January 7, 2008 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?
onestcoder Posted January 7, 2008 Author Posted January 7, 2008 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
Insomniac Posted January 8, 2008 Posted January 8, 2008 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?the "normal" way, through POL
onestcoder Posted January 8, 2008 Author Posted January 8, 2008 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
onestcoder Posted January 9, 2008 Author Posted January 9, 2008 IS this were the DllCallbackRegister is used? Need a website: http://www.iconixmarketing.com
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now