Diablo2 Posted October 17, 2009 Author Share Posted October 17, 2009 (edited) Damn I double posted, sorry. Edited October 17, 2009 by Diablo2 Link to comment Share on other sites More sharing options...
jebus495 Posted October 18, 2009 Share Posted October 18, 2009 (edited) Oh ok. For $runnumber = 0 To 15 MsgBox(0, "", "56xbaal" & $runnumber) Next Or: Local $runnumber = 0 Do $runnumber += 1 MsgBox(0, "", "56xbaal" & $runnumber) Until $runnumber = 15 Don't have autoit on this comp but it should work. Those are examples of how to make something count. Edited October 18, 2009 by jebus495 Link to comment Share on other sites More sharing options...
Diablo2 Posted October 18, 2009 Author Share Posted October 18, 2009 Oh ok. For $runnumber = 0 To 15 MsgBox(0, "", "56xbaal" & $runnumber) Next Or: Local $runnumber = 0 Do $runnumber += 1 MsgBox(0, "", "56xbaal" & $runnumber) Until $runnumber = 15 Don't have autoit on this comp but it should work. Those are examples of how to make something count. Ok I'll try this when I get some free time. Thanks for the reply. Link to comment Share on other sites More sharing options...
Diablo2 Posted October 18, 2009 Author Share Posted October 18, 2009 Okay I've got this KIND of figured out, but not really, I added to my script $Runnumber = IniRead("Config.ini", "Settings", "RunNumber", "") $GameName = IniRead("config.ini", "settings", "GameName", "" ) Send("" & $GameName) Send("" & $RunNumber ++ 1) Send("{TAB}") $GamePass = IniRead("Config.ini", "Settings", "Gamepass", "") Send("" & $GamePass) send("{ENTER}") That will make it add +1 to the RunNumber in my Config file, and the run number is set to 0, so when I start the script it will join MF Baal1, but then after that run is over the variable in my config file still says RunNumber=1. Is there a way to perhaps have it add a +1 to that RunNumber= in my config file after every run? If I can get that to work I will be onto my next section which is detecting the town portal. Link to comment Share on other sites More sharing options...
jebus495 Posted October 18, 2009 Share Posted October 18, 2009 $Runnumber = IniRead("Config.ini", "Settings", "RunNumber", "") $GameName = IniRead("config.ini", "settings", "GameName", "" ) Send("" & $GameName) Send("" & $RunNumber ++ 1) Send("{TAB}") $GamePass = IniRead("Config.ini", "Settings", "Gamepass", "") Send("" & $GamePass) send("{ENTER}") $Runnumber = IniRead("Config.ini", "Settings", "RunNumber", "") $GameName = IniRead("config.ini", "settings", "GameName", "" ) Send($GameName & $RunNumber += 1) Send("{TAB}") Send($GamePass) send("{ENTER}") IniWrite("Config.ini", "Settings", "RunNumber", $RunNumber) Link to comment Share on other sites More sharing options...
Funk Posted January 28, 2010 Share Posted January 28, 2010 I know this is an old post but it's related to an issue I have so I'll give it a try. I just started fooling around with AutoIt a few days ago and I'm also trying to learn it through the same game. I also ran into the problem about starting it in windowed mode. I tried reading the path and exe from an .ini file like on the first page but with no success. This might be an odd question but can AutoIt launch an .exe through a shortcut? I'm also trying to get pixel color/coords and mouse coords. The only problem is that the window will minimize itself if it becomes the inactive window. Do you think methods like this will be sufficient? I looked for rules about discussion of code that may break some TOS rules...hope this doesn't count. WinWaitActive (“Game”); Sleep (5000) $pos = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1]) WinWaitActive (“Game”); Sleep (5000) $pos = MouseGetPos() $var = PixelGetColor( $pos[0] , $pos[1] ) MsgBox(0,"The decmial color is", $var) MsgBox(0,"The hex color is", Hex($var, 6)) Link to comment Share on other sites More sharing options...
Rogue5099 Posted January 28, 2010 Share Posted January 28, 2010 Here is Kuk's source code, nice checksums for creating a game, not so much for joining but with a little work and trail and error you could change it around! expandcollapse popup;======================================================= ;Diablo II LOD Mini OOG Controller for Battlenet ;Version 1.0 ;======================================================= #Include <Misc.au3> Opt("PixelCoordMode", 2) Opt("MouseCoordMode", 2) Opt("RunErrorsFatal", 0) Opt("SendKeyDelay", 200) Opt("WinTitleMatchMode", 3) Global $RunLoop = 0, $Games = 0, $ChickenRetries, $KEY_ClearScreen, $ChickenTimeOut Global $TimeUp = TimerInit() Global $CurrentCDkey = IniRead(@ScriptDir & "\Config.ini", "Settings", "LastCDkeyused", "") ; ---------------------------------------------------------------------------- ; <AUT2EXE INCLUDE-START: C:\Documents and Settings\Tomino\My Documents\Kuk-Bot-V4.1 bots\BLANK BOT V4.1\Bot\_AU3-Sources_\IniRead.au3> ; ---------------------------------------------------------------------------- ;Settings $D2PathName = IniRead(@ScriptDir & "\Config.ini", "Settings", "D2PathName", "") $D2Executable = IniRead(@ScriptDir & "\Config.ini", "Settings", "D2Executable", "") $D2WinName = IniRead(@ScriptDir & "\Config.ini", "Settings", "D2WinName", "") $Paramaters = IniRead(@ScriptDir & "\Config.ini", "Settings", "Paramaters", "") $A = IniRead(@ScriptDir & "\Config.ini", "Settings", "Account", "") $P = IniRead(@ScriptDir & "\Config.ini", "Settings", "Password", "") $CharSlot = IniRead(@ScriptDir & "\Config.ini", "Settings", "CharSlot", "") $GameName = IniRead(@ScriptDir & "\Config.ini", "Settings", "GameName", "") $GamePassLength = IniRead(@ScriptDir & "\Config.ini", "Settings", "GamePassType", "1") $startnumber = IniRead(@ScriptDir & "\Config.ini", "Settings", "StartNumber", "1") $CDkeyCount = IniRead(@ScriptDir & "\Config.ini", "Settings", "CDkeyCount", "") ;Delays $MenuMouseSpeed = IniRead(@ScriptDir & "\Config.ini", "Delays", "MenuMouseSpeed", "") $GameCreateDelay = IniRead(@ScriptDir & "\Config.ini", "Delays", "GameCreateDelay", "") $MenuStaticDelay = IniRead(@ScriptDir & "\Config.ini", "Delays", "MenuStaticDelay", "") ; ---------------------------------------------------------------------------- ; <AUT2EXE INCLUDE-END: C:\Documents and Settings\Tomino\My Documents\Kuk-Bot-V4.1 bots\BLANK BOT V4.1\Bot\_AU3-Sources_\IniRead.au3> ; ---------------------------------------------------------------------------- ; ---------------------------------------------------------------------------- ; <AUT2EXE INCLUDE-START: C:\Documents and Settings\Tomino\My Documents\Kuk-Bot-V4.1 bots\BLANK BOT V4.1\Bot\_AU3-Sources_\Checksums.au3> ; ---------------------------------------------------------------------------- ;======================================================================== ;This file gives reference checksums to menus and screens ;All values are: 32 bit, Decimal, RGB, pixelcoordmode 2, and resolution 1 ;======================================================================== Global $TitleScreen[5] ;Declare the value $TitleScreen[0] = 3319931069 ;The resulting checksum $TitleScreen[1] = 80 ;Upper left X $TitleScreen[2] = 400 ;Upper left Y $TitleScreen[3] = 85 ;Lower right X $TitleScreen[4] = 405 ;Lower right Y Global $LoginScreen[5] $LoginScreen[0] = 1831881397 $LoginScreen[1] = 360 $LoginScreen[2] = 250 $LoginScreen[3] = 370 $LoginScreen[4] = 255 Global $CharacterSelect[5] $CharacterSelect[0] = 2362581377 $CharacterSelect[1] = 107 $CharacterSelect[2] = 177 $CharacterSelect[3] = 117 $CharacterSelect[4] = 178 Global $Lobby[5] $Lobby[0] = 1292465505 $Lobby[1] = 400 $Lobby[2] = 450 $Lobby[3] = 410 $Lobby[4] = 460 Global $CreateButton[5] ;the selected (greyed out) "Create" lobby button $CreateButton[0] = 2470124185 $CreateButton[1] = 545 $CreateButton[2] = 455 $CreateButton[3] = 550 $CreateButton[4] = 460 Global $GameJoin[5] ;Checksum for the black area of the game loading screen $GameJoin[0] = 7077889 $GameJoin[1] = 700 $GameJoin[2] = 100 $GameJoin[3] = 705 $GameJoin[4] = 105 Global $GUIBar[5] ;Can be used to determine if in-game $GUIBar[0] = 1671697521 $GUIBar[1] = 5 $GUIBar[2] = 575 $GUIBar[3] = 10 $GUIBar[4] = 580 ;~ ======================================================================== ;~ ---------------------------------------------------------------------------- ;~ <AUT2EXE INCLUDE-END: C:\Documents and Settings\Tomino\My Documents\Kuk-Bot-V4.1 bots\BLANK BOT V4.1\Bot\_AU3-Sources_\Checksums.au3> ;~ ---------------------------------------------------------------------------- If $CDkeyCount > 0 Then SetNextCDkey() EndIf If WinExists($D2WinName) Then While WinExists($D2WinName) WinClose($D2WinName) WEnd EndIf ;AdLibEnable("ShowSum", 200) ;for debugging... replace the checksum in ShowSum() to adjust what to look for AdlibEnable("D2Check", 60000) If LaunchD2() = 0 Then MsgBox(0, "", "Failed to log in! Check the error log to find out why...", 10) Exit Else LogEvent(0, "Launched Diablo II and successfully logged in to the Lobby.") EndIf ;~ =============================== ;~ Main Loop: Your code goes here! ;~ =============================== While 1 For $RunCount = $startnumber To 9999 $Games = $Games + 1 $RunLoop = $RunLoop + 1 If $Games > 17 And $CDKeyCount = 1 Then $Games = 0 If TimerDiff($TimeUp) < 3600000 Then D2Kill() While ProcessExists("Java.exe") ProcessClose("Java.exe") WEnd $TimeUp = Round(TimerDiff($TimeUp), -3) LogEvent(0, "Max Games per hour reached. Waiting " & ((3600000 - $TimeUp) / 60000) & "mins") _Timer(((3600000 - $TimeUp) / 1000)) LaunchD2() $TimeUp = TimerInit() EndIf EndIf If CreateGame() = 1 Then $begin__ = TimerInit() While ScreenCheck("Lobby") = 0 Sleep(1000) If (TimerDiff($begin__) > IniRead(@ScriptDir & "\Config.ini", "Settings", "GameTimeout", "120000")) Then ExitLoop EndIf WEnd Else RestartD2() LogEvent(0, "Restarting D2") EndIf If ($RunLoop > 15) AND ($CDkeyCount >1) Then LogEvent(0, "Restarting D2 - New keys!! (If available)") RestartD2() EndIf Next WEnd ;=============================== Func RestartD2() $RunLoop = 0 Opt("SendKeyDelay", 5) D2Kill() SetNextCDkey() For $loopage = 1 To 50 If LaunchD2() = 0 Then LogEvent(0, "Failed to login #" & $loopage) D2Kill() Sleep(30000) Else ExitLoop EndIf Next Opt("SendKeyDelay", 200) EndFunc Func SetNextCDkey() If $CDkeyCount > 1 Then $ClaKey_M = "\data\global\sfx\cursor\wavindx.wav" $ExpKey_M = "\data\global\chars\am\cof\amblxbow.cof" If (FileCopy(@ScriptDir & "\CDkeys\" & $CurrentCDkey & "\wavindx.wav", $D2PathName & $ClaKey_M,9) = 1) And (FileCopy(@ScriptDir & "\CDkeys\" & $CurrentCDkey & "\amblxbow.cof", $D2PathName & $ExpKey_M,9) = 1) Then LogEvent(0, "CDkey was injected successfully ~#" & $CurrentCDkey) Else LogEvent(0, "CDkey was NOT injected successfully ~#" & $CurrentCDkey) EndIf $CurrentCDkey = $CurrentCDkey + 1 If ($CDkeyCount < $CurrentCDkey) Then $CurrentCDkey = 1 EndIf IniWrite(@ScriptDir & "\Config.ini", "Settings", "LastCDkeyused", $CurrentCDkey) EndIf EndFunc ;Launches D2, logs in, and gets you to the lobby. Returns 0 if failed, 1 if success. Func LaunchD2() ;~ LogEvent(0, "Smorg's Mini OOG controller is launching Diablo II LOD for Battlenet...") If WinExists("Microsoft Windows") Then WinKill("Microsoft Windows") EndIf If Not ProcessExists("Java.exe") Then If Run(@ScriptDir & "\Java.exe", @ScriptDir) = 0 Then LogEvent(1, "RedVex was unable to start!") Return 0 Else WinWaitActive("(Title)") Send("^s") WinSetState("(Title)", "", @SW_HIDE) LogEvent(0, "RedVex Started successfully!") EndIf EndIf If Run($D2PathName & "\" & $D2Executable & " " & $Paramaters,$D2PathName) = 0 Then LogEvent(1, "Failed to launch Diablo at " & $D2PathName & "\" & $D2Executable & " Check your D2PathName key in Config.ini") Return 0 Else WinSetState("Diablo II", "", @SW_DISABLE) LogEvent(0, "D2 Loaded successfully!") EndIf For $lool = 1 To 100 If WinExists($D2WinName) then Exitloop Else Sleep(100) Endif Next For $lool = 1 To 100 $OMGGG = WinGetClientSize ($D2WinName) If IsArray ( $OMGGG ) Then If $OMGGG[0] > 799 Then ExitLoop EndIf EndIf Sleep(100) Next WinActivate ($D2WinName) WinWaitActive($D2WinName) Sleep(1000) WinMove($D2WinName, "", 0, -70) MouseClick("Left", 100, 100, 1, $MenuMouseSpeed) If ScreenWait("TitleScreen", 15000) = 0 Then Return 0 MouseClick("Left", 394, 353, 1, $MenuMouseSpeed) If ScreenWait("LoginScreen", 20000) = 0 Then Return 0 MouseClickDrag("Left", 477, 336, 300, 336, $MenuMouseSpeed) Sleep($MenuStaticDelay) Send($A) Sleep($MenuStaticDelay) Send("{TAB}") Sleep($MenuStaticDelay) Send($P) Sleep($MenuStaticDelay) MouseClick("Left", 395, 470, 1, $MenuMouseSpeed) If ScreenWait("CharacterSelect", 20000) = 0 Then Return 0 ;~ Charactor Select 1-8 $Xclix = 0 $Yclix = 0 If $CharSlot = 1 Then $Xclix = 180 $Yclix = 130 ElseIf $CharSlot = 2 Then $Xclix = 450 $Yclix = 130 ElseIf $CharSlot = 3 Then $Xclix = 180 $Yclix = 225 ElseIf $CharSlot = 4 Then $Xclix = 450 $Yclix = 225 ElseIf $CharSlot = 5 Then $Xclix = 171 $Yclix = 318 ElseIf $CharSlot = 6 Then $Xclix = 447 $Yclix = 315 ElseIf $CharSlot = 7 Then $Xclix = 180 $Yclix = 410 ElseIf $CharSlot = 8 Then $Xclix = 458 $Yclix = 406 Else MsgBox(0, "", "You must pick a character slot! 1-8") Exit(0) EndIf MouseClick("Left", $Xclix, $Yclix, 1, $MenuMouseSpeed) ;Charactor Select Sleep($MenuStaticDelay) MouseClick("Left", 692, 557, 1, $MenuMouseSpeed) ;OK button on Charactor Select Menu If ScreenWait("Lobby", 20000) = 0 Then Return 0 Return 1 EndFunc ;~ Create a game with dynamic waits & retries. Returns 0 if failed, 1 if success. Func CreateGame() For $Retry = 0 to 4 If (IniRead(@ScriptDir & "\Kuk_Bot.ini", "Intercom", "WasDeadStatus", "1")) = 1 Then LogEvent(0, "Bot Died. Stopping due to that...") Exit(0) EndIf If (IniRead(@ScriptDir & "\Kuk_Bot.ini", "Intercom", "WasHostiled", "1")) = 1 Then IniWrite(@ScriptDir & "\Kuk_Bot.ini", "Intercom", "WasHostiled", "0") LogEvent(0, "Bot was Hostiled, Making a Random Game Number!") $RunCount = Random(1, 5000, 1) EndIf $RunCount = $RunCount+$Retry LogEvent(0, "Attempting to create the game " & $GameName & $RunCount & " This is attempt number " & $Retry) MouseClick("Left", 590, 462, 1, $MenuMouseSpeed) If ScreenWait("CreateButton", 15000) = 0 Then MouseClick("Left", 712, 461, 1, $MenuMouseSpeed) Sleep(2000) ContinueLoop EndIf Send($GameName & $RunCount) Sleep(200) If $GamePassLength = 1 Then Send("{TAB}") Send($RunCount) ElseIf $GamePassLength = 9 Or $GamePassLength = "" Then Sleep(100) ElseIf $GamePassLength > 1 Then Send("{TAB}") For $lll = 1 to $GamePassLength Send(Random(1, 9, 1)) Next Else Send("{TAB}") Send($GamePassLength) EndIf MouseClick("Left", 676, 418, 1, $MenuMouseSpeed) ;Create Game If ScreenWait("GameJoin", 15000) = 0 Then If IniRead(@ScriptDir & "\Kuk_Bot.ini", "Intercom", "IsInGame", "0") = 0 Then LogEvent(1, "Game create screen not detected after 5 seconds... will retry the game join.") MouseClick("Left", 711, 461, 1, $MenuMouseSpeed) ContinueLoop EndIf EndIf Local $Timeout = TimerInit() While ScreenCheck("GameJoin") = 1 If IniRead(@ScriptDir & "\Kuk_Bot.ini", "Intercom", "IsInGame", "0") = 0 Then If TimerDiff($Timeout) > 30000 Then LogEvent(1, "Looks like we got stuck on the game create screen for over 30 seconds...") Return 0 EndIf EndIF Sleep(500) WEnd If IniRead(@ScriptDir & "\Kuk_Bot.ini", "Intercom", "IsInGame", "0") = 1 Then IniWrite(@ScriptDir & "\Kuk_Bot.ini", "Intercom", "IsInGame", "0") Return 1 Endif If ScreenCheck("Lobby") = 1 Then LogEvent(1, "Failed to Join! Retrying...") ContinueLoop ElseIf ScreenCheck("GUIBar") = 1 Then LogEvent(0, "Successfully joined the game after " & Round((TimerDiff($Timeout)/1000), 2) & " seconds.") Return 1 Elseif IniRead(@ScriptDir & "\Kuk_Bot.ini", "Intercom", "IsInGame", "0") = 1 Then Return 1 Else LogEvent(1, "Hmm, looks like we got lost somewhere while attempting to create a game...") Return 0 EndIf Next LogEvent(1, "Failed to create a game after 5 retries.") Return 0 EndFunc ;Dynamic wait for a screen. Feed a screen to wait for from Checksums.au3, or define your own. Also supply a timeout. Returns 0 if failed, 1 if success Func ScreenWait($ScreenName, $Timeout) Local $Checksum[5] Local $Sum $Checksum = Eval($ScreenName) $Time = TimerInit() Do Sleep(200) $Sum = PixelChecksum($Checksum[1], $Checksum[2], $Checksum[3], $Checksum[4]) If $Sum = $Checksum[0] Then Return 1 Until TimerDiff($Time) > $Timeout LogEvent(1, $Sum & " does not match the expected the checksum of " & $Checksum[0] & " for the menu " & $ScreenName & " at coordinates (" & $Checksum[1] & " ," & $Checksum[2] & " ," & $Checksum[3] & " ," & $Checksum[4] & ") and timed out after " & $TimeOut & " milliseconds.") Return 0 EndFunc ;Simple screen detection, so you don't have to type out the pixelchecksum every time. Returns 1 if the screen matches, 0 if failed. Func ScreenCheck($ScreenName) Local $Checksum[5] $Checksum = Eval($ScreenName) ;LogEvent(1, PixelChecksum($Checksum[1], $Checksum[2], $Checksum[3], $Checksum[4]) & " is checksum for: " & $ScreenName) If PixelChecksum($Checksum[1], $Checksum[2], $Checksum[3], $Checksum[4]) = $Checksum[0] Then Return 1 Else Return 0 EndIf EndFunc Func D2Check() If @HOUR = IniRead(@ScriptDir & "\Config.ini", "Settings", "HourtoStop", "") Then If @HOUR > 12 Then LogEvent(0, "Stopping Bot at " & @HOUR - 12 & ":00 PM !") ElseIf @HOUR < 12 And Not @HOUR = 0 Then LogEvent(0, "Stopping Bot at " & @HOUR & ":00 AM !") ElseIf @HOUR = 0 Then LogEvent(0, "Stopping Bot at 12:00 AM !") ElseIf @HOUR = 12 Then LogEvent(0, "Stopping Bot at 12:00 PM !") EndIf Exit EndIf If (BitAnd(WinGetState("Diablo II"), 16)) Then WinSetState("Diablo II", "", @SW_RESTORE) EndIf EndFunc ;Quit D2. will try to chicken first if you are in-game. Func D2Kill() While WinExists($D2WinName) WinClose($D2WinName) WEnd While ProcessExists("Game.exe") ProcessClose("Game.exe") WEnd Sleep(30000) EndFunc ;Do a quick & effective game exit. Suitable for both emergency chickens, and standard save & exits. Func Chicken() For $Retries = 1 To $ChickenRetries Send($KEY_ClearScreen) MouseUp("Right") MouseUp("Left") Send("{ESC}") $Timeout = TimerInit() While 1 If (PixelGetColor(481, 535) <> 5406092) AND (PixelGetColor(320, 537) <> 6521492) Then ExitLoop ElseIf TimerDiff($Timeout) > 500 Then LogEvent(0, "Failed to open the main menu, will retry... Retry # " & $Retries) ContinueLoop 2 EndIf Sleep(100) WEnd MouseClick("Left", 400, 280, 1, 0) $Timeout = TimerInit() While TimerDiff($Timeout) < $ChickenTimeout If (PixelGetColor(600, 575) <> 6512995) AND (PixelGetColor(5, 575) <> 2697257) Then ExitLoop 2 Sleep(100) WEnd If $Retries >= $ChickenRetries Then LogEvent(0, "Max Retries exceeded, Will terminate the Game.exe process") ProcessClose("Game.exe") Else LogEvent(0, "Failed to chicken, Will retry the chicken...") EndIf Next LogEvent(0, "Chicken was a success! ^^") EndFunc ;Returns 0 if either a menu is open or we aren't in game, and returns 1 if the minipanel is in its expected position. (this requires it to be open) Func IsMenuOpen() If PixelGetColor(325, 559) <> 5274764 Then If PixelGetColor(462, 559) <> 8429760 Then Return 0 EndIf EndIf Return 1 EndFunc ;Simple logging function Func LogEvent($Code, $String) $LogFile = FileOpen(@ScriptDir & "\Logs\Events.txt", 1) Select Case $Code = 0 FileWriteLine($LogFile, @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & " [I]> " & $String) Case $Code = 1 FileWriteLine($LogFile, @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC & " [E]> " & $String) EndSelect FileClose($LogFile) EndFunc ;Debug function... replace the search pattern with whatever you need. Func ShowSum() ToolTip(PixelCheckSum($GameJoin[1], $GameJoin[2], $GameJoin[3], $GameJoin[4]), 0, 0) EndFunc Func _Timer($timetowait) Local $sEndTime = "00:00:" & ($timetowait) Local $sTimeBack = _StrAddSub(@HOUR & ":" & @MIN & ":" & @SEC, $sEndTime) Local $sSubTimeDiff, $sHMS Local $bTimeBack = StringTrimRight($sTimeBack, 6) If $bTimeBack >= 24 Then $bTimeBack = $bTimeBack - 25 $sTimeBack = _StrAddSub($bTimeBack & ":" & @MIN & ":" & @SEC, $sEndTime) EndIf While 1 $sHMS = @HOUR & ":" & @MIN & ":" & @SEC $sSubTimeDiff = _StrAddSub($sTimeBack, $sHMS, 0) ToolTip("Restart Time : " & $sTimeBack & @CRLF & _ "Wait Time Left : " & $sSubTimeDiff & @CRLF & _ "Current Time : " & $sHMS & @CRLF & _ "Hold Ctrl+R To Skip Waiting", (@DesktopWidth - 215), (@DesktopHeight - 130), "Detected 20 Games/Hour") If $sHMS = $sTimeBack Then ExitLoop If _IsPressed("11") And _IsPressed("52") Then LogEvent(0, "Closed wait timer before time was up!") ExitLoop EndIf Sleep(1000) WEnd ToolTip("") EndFunc ;==>_Timer Func _StrAddSub($sTime1, $sTime2, $iAdd = 1, $sDelim = ':') Local $aSplit1 = StringSplit($sTime1, $sDelim), $iSubTotal = 0 Local $aSplit2 = StringSplit($sTime2, $sDelim) If $aSplit1[0] <> 3 Or $aSplit2[0] <> 3 Then Return SetError(0, 0, 0) Local $iTotal1 = ((Int($aSplit1[1]) * 3600) + (Int($aSplit1[2]) * 60) + (Int($aSplit1[3]))) Local $iTotal2 = ((Int($aSplit2[1]) * 3600) + (Int($aSplit2[2]) * 60) + (Int($aSplit2[3]))) If $iAdd Then $iSubTotal = $iTotal1 + $iTotal2 ElseIf $iTotal1 >= $iTotal2 Then $iSubTotal = $iTotal1 - $iTotal2 Else $iSubTotal = $iTotal2 - $iTotal1 EndIf Local $iHour = Int(($iSubTotal / 3600)) Local $iMin = Int(($iSubTotal - ($iHour * 3600)) / 60) Local $iSec = Int(($iSubTotal - $iHour * 3600) - ($iMin * 60)) Return StringFormat('%02d', $iHour) & $sDelim & StringFormat('%02d', $iMin) & $sDelim & StringFormat('%02d', $iSec) EndFunc ;==>_StrAddSub Func OnAutoItExit() AdlibDisable() While WinExists($D2WinName) WinClose($D2WinName) WEnd While ProcessExists("Game.exe") ProcessClose("Game.exe") WEnd While ProcessExists("Java.exe") ProcessClose("Java.exe") WEnd IniWrite(@ScriptDir & "\Config.ini", "Settings", "StartNumber", ($RunCount+1)) Exit EndFunc ; ---------------------------------------------------------------------------- ; <AUT2EXE INCLUDE-END: C:\Documents and Settings\Tomino\My Documents\Kuk-Bot-V4.1 bots\BLANK BOT V4.1\Bot\_AU3-Sources_\_[Kuk-Bot starter]_.au3> ; ---------------------------------------------------------------------------- My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
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