lolp1 Posted November 1, 2006 Posted November 1, 2006 Hello, I belive this is running the wrong .exe for some odd reason. I am trying to make a small tool to log on to my diablo II account for me, this is what I am using: expandcollapse popup;==================================================================================== ; .ini reading! ;==================================================================================== $d2exec = IniRead("global.ini", "Global", "D2Exec", ""); $d2path = IniRead("dclone.ini", "Global", "D2Path", ""); $account = IniRead("dclone.ini", "Global", "Account", ""); $password = IniRead("dclone.ini", "Global", "Password", ""); $charpos = IniRead("dclone.ini", "Global", "CharPos", ""); ;==================================================================================== ; Define specified mouse usage ;==================================================================================== Func MyClick($button, $x, $y); MouseMove($x, $y, Random(1, 3)); If $button = "left" then; MouseClick("left"); Else; MouseClick("right"); EndIf; EndFunc; ;==================================================================================== ; Load and login to Diablo II screens ;==================================================================================== Func StartDia(); Run($d2exec, $d2path); ;WinActivate("D2Loader v1.11b - Build On Nov 11 2005"); WinWaitActive("D2Loader v1.11b - Build On Nov 11 2005"); Sleep(200) WinMove("D2Loader v1.11b - Build On Nov 11 2005", "", -1, -1); Sleep(200); Endfunc; ;==================================================================================== ; Log in to your account ;==================================================================================== Func Login(); MouseClick("left", 404,382); MouseClick("left", 404,382); $loginscreen = PixelGetColor(325,354); While $loginscreen <> 1024; ;6535902 Sleep(100); $loginscreen = PixelGetColor(325,354); Wend; MouseClick("left", 483,364); MouseClick("left", 483,364); Send($account); Sleep(600); Send("{TAB}"); Sleep(500); Send($password); Sleep(1000); Send("{ENTER}"); EndFunc ;==================================================================================== ; Choose your charechter ;==================================================================================== Func ChooseChar(); $charscreen = PixelGetColor( 725,366); While $charscreen <> 16766810; Sleep(1500); $charscreen = PixelGetColor( 725,366); Wend; If $charpos = "1" then; MouseClick("left", 190,170); MouseClick("left", 190,170); ElseIf $charpos = "2" then; MouseClick("left", 445,170); MouseClick("left", 445,170); ElseIf $charpos = "3" then; MouseClick("left", 190,245); MouseClick("left", 190,245); ElseIf $charpos = "4" then; MouseClick("left", 445,245); MouseClick("left", 445,245); ElseIf $charpos = "5" then; MouseClick("left", 190,351); MouseClick("left", 190,351); ElseIf $charpos = "6" then; MouseClick("left", 445,351); MouseClick("left", 445,351); ElseIf $charpos = "7" then; MouseClick("left", 190,437); MouseClick("left", 190,437); ElseIf $charpos = "8" then; MouseClick("left", 445,437); MouseClick("left", 445,437); endif; Sleep(200); EndFunc; ;==================================================================================== ; Call funcs ;==================================================================================== StartDia() Sleep(100) LogIn() Sleep(100) ChooseChar() My .ini is: [global] [global] d2exec= "C:\Program Files\Diablo II\Diablo II.exe" -w d2path= "C:\Program Files\Diablo II\ account= password= charpos= 1 For some reason, it seems to load diablo II, but it does not load it correctly. I don't know what is happening, but I don't think it is loading the right path, it loads Diablo II, but says my Version is invalid. How ever when I run the .exe ("C:\Program Files\Diablo II\Diablo II.exe" -w) From the path ("C:\Program Files\Diablo II\) it works fine, any idea?
Briegel Posted November 1, 2006 Posted November 1, 2006 What about d2path= "C:\Program Files\Diablo II\" in your ini?
lolp1 Posted November 1, 2006 Author Posted November 1, 2006 That is what the path of my Diablo II is in. (EG: The folder)
Briegel Posted November 1, 2006 Posted November 1, 2006 Yes, but I mean the ending " (don't know the english name).
lolp1 Posted November 1, 2006 Author Posted November 1, 2006 That is a typo, I have tried with & with out quotes. (" " = a quote in english).
stampy Posted November 1, 2006 Posted November 1, 2006 typo on the ini read... ;==================================================================================== ; .ini reading! ;==================================================================================== $d2exec = IniRead("global.ini"<<<< TYPO <<<<<<<<<<<<<<<<<, "Global", "D2Exec", ""); $d2path = IniRead("dclone.ini", "Global", "D2Path", ""); $account = IniRead("dclone.ini", "Global", "Account", ""); $password = IniRead("dclone.ini", "Global", "Password", ""); $charpos = IniRead("dclone.ini", "Global", "CharPos", ""); goodluck
lolp1 Posted November 1, 2006 Author Posted November 1, 2006 (edited) Problem solved. I don't really know what is changed, but when I mov it in my diablo II directory, it works, but not when it is out. Since I like to under-stand how all my code works, if someone can explain why I would apperciate it. EDIT: ;==================================================================================== ; .ini reading! ;==================================================================================== $d2exec = IniRead("global.ini"<<<< TYPO <<<<<<<<<<<<<<<<<, "Global", "D2Exec", ""); $d2path = IniRead("dclone.ini", "Global", "D2Path", ""); $account = IniRead("dclone.ini", "Global", "Account", ""); $password = IniRead("dclone.ini", "Global", "Password", ""); $charpos = IniRead("dclone.ini", "Global", "CharPos", ""); That is not a typo. Edited November 1, 2006 by lolp1
McGod Posted November 1, 2006 Posted November 1, 2006 expandcollapse popup;==================================================================================== ; .ini reading! ;==================================================================================== $d2exec = IniRead("global.ini", "Global", "D2Exec", ""); $d2path = IniRead("dclone.ini", "Global", "D2Path", ""); $switches = IniRead ( "dclone.ini", "Global", "Switches", ""); $account = IniRead("dclone.ini", "Global", "Account", ""); $password = IniRead("dclone.ini", "Global", "Password", ""); $charpos = IniRead("dclone.ini", "Global", "CharPos", ""); ;==================================================================================== ; Define specified mouse usage ;==================================================================================== Func MyClick($button, $x, $y); MouseMove($x, $y, Random(1, 3)); If $button = "left" then; MouseClick("left"); Else; MouseClick("right"); EndIf; EndFunc; ;==================================================================================== ; Load and login to Diablo II screens ;==================================================================================== Func StartDia(); Run($d2path & $d2exec & " " & $switches, $d2path); ;WinActivate("D2Loader v1.11b - Build On Nov 11 2005"); WinWaitActive("D2Loader v1.11b - Build On Nov 11 2005"); Sleep(200) WinMove("D2Loader v1.11b - Build On Nov 11 2005", "", -1, -1); Sleep(200); Endfunc; ;==================================================================================== ; Log in to your account ;================================= Func Login(); MouseClick("left", 404,382); MouseClick("left", 404,382); $loginscreen = PixelGetColor(325,354); While $loginscreen <> 1024; ;6535902 Sleep(100); $loginscreen = PixelGetColor(325,354); Wend; MouseClick("left", 483,364); MouseClick("left", 483,364); Send($account); Sleep(600); Send("{TAB}"); Sleep(500); Send($password); Sleep(1000); Send("{ENTER}"); EndFunc ;==================================================================================== ; Choose your charechter ;==================================================================================== Func ChooseChar(); $charscreen = PixelGetColor( 725,366); While $charscreen <> 16766810; Sleep(1500); $charscreen = PixelGetColor( 725,366); Wend; If $charpos = "1" then; MouseClick("left", 190,170); MouseClick("left", 190,170); ElseIf $charpos = "2" then; MouseClick("left", 445,170); MouseClick("left", 445,170); ElseIf $charpos = "3" then; MouseClick("left", 190,245); MouseClick("left", 190,245); ElseIf $charpos = "4" then; MouseClick("left", 445,245); MouseClick("left", 445,245); ElseIf $charpos = "5" then; MouseClick("left", 190,351); MouseClick("left", 190,351); ElseIf $charpos = "6" then; MouseClick("left", 445,351); MouseClick("left", 445,351); ElseIf $charpos = "7" then; MouseClick("left", 190,437); MouseClick("left", 190,437); ElseIf $charpos = "8" then; MouseClick("left", 445,437); MouseClick("left", 445,437); endif; Sleep(200); EndFunc; ;==================================================================================== ; Call funcs ;==================================================================================== StartDia() Sleep(100) LogIn() Sleep(100) ChooseChar() [global] d2exec= "Diablo II.exe" d2path= "C:\Program Files\Diablo II\" switches = "-w -ns" account= password= charpos= 1 [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u]
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