Jump to content
Sign in to follow this  
Tommy_ti

Help With Ini Read

Recommended Posts

Tommy_ti

Hi, i want my AutoIt program to read a INI file and then use it elsewhere.

Like, i play Diablo 2, and want it to auto login to my account and make a game.

Then i put in my INI file:

; Set the Diablo 2 dir to the dir you installed Diablo 2 on.
; Set the Diablo 2 exe to the correct location.

[DIABLO2]
Diablo2Dir=c:\Program Files\Diablo II
Diablo2Exe=c:\Program Files\Diablo II\Diablo II.exe

[SETTINGS]
Account=YOUR_ACCOUNT_HERE
Password=YOUR_PASS_HERE

[MAKEGAME]
Gamename=GAME_NAME_TO_MAKE

But i dont know how to get the AutoIt file to use it.

Please help me here :whistle:

Thx

Edited by Tommy_ti

Share this post


Link to post
Share on other sites
Tommy_ti

Thx B)

But how can i get the AutoIt EXE to find the location of the INI? :angry:

That was the question i was going to ask, but i forgot, hehe :whistle:


Share this post


Link to post
Share on other sites
EniamaJ

I think you need the INI in the same directory as the EXE its needed for if thats what you are asking.


[font="Courier"]Dont do things bass ackwards?[/font]

Share this post


Link to post
Share on other sites
Tommy_ti

Hmm, need some more help plz.

This is my AutoIt EXE file how it is for now:

$answer = MsgBox(4, "Diablo 2", "Do you want to run Diablo 2 with this program?")

If $answer = 7 Then
    MsgBox(0, "Diablo 2", "Diablo 2 did not run")
    Exit
EndIf

If $answer = 6 Then
    MsgBox(0, "Diablo 2", "Diablo 2 loading. Click OK to start.")
EndIf

$Diablo2Exe = IniRead("Config.ini","GLOBAL","Diablo2Exe", "ERROR")

Run($Diablo2Exe, "", @SW_MAXIMIZE)

And this is my INI file:

; Set the Diablo 2 exe to the correct location.

[GLOBAL]
Diablo2Exe=c:\Programfiler\Diablo II\Diablo II.exe
D2Parameters=-skiptobnet -w -ns -lq -res800 -title "Diablo II" -nonotify

[SETTINGS]
Account=YOUR_ACCOUNT_HERE
Password=YOUR_PASS_HERE

[IN-GAME]
Gamename=GAME_NAME_TO_MAKE

HOW do i make Diablo 2 start with the D2Parameters?

I cant figure it out!

I have enother script i downloaded, it have than function, but i can't read it since it's compiled. :whistle:


Share this post


Link to post
Share on other sites
ezzetabi

$answer = MsgBox(4, "Diablo 2", "Do you want to run Diablo 2 with this program?")

If $answer = 7 Then
   MsgBox(0, "Diablo 2", "Diablo 2 did not run")
   Exit
EndIf

If $answer = 6 Then
   MsgBox(0, "Diablo 2", "Diablo 2 loading. Click OK to start.")
EndIf

$Diablo2 = IniRead("Config.ini","GLOBAL","Diablo2Exe", "ERROR")
$Diablo2Exe = IniRead("Config.ini","GLOBAL","D2Parameters", "ERROR")

$Diablo2Exe = $Diablo2 & " " & $Diablo2Exe

Run($Diablo2Exe, "", @SW_MAXIMIZE)

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.