Jump to content
Sign in to follow this  
Valuater

Humpers 1st GUI

Recommended Posts

Valuater

Please use the forums, so others can help too.

This should get you started... create all the inputs you need first

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("TrayMenuMode", 1)
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Diablo settings", 387, 414, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS, $DS_CONTEXTHELP))
GUISetCursor(14)
GUISetBkColor(0xA6CAF0)
$Diablo_Path = GUICtrlCreateInput("Diablo_Path", 48, 40, 297, 21)
$Browse = GUICtrlCreateButton("Find File", 280, 16, 70, 20)
$Write = GUICtrlCreateLabel("Write your diablo path (including diablo.exe)", 48, 16, 209, 17)
GUICtrlSetCursor(-1, 14)
$Button1 = GUICtrlCreateButton("Continue", 144, 372, 121, 17, 0)
GUICtrlSetCursor(-1, 4)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

        Case $GUI_EVENT_CLOSE
            Exit

        Case $Browse
            $find_loc = FileOpenDialog("Find Diablo_Path", @ProgramFilesDir, "EXE (*.exe)")
            GUICtrlSetData($Diablo_Path, $find_loc)

        Case $Button1
            ; Guictrlread(All of the Inputs) ; one at a time
            ; iniwrite() the info you just read
            ; GUIDELETE($Form2)
            ; exit the loop and run the main GUI

    EndSwitch
WEnd

After trying, Please ask questions on where you get stuck. You did that so far and that is why I will help

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites
Humper

Hmm, howcome it doesn't work to use that script then make changes and then save it or run it?

Does it work to edit it when it is a autoit file?

I can view it but It doesn't work when I try it after I edited again.


[center][/center]

Share this post


Link to post
Share on other sites
Valuater

Do you have the latest "customized" SciTe Editor?

if not get it here...

http://www.autoitscript.com/autoit3/downloads.shtml

after installing, Press "Tools" ( at the top) then "SyntaxCheck Prod"

This will check the script for errors

a trick.... if you see a red error line in the lower window, click on it and the upper window will go stright to the problem

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Humper

Do you have the latest "customized" SciTe Editor?

if not get it here...

http://www.autoitscript.com/autoit3/downloads.shtml

after installing, Press "Tools" ( at the top) then "SyntaxCheck Prod"

This will check the script for errors

a trick.... if you see a red error line in the lower window, click on it and the upper window will go stright to the problem

8)

Yes, I use that.

But the this is that, it doesn't even work to just:

- Import script to koda

- Convert to autoit

That doesn't even work.

Okey back to coding only for a moment for me.

But I got some problem there also.

Case $Button1
            GUICtrlRead ( $Diablo_Path )
            iniwrite ( "Settings.ini", "Path", "Diablo II path", "value??" )
        ; Guictrlread(All of the Inputs); one at a time
        ; iniwrite() the info you just read
        ; GUIDELETE($Form2)
        ; exit the loop and run the main GUI

What value should I put in, GuiCtrlRead?

How do I fix the "" before and after the path when writing?

Or should I put the "" in the run script instead?

Regards,

Humper

Edited by Humper

[center][/center]

Share this post


Link to post
Share on other sites
Valuater

look at what is right in front of you

Case $Browse

$find_loc = FileOpenDialog("Find Diablo_Path", @ProgramFilesDir, "EXE (*.exe)")

GUICtrlSetData($Diablo_Path, $find_loc)

..... so

$info = GUICtrlRead ( $Diablo_Path )

iniwrite ( "Settings.ini", "Path", "Diablo II path", $info )

How do I fix the "" before and after the path when writing?

good thought, don't worry about that

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites
martin

Yes, I use that.

But the this is that, it doesn't even work to just:

- Import script to koda

- Convert to autoit

That doesn't even work.

You need to give more information to get help with that.

You read the text of an input with GuiCtrlRead as you know, but you must use the returned text somehow.

Eg

$NewPath = GuiCtrlRead( $Diablo_Path )
iniwrite ( "Settings.ini", "Path", "Diablo II path", $NewPath )

or

iniwrite ( "Settings.ini", "Path", "Diablo II path",GuiCtrlRead( $Diablo_Path ) )

If you have a lot of inputs then I would recommend using an array, then reading them all is much simpler. Creating them can be simpler as well.

Eg

Global $aInput[5], $aData[5]
Local $n

;create the inputs
For $n = 0 to 4
     $aInput[$n] =  GUICtrlCreateInput("", 48, 40 * 30*$n, 297, 21)
Next
.
.
.
;Read the inputs
For $n = 0 to 4
  $aData[$n] = GuiCtrlRead($aInput[$n]
next

I'm not sure what you mean about the inverted commas.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
Humper

Great, first version didn't work but second did when I added a space you forgot.

@ the 3th, I don't really want to use that one because I don't understand it and then i don't really learn anything.

I'm not sure what you mean about the inverted commas.

Oh, I thought I needed to use ".exe" but i could use it without the ".

You need to give more information to get help with that.

Okey look, here is the code I inport:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("TrayMenuMode", 1)
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Diablo settings", 387, 414, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS, $DS_CONTEXTHELP))
GUISetCursor(14)
GUISetBkColor(0xA6CAF0)
$Diablo_Path = GUICtrlCreateInput("Diablo_Path", 48, 40, 297, 21)
$Browse = GUICtrlCreateButton("Find File", 280, 16, 70, 20)
$Write = GUICtrlCreateLabel("Write your diablo path (including diablo.exe)", 48, 16, 209, 17)
GUICtrlSetCursor(-1, 14)
$Button1 = GUICtrlCreateButton("Continue", 144, 372, 121, 17, 0)
GUICtrlSetCursor(-1, 4)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

        Case $GUI_EVENT_CLOSE
            Exit

        Case $Browse
            $find_loc = FileOpenDialog("Find Diablo_Path", @ProgramFilesDir, "EXE (Diablo II.exe)")
            GUICtrlSetData($Diablo_Path, $find_loc)

        Case $Button1
            GUICtrlRead ( $Diablo_Path )
            iniwrite ( "Settings.ini", "Path", "Diablo II path", GuiCtrlRead( $Diablo_Path ) )
        ; Guictrlread(All of the Inputs); one at a time
        ; iniwrite() the info you just read
        ; GUIDELETE($Form2)
        ; exit the loop and run the main GUI

    EndSwitch
WEnd

Here is the code I get when I press convert at koda:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Diablo settings", 364, 388, 299, 244)
GUISetCursor (14)
GUISetBkColor(0xA6CAF0)
$Diablo_Path = GUICtrlCreateInput("Diablo_Path", 48, 40, 297, 21)
$Browse = GUICtrlCreateButton("Find File", 280, 16, 70, 20, 0)
$Write = GUICtrlCreateLabel("Write your diablo", 48, 16, 209, 17)
GUICtrlSetCursor (-1, 14)
$Button1 = GUICtrlCreateButton("Continue", 144, 372, 121, 17)
GUICtrlSetCursor (-1, 4)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

I pressed nothing else then import and then convert it back.

Now when I understand how I do it manual I could do it that way also but it would be good if I could use the koda designer.

EDIT:

Okey I got the code partly working.

But when I press "find file" button it stops working.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("TrayMenuMode", 1)
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Diablo settings", 387, 294, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS, $DS_CONTEXTHELP))
GUISetCursor(14)
GUISetBkColor(0xA6CAF0)
$Diablo_Path = GUICtrlCreateInput("Diablo_Path", 48, 40, 297, 21)
$Account = GUICtrlCreateInput("Diablo_Account", 48, 96, 297, 21)
$Password = GUICtrlCreateInput("Diablo_Password", 48, 152, 297, 21)
$Nr_Characters = GUICtrlCreateInput("Nr_Characters", 48, 208, 297, 21)
$Browse = GUICtrlCreateButton("Find File", 280, 14, 70, 20)
$Write = GUICtrlCreateLabel("Write your diablo path (including diablo.exe):", 48, 16, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("Write accountname:", 48, 72, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("Write password:", 48, 128, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("Number of characters:", 48, 184, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("All information will only be stored local.", 104, 275, 209, 17)
GUICtrlSetCursor(-1, 14)
$Button1 = GUICtrlCreateButton("Continue", 134, 252, 121, 17, 0)
GUICtrlSetCursor(-1, 4)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

        Case $GUI_EVENT_CLOSE
            Exit

        Case $Browse
            $find_loc = FileOpenDialog("Find Diablo_Path", @ProgramFilesDir, "EXE (Diablo II.exe)")
            GUICtrlSetData($Diablo_Path, $find_loc)

        Case $Button1
            GUICtrlRead ( $Diablo_Path )
            iniwrite ( "Settings.ini", "Path", "Diablo II path", GuiCtrlRead( $Diablo_Path ) )
            GUICtrlRead ( $Account )
            iniwrite ( "Settings.ini", "Account", "Account", GuiCtrlRead( $Account ) )
            GUICtrlRead ( $Diablo_Path )
            iniwrite ( "Settings.ini", "Account", "Password", GuiCtrlRead( $Password ) )
            GUICtrlRead ( $Diablo_Path )
            iniwrite ( "Settings.ini", "Account", "Nr_Characters", GuiCtrlRead( $Nr_Characters ) )          
         ; Guictrlread(All of the Inputs); one at a time
         ; iniwrite() the info you just read
         ; GUIDELETE($Form2)
         ; exit the loop and run the main GUI

    EndSwitch
WEnd

I know whats wrong but not how to fix it.

Because when I press on the find file, it stops there and would need to go back to almost the beginning of the code or somthing.

Edited by Humper

[center][/center]

Share this post


Link to post
Share on other sites
Valuater

you changed this, it was like this...

$find_loc = FileOpenDialog("Find Diablo_Path", @ProgramFilesDir, "EXE (*.exe)")

... that works for me

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Humper

Doesn't seem to work for me somehow.

I might could just remove the button to prevent this.

If no one knows whats wrong.


[center][/center]

Share this post


Link to post
Share on other sites
Valuater

It works for me!

I can't fix it if it works!!!...???

EDIT: Maybe the File Dialog Box opens in the background?.. minimize everything to test

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites
GEOSoft

Do it the way @Valuater showed you and Error check it

Case $Browse
            $find_loc = FileOpenDialog("Find Diablo_Path", @ProgramFilesDir, "EXE files (*.exe)", 3)
            If NOT @Error Then GUICtrlSetData($Diablo_Path, $find_loc)

Edit:

If Diablo II.exe is actually the name of the Exe file then that goes into the default name parameter so it will be like this

Case $Browse
    $find_loc = FileOpenDialog("Find Diablo_Path", @ProgramFilesDir, "EXE files (*.exe)", 3, "Diablo II.exe")
    If NOT @Error Then GUICtrlSetData($Diablo_Path, $find_loc)
Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
Humper

Could be my computer bugging but it happens like this:

Working method:

Without pressing on "findfile" and instead writing it in manual.

And then pressing continue it works great, it creates the .ini and

write and then closes.

Not working method:

Pressing "findfile" and finding diablo.exe then press okey.

It comes up in the writingbar.

But when I press continue it just closes without creating or editing the .ini file.

Regards,

Humper


[center][/center]

Share this post


Link to post
Share on other sites
Valuater

Please post the code you have now

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Humper

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("TrayMenuMode", 1)
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Diablo settings", 387, 294, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS, $DS_CONTEXTHELP))
GUISetCursor(14)
GUISetBkColor(0xA6CAF0)
$Diablo_Path = GUICtrlCreateInput("Diablo_Path", 48, 40, 297, 21)
$Account = GUICtrlCreateInput("Diablo_Account", 48, 96, 297, 21)
$Password = GUICtrlCreateInput("Diablo_Password", 48, 152, 297, 21)
$Nr_Characters = GUICtrlCreateInput("Nr_Characters", 48, 208, 297, 21)
$Browse = GUICtrlCreateButton("Find File", 280, 14, 70, 20)
$Write = GUICtrlCreateLabel("Write your diablo path (including diablo.exe):", 48, 16, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("Write accountname:", 48, 72, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("Write password:", 48, 128, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("Number of characters:", 48, 184, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("All information will only be stored local.", 104, 275, 209, 17)
GUICtrlSetCursor(-1, 14)
$Button1 = GUICtrlCreateButton("Continue", 134, 252, 121, 17, 0)
GUICtrlSetCursor(-1, 4)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

        Case $GUI_EVENT_CLOSE
            Exit

        Case $Browse
        $find_loc = FileOpenDialog("Find Diablo_Path", @ProgramFilesDir, "EXE files (*.exe)", 3)
        If NOT @Error Then GUICtrlSetData($Diablo_Path, $find_loc)

        Case $Button1
            iniwrite ( "Settings.ini", "Path", "Diablo II path", GuiCtrlRead( $Diablo_Path ) )
            iniwrite ( "Settings.ini", "Account", "Account", GuiCtrlRead( $Account ) )
            iniwrite ( "Settings.ini", "Account", "Password", GuiCtrlRead( $Password ) )
            iniwrite ( "Settings.ini", "Account", "Nr_Characters", GuiCtrlRead( $Nr_Characters ) )
            GUIDelete ($Form2)
            ExitLoop
           ; Guictrlread(All of the Inputs); one at a time
           ; iniwrite() the info you just read
           ; GUIDELETE($Form2)
           ; exit the loop and run the main GUI

    EndSwitch
WEnd


[center][/center]

Share this post


Link to post
Share on other sites
Valuater

I made a small adjustment for the Path..

But, I can't get this to error

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("TrayMenuMode", 1)

Global $Ini_Path = @ScriptDir & "\Settings.ini"

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Diablo settings", 387, 294, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS, $DS_CONTEXTHELP))
GUISetCursor(14)
GUISetBkColor(0xA6CAF0)
$Diablo_Path = GUICtrlCreateInput("Diablo_Path", 48, 40, 297, 21)
$Account = GUICtrlCreateInput("Diablo_Account", 48, 96, 297, 21)
$Password = GUICtrlCreateInput("Diablo_Password", 48, 152, 297, 21)
$Nr_Characters = GUICtrlCreateInput("Nr_Characters", 48, 208, 297, 21)
$Browse = GUICtrlCreateButton("Find File", 280, 14, 70, 20)
$Write = GUICtrlCreateLabel("Write your diablo path (including diablo.exe):", 48, 16, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("Write accountname:", 48, 72, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("Write password:", 48, 128, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("Number of characters:", 48, 184, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("All information will only be stored local.", 104, 275, 209, 17)
GUICtrlSetCursor(-1, 14)
$Button1 = GUICtrlCreateButton("Continue", 134, 252, 121, 17, 0)
GUICtrlSetCursor(-1, 4)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

        Case $GUI_EVENT_CLOSE
            Exit

        Case $Browse
            $find_loc = FileOpenDialog("Find Diablo_Path", @ProgramFilesDir, "EXE files (*.exe)", 3)
            If Not @error Then GUICtrlSetData($Diablo_Path, $find_loc)

        Case $Button1
            IniWrite($Ini_Path, "Path", "Diablo II path", GUICtrlRead($Diablo_Path))
            IniWrite($Ini_Path, "Account", "Account", GUICtrlRead($Account))
            IniWrite($Ini_Path, "Account", "Password", GUICtrlRead($Password))
            IniWrite($Ini_Path, "Account", "Nr_Characters", GUICtrlRead($Nr_Characters))
            GUIDelete($Form2)
            ExitLoop
            ; Guictrlread(All of the Inputs); one at a time
            ; iniwrite() the info you just read
            ; GUIDELETE($Form2)
            ; exit the loop and run the main GUI

    EndSwitch
WEnd

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Humper

Thanks, works great.

Could you explain what the command "global" does?

And what really changed in the script you made.

Now you specify more clairly where settings.ini should be written.

I would like some minor more changes tho.

When enter key is pressed then it should have the same effect as pressing the continue button.

Edited by Humper

[center][/center]

Share this post


Link to post
Share on other sites
GEOSoft

Thanks, works great.

Could you explain what the command "global" does?

And what really changed in the script you made.

Now you specify more clairly where settings.ini should be written.

I would like some minor more changes tho.

When enter key is pressed then it should have the same effect as pressing the continue button.

Global/Local/Dim

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
Valuater

See GUICtrlSetState() in Help for the button

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Humper

Here is the complite script.

Works great, I will advance it later when I got more time and

make it based on connection instead of time.

;Pre info
$argument = " -w -nohide -ns"
$Account = IniRead("Settings.ini", "Account", "Account", "Default")
$Password = IniRead("Settings.ini", "Account", "Password", "Default")
$Nr_Characters = IniRead("Settings.ini", "Account", "Nr_Characters", "Default")
$Path = IniRead("Settings.ini", "Path", "Diablo II path", "Default")

If FileExists ( "settings.ini" ) Then
    Diablo ()
Else 
;SCRIPT GUI, CREATE INI 
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("TrayMenuMode", 1)

Global $Ini_Path = @ScriptDir & "\Settings.ini"

#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Diablo settings", 387, 294, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_SYSMENU, $WS_CAPTION, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS, $DS_CONTEXTHELP))
GUISetCursor(14)
GUISetBkColor(0xA6CAF0)
$Diablo_Path = GUICtrlCreateInput("Diablo_Path", 48, 40, 297, 21)
$Account = GUICtrlCreateInput("Diablo_Account", 48, 96, 297, 21)
$Password = GUICtrlCreateInput("Diablo_Password", 48, 152, 297, 21)
$Nr_Characters = GUICtrlCreateInput("Nr_Characters", 48, 208, 297, 21)
$Browse = GUICtrlCreateButton("Find File", 280, 14, 70, 20)
$Write = GUICtrlCreateLabel("Write your diablo path (including diablo.exe):", 48, 16, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("Write accountname:", 48, 72, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("Write password:", 48, 128, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("Number of characters:", 48, 184, 209, 17)
GUICtrlSetCursor(-1, 14)
$Write = GUICtrlCreateLabel("All information will only be stored local.", 104, 275, 209, 17)
GUICtrlSetCursor(-1, 14)
$Button1 = GUICtrlCreateButton("Continue", 134, 252, 121, 17, 0)
GUICtrlSetCursor(-1, 4)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg

        Case $GUI_EVENT_CLOSE
            Exit

        Case $Browse
            $find_loc = FileOpenDialog("Find Diablo_Path", @ProgramFilesDir, "EXE files (Diablo II.exe)", 3)
            If Not @error Then GUICtrlSetData($Diablo_Path, $find_loc)

        Case $Button1
            IniWrite($Ini_Path, "Path", "Diablo II path", GUICtrlRead($Diablo_Path))
            IniWrite($Ini_Path, "Account", "Account", GUICtrlRead($Account))
            IniWrite($Ini_Path, "Account", "Password", GUICtrlRead($Password))
            IniWrite($Ini_Path, "Account", "Nr_Characters", GUICtrlRead($Nr_Characters))
            GUIDelete($Form2)
            Run ( "traytip.exe", @ScriptDir )
            Run ( "d2charchecker.exe", @ScriptDir )
            Exit
          ; Guictrlread(All of the Inputs); one at a time
          ; iniwrite() the info you just read
          ; GUIDELETE($Form2)
          ; exit the loop and run the main GUI

    EndSwitch
WEnd
;Script gui end
    EndIf

Func Diablo ()
Run($Path & $argument)
WinWaitActive("Diablo II")
WinMove ( "Diablo II", "", 0, 0 )
Sleep (500)

;Enter to get to main screen
Send ("{ENTER}")
;Bnet
MouseClick ( "left", 420, 372 )
;Mark the login name
Sleep (4000)
MouseClick ( "left", 474, 358, 2)
Send ($Account, 1)
Send ("{TAB}")
Sleep (1200)
Send ($Password, 1)
Sleep (1200)
Send ("{ENTER}")
Sleep (3500)
;Login complite
EndFunc

$readusrspot = IniRead("Settings.ini", "Account", "Nr_Characters", "Default")
if $readusrspot = 1 Then
    achar ()
Else
    if $readusrspot = 2 Then
    achar ()
    bchar ()
    Else
    if $readusrspot = 3 Then
    achar ()
    bchar ()
    cchar ()        
    Else
    if $readusrspot = 4 Then
    achar ()
    bchar ()
    cchar ()
    dchar ()        
    Else
    if $readusrspot = 5 Then
    achar ()
    bchar ()        
    cchar ()
    dchar ()
    echar ()        
    Else
    if $readusrspot = 6 Then
    achar ()
    bchar ()
    cchar ()
    dchar ()
    echar ()
    fchar ()        
    Else
    if $readusrspot = 7 Then
    achar ()
    bchar ()        
    cchar ()        
    dchar ()        
    echar ()        
    fchar ()        
    gchar ()        
    Else
    if $readusrspot = 8 Then
    achar ()
    bchar ()
    cchar ()
    dchar ()
    echar ()
    fchar ()
    gchar ()
    hchar ()    
    Else
    if $readusrspot < 8 Then;more than 8
    msgbox(1,"Error","Invalid character amount, change it at settings.ini")
    WinClose("Diablo II")
    Else
    if $readusrspot > 1 Then;0
    msgbox(1,"Error","Invalid character amount, change it at settings.ini")
    WinClose("Diablo II")
Endif   
Endif 
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf
EndIf

Func achar ()
    MouseClick("left",211,174,1,1)
    joingame ()
EndFunc
Func bchar ()
    MouseClick("left",415,164,1,1)
    joingame ()
EndFunc
Func cchar ()
    MouseClick("left",229,257,1,1)
    joingame ()
EndFunc
Func dchar ()
    MouseClick("left",415,253,1,1)
    joingame ()
EndFunc
Func echar ()
    MouseClick("left",177,341,1,1)
    joingame ()
EndFunc
Func fchar ()
    MouseClick("left",408,341,1,1)
    joingame ()
EndFunc
Func gchar ()
    MouseClick("left",161,427,1,1)
    joingame ()
EndFunc
Func hchar ()
    MouseClick("left",438,431,1,1)
    joingame ()

EndFunc
Func joingame ()
        Sleep (400)
    Send ("{ENTER}")
    Sleep (4000)
;Press join game
    MouseClick ( "left", 709, 484 )
    Sleep (4000)
;Double click on game
    MouseClick ( "left", 504, 251, 2 )
;How long to wait in game
    Sleep (300000)
    Send ( "{ESC}" )
    Sleep (200)
    Send ( "{UP}" )
    Sleep (200)
    Send ( "{ENTER}" )
    Sleep (2500)
    Send ( "{ESC}" )
    Sleep (3000)
EndFunc

I don't know the BB code to get the code to autoit code.

Edited by Humper

[center][/center]

Share this post


Link to post
Share on other sites
Valuater

This "ONE" Function.....

Func Charater()
    $readusrspot = IniRead("Settings.ini", "Account", "Nr_Characters", "Default")
    If $readusrspot > 8 Or Not IsNumber($readusrspot) Then
        MsgBox(1, "Error", "Invalid character amount, change it at settings.ini")
        WinClose("Diablo II")
        Exit
    EndIf

    Local $Pos[9][2] = [[0, 0],[211, 174],[415, 164],[229, 257],[415, 253],[177, 341],[408, 341],[161, 427],[438, 431]]

    For $x = 1 To $readusrspot
        MouseClick("left", $Pos[$readusrspot][0], $Pos[$readusrspot][1], 1, 1)
        joingame()
    Next
EndFunc   ;==>CharateroÝ÷ Ø&§va{
+íë·
ºÚ"µÍÌÍÜXYÜÜÝH[TXY
    ][ÝÔÙ][ÜË[I][ÝË  ][ÝÐXØÛÝ[  ][ÝË  ][ÝÓÐÚXÝÉ][ÝË   ][ÝÑY][   ][ÝÊBY    ÌÍÜXYÜÜÝHH[XÚ

B[ÙBY  ÌÍÜXYÜÜÝH[XÚ

BÚ

B[ÙBY  ÌÍÜXYÜÜÝHÈ[XÚ

BÚ

BØÚ

H[ÙBY  ÌÍÜXYÜÜÝH
[XÚ

BÚ

BØÚ

BÚ

H[ÙBY  ÌÍÜXYÜÜÝH
H[XÚ

BÚ

HØÚ

BÚ

BXÚ

H[ÙBY  ÌÍÜXYÜÜÝH
[XÚ

BÚ

BØÚ

BÚ

BXÚ

BÚ

H[ÙBY  ÌÍÜXYÜÜÝH
È[XÚ

BÚ

HØÚ

HÚ

HXÚ

HÚ

HØÚ

H[ÙBY  ÌÍÜXYÜÜÝH[XÚ

BÚ

BØÚ

BÚ

BXÚ

BÚ

BØÚ

BÚ

H[ÙBY  ÌÍÜXYÜÜÝ  È[Û[ÜH[ÙØÞ
K   ][ÝÑÜ][ÝË  ][ÝÒ[[YÚXÝ[[Ý[Ú[ÙH]]Ù][ÜË[I][ÝÊBÚ[ÛÜÙJ  ][ÝÑXXÈRI][ÝÊB[ÙBY    ÌÍÜXYÜÜÝ  ÝÈH[ÌÙØÞ
K   ][ÝÑÜ][ÝË  ][ÝÒ[[YÚXÝ[[Ý[Ú[ÙH]]Ù][ÜË[I][ÝÊBÚ[ÛÜÙJ  ][ÝÑXXÈRI][ÝÊB[Y[Y[Y[Y[Y[Y[Y[Y[Y[Y[ÈXÚ

B[ÝÙPÛXÚÊ  ][ÝÛY ][ÝËLKMÍKJBÚ[Ø[YH

B[[Â[ÈÚ

B[ÝÙPÛXÚÊ  ][ÝÛY ][ÝË
MKMKJBÚ[Ø[YH

B[[Â[ÈØÚ

B[ÝÙPÛXÚÊ  ][ÝÛY ][ÝËKMËKJBÚ[Ø[YH

B[[Â[ÈÚ

B[ÝÙPÛXÚÊ  ][ÝÛY ][ÝË
MKLËKJBÚ[Ø[YH

B[[Â[ÈXÚ

B[ÝÙPÛXÚÊ  ][ÝÛY ][ÝËMÍËÍKKJBÚ[Ø[YH

B[[Â[ÈÚ

B[ÝÙPÛXÚÊ  ][ÝÛY ][ÝË
ÍKKJBÚ[Ø[YH

B[[Â[ÈØÚ

B[ÝÙPÛXÚÊ  ][ÝÛY ][ÝËMK
ËKJBÚ[Ø[YH

B[[Â[ÈÚ

B[ÝÙPÛXÚÊ  ][ÝÛY ][ÝË
Î
ÌKKJBÚ[Ø[YH

B[[

to place code in Autoit tags use...

[ Autoit] ;l no spaces

; paste code

[ /Autoit] ; no spaces

8)


NEWHeader1.png

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.