First of all Download Autoit from the web. Just google it you lasy gamer.
You'll need to copy the following codes to a notepad. and save them wih the exact name I am putting here.
SRO_restart.au3
Code:
;=========================================================================== ; * * * * * * Declare Variables ;=========================================================================== HotKeySet("{PAUSE}", "Pause") HotKeySet("{F5}", "Minimize") Global $LogIt Global $Paused $Status = 0 $LoginRetry = 0 $ElapsedFreezeTime = 0 $ElapsedInsertTime = 0 $InsertSend = IniRead("SRO_restart.ini", "Settings", "Insert_Send", "") $StartBot = IniRead("SRO_restart.ini", "Settings", "Srobot_Start", "") $SrobotPath = IniRead("SRO_restart.ini", "Settings", "Srobot_Path", "") $SroBotExe = IniRead("SRO_restart.ini", "Settings", "Srobot_Exe", "") $SrobotTitle = IniRead("SRO_restart.ini", "Settings", "Srobot_Title", "") $StartCrack = IniRead("SRO_restart.ini", "Settings", "Crack_Start", "") $CrackPath = IniRead("SRO_restart.ini", "Settings", "Crack_Path", "") $CrackExe = IniRead("SRO_restart.ini", "Settings", "Crack_Exe", "") $CrackTitle = IniRead("SRO_restart.ini", "Settings", "Crack_Title", "") $PartyMatch = IniRead("SRO_restart.ini", "Settings", "Party_Match", "") $MinParty = IniRead("SRO_restart.ini", "Settings", "Party_Min", "") $PartyCheck = IniRead("SRO_restart.ini", "Settings", "Party_Check", "") $FreezeCheck = IniRead("SRO_restart.ini", "Settings", "Freeze_Check", "") $FreezeLeft = IniRead("SRO_restart.ini", "Settings", "Freeze_CoordL", "") $FreezeTop = IniRead("SRO_restart.ini", "Settings", "Freeze_CoordT", "") $FreezeRight = IniRead("SRO_restart.ini", "Settings", "Freeze_CoordR", "") $FreezeBottom = IniRead("SRO_restart.ini", "Settings", "Freeze_CoordB", "") $ResizeClient = IniRead("SRO_restart.ini", "Settings", "Silkroad_Resize ", "") $Resolution = IniRead("SRO_restart.ini", "Settings", "Silkroad_Resolution", "") $SROPath = IniRead("SRO_restart.ini", "Settings", "Silkroad_Path", "") $SROLExe = IniRead("SRO_restart.ini", "Settings", "Silkroad_LExe", "") $SROExe = IniRead("SRO_restart.ini", "Settings", "Silkroad_Exe", "") $SROLauncher = IniRead("SRO_restart.ini", "Settings", "Silkroad_Launcher", "") $SROClient = IniRead("SRO_restart.ini", "Settings", "Silkroad_Client", "") $SROAccount = IniRead("SRO_restart.ini", "Login", "Login_SROAccount", "") $SROPassword = IniRead("SRO_restart.ini", "Login", "Login_SROPassword", "") $SrobotLogin = IniRead("SRO_restart.ini", "Login", "Login_Srobot", "") $SrobotAcc = IniRead("SRO_restart.ini", "Login", "Login_BOTAccount", "") $SrobotPass = IniRead("SRO_restart.ini", "Login", "Login_BOTPassword", "") $CharPos = IniRead("SRO_restart.ini", "Login", "Login_Character_Pos", "") $LDelay = IniRead("SRO_restart.ini", "Delays", "Delay_Launcher", "") $CDelay = IniRead("SRO_restart.ini", "Delays", "Delay_Client", "") $ADelay = IniRead("SRO_restart.ini", "Delays", "Delay_SROAccount", "") $PDelay = IniRead("SRO_restart.ini", "Delays", "Delay_SROPassword", "") $RDelay = IniRead("SRO_restart.ini", "Delays", "Delay_Restart", "") $GDelay = IniRead("SRO_restart.ini", "Delays", "Delay_2InGame", "") $C2Delay = IniRead("SRO_restart.ini", "Delays", "Delay_Char", "") $PaDelay = IniRead("SRO_restart.ini", "Delays", "Delay_Party", "") $SaDelay = IniRead("SRO_restart.ini", "Delays", "Delay_BotAccount", "") $SpDelay = IniRead("SRO_restart.ini", "Delays", "Delay_BotPassword", "") $LoDelay = IniRead("SRO_restart.ini", "Delays", "Delay_Login", "") $EnDelay = IniRead("SRO_restart.ini", "Delays", "Delay_Enter", "") $ReDelay = IniRead("SRO_restart.ini", "Delays", "Delay_Resize", "") $FDelay = IniRead("SRO_restart.ini", "Delays", "Delay_Freeze", "") $IDelay = IniRead("SRO_restart.ini", "Delays", "Delay_Insert", "") ;=========================================================================== ; * * * * * * 'Main' ;=========================================================================== FileDelete("SRO_restart.log.txt") SetLog("") SetLog("========================================") SetLog("julmuri's srobot restart script launched.") SetLog("========================================") SetLog("") #Region SplashImageOn("julmuri's srobot restart script 3.1 * ", "E:\Pelit\sro_restart\splash.jpg", "630", "470", "-1", "-1", 0) #EndRegion Sleep(5000) SplashOff() While 1 *If $StartCrack = "Yes" Or $StartCrack = "yes" Then * * CrackHandle() *EndIf *If $StartBot = "Yes" Or $StartBot = "yes" Then * * SrobotHandle() *EndIf *If $Status = "GameDisconnected" Or WinExists($SROLauncher) = 0 And WinExists($SROClient) = 0 Then * * LauncherHandle() *EndIf *If $Status = "LauncherFail" Or WinExists($SROLauncher) And WinExists($SROClient) = 0 Then * * WinKill($SROLauncher) * * LauncherHandle() *EndIf *If * $Status = "LauncherSucces" Or WinExists($SROLauncher) And WinExists($SROClient) Then * * Do * * * *LoginHandle() * * * *If $Status = "LoginDisconnected" Then * * * * * WinKill($SROLauncher) * * * * * LauncherHandle() * * * *EndIf * * Until $Status = "LoginConnected" * * CharHandle() * * WinKill($SROLauncher) *EndIf *If $Status = "Character" Or WinExists($SROClient) And WinExists($SROLauncher) = 0 Then * * SrobotHandle() * * Sleep(7000) * * GameHandle() * * If $PartyMatch = "Yes" Or $PartyMatch = "yes" Then * * * *$Status = "PartyMatch" * * * *PartyHandle() * * EndIf * * Do * * * *GameHandle() * * * *If $PartyCheck = "Yes" Or $PartyCheck = "yes" Then * * * * * $Status = "PartyCheck" * * * * * PartyHandle() * * * *EndIf * * * *If $InsertSend = "Yes" Or $InsertSend = "yes" Then * * * * * InsertHandle() * * * *EndIf * * * *If $FreezeCheck = "Yes" Or $FreezeCheck = "yes" Then * * * * * FreezeHandle() * * * *EndIf * * Until $Status = "GameDisconnected" *EndIf WEnd ;=========================================================================== ; * * * * * * Funcs ;=========================================================================== Func SrobotHandle() *If ProcessExists($SroBotExe) = 0 Then * * SetLog("Launching srobot.") * * Run($SrobotPath & "\" & $SroBotExe) * * SetLog("Waiting srobot process.") * * ProcessWait($SroBotExe) * * SetLog("Srobot launched.") * * Sleep(4000) *Else * * If $SrobotLogin = "Yes" Or $SrobotLogin = "yes" Then * * * *ControlSend($SROClient, "", "", "{HOME}") * * * *Sleep(1000) * * * *ControlSend($SrobotTitle, "", "3290", $SrobotAcc, 1) * * * *SetLog("Sending srobot account infomation.") * * * *Sleep($SaDelay) * * * *SetLog("Sleeping srobot account delay.") * * * *ControlSend($SrobotTitle, "", "3285", $SrobotPass, 1) * * * *SetLog("Sending srobot password infomation.") * * * *Sleep($SpDelay) * * * *SetLog("Sleeping srobot password delay.") * * * *ControlClick($SrobotTitle, "", 3291) * * * *SetLog("Srobot logged in.") * * * *Sleep(500) * * * *ControlSend($SROClient, "", "", "{HOME}") * * EndIf * * If $Status = "Character" Then * * * *SetLog("Restarting srobot.") * * * *Send("{INSERT}") * * * *Send("{INSERT}") * * * *SetLog("Srobot restarted.") * * * *MouseWheel("Down", 7) * * * *SetLog("Adjusting sro view.") * * EndIf *EndIf EndFunc;==>SrobotHandle Func CrackHandle() *If ProcessExists($CrackExe) = 0 Then * * SetLog("Launching srobot's crack.") * * Run($CrackPath & "\" & $CrackExe) * * SetLog("Waiting crack process.") * * ProcessWait($CrackExe) * * SetLog("Crack process found.") * * Sleep(2000) *EndIf EndFunc;==>CrackHandle Func LauncherHandle() *SetLog("Launching Silkroad online.") *Run($SROPath & "\" & $SROLExe) *SetLog("Silkroad online executed.") *$LauncherWait = WinWait($SROLauncher) *WinActivate($SROLauncher) *SetLog("Silkroad launcher found.") *SetLog("Sleeping launcher delay.") *Sleep($LDelay) *SetLog("Launcher delay slept (" & $LDelay & " ms.)") *ControlClick($SROLauncher, "", 1000) *$ClientWait = WinWait($SROClient, "", 15) *If $ClientWait = 1 Then * * $Status = "LauncherSucces" * * WinActivate($SROClient) * * SetLog("Silkroad client found.") * * SetLog("Sleeping client delay.") * * Sleep($CDelay) * * SetLog("Client delay slept (" & $CDelay & " ms.)") *ElseIf $ClientWait = 0 Then * * $Status = "LauncherFail" * * SetLog("Client wait delay elapsed (15 sec, restarting silkroad") *EndIf EndFunc;==>LauncherHandle Func LoginHandle() *If $ResizeClient = "Yes" Or $ResizeClient = "yes" Then * * Send("!#{ENTER}") * * Sleep($ReDelay) *EndIf *Send("{Enter}") *Sleep(2000) *SetLog("Sending account information.") *Send($SROAccount, 1) *SetLog("Sleeping account delay.") *Sleep($ADelay) *SetLog("Account delay slept (" & $ADelay & " ms.)") *Send("{TAB}") *SetLog("Sending password information.") *Send($SROPassword, 1) *SetLog("Sleeping password delay.") *Sleep($PDelay) *SetLog("Password delay slept (" & $PDelay & " ms.)") *WinSetState($CrackTitle, "", @SW_RESTORE) *Sleep(500) *WinActivate($CrackTitle) *Select * * Case $Resolution = "800x600" * * * *MouseClick("Left", 345, 466, 1, 0) * * * *If PixelGetColor(460, 262) = 0 Then * * * * * SetLog("Trying to log in.") * * * * * Do * * * * * * *If PixelGetColor(460, 262) = 0 Then * * * * * * * * Send("{Enter}") * * * * * * * * Sleep($LoDelay) * * * * * * *EndIf * * * * * Until PixelGetColor(460, 262) <> 0 * * * * * Send("{Enter}") * * * * * Sleep($RDelay) * * * * * If WinExists($SROClient) = 1 Then * * * * * * *$Status = "LoginConnected" * * * * * * *SetLog("Connected to the server after " & $LoginRetry & " restarts.") * * * * * Else * * * * * * *SetLog("Disconnected from the server, restarting.") * * * * * * *$LoginRetry = $LoginRetry + 1 * * * * * * *$Status = "LoginDisconected" * * * * * EndIf * * * *EndIf * * Case $Resolution = "1024x768" * * * *MouseClick("Left", 460, 560, 1, 0) * * * *If PixelGetColor(626, 334) = 0 Then * * * * * SetLog("Trying to log in.") * * * * * Do * * * * * * *If PixelGetColor(626, 334) = 0 Then * * * * * * * * Send("{Enter}") * * * * * * * * Sleep($LoDelay) * * * * * * *EndIf * * * * * Until PixelGetColor(626, 334) <> 0 * * * * * Send("{Enter}") * * * * * Sleep($RDelay) * * * * * If WinExists($SROClient) = 1 Then * * * * * * *$Status = "LoginConnected" * * * * * * *SetLog("Connected to the server after " & $LoginRetry & " restarts.") * * * * * Else * * * * * * *SetLog("Disconnected from the server, restarting.") * * * * * * *$LoginRetry = $LoginRetry + 1 * * * * * * *$Status = "LoginDisconnected" * * * * * EndIf * * * *EndIf * * Case $Resolution = "1280x1024" * * * *MouseClick("Left", 587, 652, 1, 0) * * * *If PixelGetColor(734, 424) = 0 Then * * * * * SetLog("Trying to log in.") * * * * * Do * * * * * * *If PixelGetColor(734, 424) = 0 Then * * * * * * * * Send("{Enter}") * * * * * * * * Sleep($LoDelay) * * * * * * *EndIf * * * * * Until PixelGetColor(734, 424) <> 0 * * * * * Send("{Enter}") * * * * * Sleep($RDelay) * * * * * If WinExists($SROClient) = 1 Then * * * * * * *$Status = "LoginConnected" * * * * * * *SetLog("Connected to the server after " & $LoginRetry & " restarts.") * * * * * Else * * * * * * *SetLog("Disconnected from the server, restarting.") * * * * * * *$LoginRetry = $LoginRetry + 1 * * * * * * *$Status = "LoginDisconnected" * * * * * EndIf * * * *EndIf *EndSelect EndFunc;==>LoginHandle Func CharHandle() *$Status = "Character" *SetLog("Choosing character.") *Select * * Case $Resolution = "800x600" * * * *Select * * * * * Case $CharPos = 1 * * * * * * *MouseClick("Left", 255, 313, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 255, 313, 1, 0) * * * * * * *SetLog("Character 1 selected.") * * * * * * *Sleep($C2Delay) * * * * * * *MouseClick("Left", 533, 559, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 533, 559, 1, 0) * * * * * * * * * * * * Case $CharPos = 2 * * * * * * *MouseClick("Left", 408, 300, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 408, 300, 1, 0) * * * * * * *SetLog("Character 2 selected.") * * * * * * *Sleep($C2Delay) * * * * * * *MouseClick("Left", 533, 559, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 533, 559, 1, 0) * * * * * * * * * * * * Case $CharPos = 3 * * * * * * *MouseClick("Left", 562, 302, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 562, 302, 1, 0) * * * * * * *SetLog("Character 3 selected.") * * * * * * *Sleep($C2Delay) * * * * * * *MouseClick("Left", 533, 559, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 533, 559, 1, 0) * * * *EndSelect * * * * * * Case $Resolution = "1024x768" * * * *Select * * * * * Case $CharPos = 1 * * * * * * *MouseClick("Left", 330, 373, 1, 0) * * * * * * *Sleep(500) * * * * * * *MouseClick("Left", 330, 373, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 330, 373, 1, 0) * * * * * * *SetLog("Character 1 selected.") * * * * * * *Sleep($C2Delay) * * * * * * *MouseClick("Left", 763, 704, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 763, 704, 1, 0) * * * * * * * * * * * * Case $CharPos = 2 * * * * * * *MouseClick("Left", 523, 381, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 523, 381, 1, 0) * * * * * * *SetLog("Character 2 selected.") * * * * * * *Sleep($C2Delay) * * * * * * *MouseClick("Left", 763, 704, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 763, 704, 1, 0) * * * * * * * * * * * * Case $CharPos = 3 * * * * * * *MouseClick("Left", 712, 372, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 712, 372, 1, 0) * * * * * * *SetLog("Character 3 selected.") * * * * * * *Sleep($C2Delay) * * * * * * *MouseClick("Left", 763, 704, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 763, 704, 1, 0) * * * *EndSelect * * * * * * Case $Resolution = "1280x1024" * * * *Select * * * * * Case $CharPos = 1 * * * * * * *MouseClick("Left", 387, 505, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 387, 505, 1, 0) * * * * * * *SetLog("Character 1 selected.") * * * * * * *Sleep($C2Delay) * * * * * * *MouseClick("Left", 1007, 910, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 1007, 910, 1, 0) * * * * * * * * * * * * Case $CharPos = 2 * * * * * * *MouseClick("Left", 655, 517, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 655, 517, 1, 0) * * * * * * *SetLog("Character 2 selected.") * * * * * * *Sleep($C2Delay) * * * * * * *MouseClick("Left", 1007, 910, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 1007, 910, 1, 0) * * * * * * * * * * * * Case $CharPos = 3 * * * * * * *MouseClick("Left", 872, 532, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 872, 532, 1, 0) * * * * * * *SetLog("Character 3 selected.") * * * * * * *Sleep($C2Delay) * * * * * * *MouseClick("Left", 1007, 910, 1, 0) * * * * * * *Sleep(200) * * * * * * *MouseClick("Left", 1007, 910, 1, 0) * * * *EndSelect *EndSelect *SetLog("Waiting to get ingame.") *SetLog("Sleeping 'load game' delay.") *Sleep($GDelay) *SetLog("'Load game' delay slept (" & $GDelay & " ms.)") EndFunc;==>CharHandle Func PartyHandle() *If $Status = "PartyMatch" Then * * Select * * * *Case $Resolution = "1024x768" * * * * * WinSetState($CrackTitle, "", @SW_MINIMIZE) * * * * * MouseClick("Left", 830, 730, 1, 0) * * * * * Sleep(1500) * * * * * MouseClick("Left", 570, 540, 1, 0) * * * * * Sleep(1500) * * * * * MouseClick("Left", 870, 655, 1, 0) * * * * * Sleep(3000) * * * * * GameHandle() * * * * * Select * * * * * * *Case $MinParty = 2 * * * * * * * * Do * * * * * * * * * *MouseClick("Left", 390, 590, 1, 0) * * * * * * * * * *Sleep(2000) * * * * * * * * * *MouseClick("Left", 465, 530, 1, 0) * * * * * * * * * *Sleep($PaDelay) * * * * * * * * Until PixelGetColor(16, 108) = 0 * * * * * * * * MouseClick("Left", 887, 161, 1, 0) * * * * * * * * Sleep(2000) * * * * * * * * MouseClick("Left", 962, 282, 1, 0) * * * * * * * * * * * * * * *Case $MinParty = 3 * * * * * * * * Do * * * * * * * * * *GameHandle() * * * * * * * * * *If ProcessExists($SROExe) = 0 Then * * * * * * * * * * *$Status = "GameDisconnected" * * * * * * * * * * *ExitLoop * * * * * * * * * *EndIf * * * * * * * * * *MouseClick("Left", 390, 590, 1, 0) * * * * * * * * * *Sleep(2000) * * * * * * * * * *MouseClick("Left", 465, 530, 1, 0) * * * * * * * * * *Sleep($PaDelay) * * * * * * * * * *If PixelGetColor(16, 108) = 0 And PixelGetColor(15, 150) <> 0 Then * * * * * * * * * * * MouseClick("Left", 940, 350, 1, 0) * * * * * * * * * * * Sleep(1000) * * * * * * * * * * * MouseClick("Left", 940, 390, 1, 0) * * * * * * * * * * * Sleep(1000) * * * * * * * * * * * MouseClick("Left", 940, 420, 1, 0) * * * * * * * * * * * Sleep(1000) * * * * * * * * * * * MouseClick("Left", 940, 460, 1, 0) * * * * * * * * * *EndIf * * * * * * * * Until PixelGetColor(15, 150) = 0 * * * * * * * * MouseClick("Left", 887, 161, 1, 0) * * * * * * * * Sleep(2000) * * * * * * * * MouseClick("Left", 962, 282, 1, 0) * * * * * * * * * * * * * * *Case $MinParty = 4 * * * * * * * * Do * * * * * * * * * *MouseClick("Left", 390, 590, 1, 0) * * * * * * * * * *Sleep(2000) * * * * * * * * * *MouseClick("Left", 465, 530, 1, 0) * * * * * * * * * *Sleep($PaDelay) * * * * * * * * * *If PixelGetColor(16, 108) = 0 And PixelGetColor(15, 150) = 0 And PixelGetColor(16, 192) <> 0 Then * * * * * * * * * * * MouseClick("Left", 940, 350, 1, 0) * * * * * * * * * * * Sleep(1000) * * * * * * * * * * * MouseClick("Left", 940, 390, 1, 0) * * * * * * * * * * * Sleep(1000) * * * * * * * * * * * MouseClick("Left", 940, 420, 1, 0) * * * * * * * * * * * Sleep(1000) * * * * * * * * * * * MouseClick("Left", 940, 460, 1, 0) * * * * * * * * * *EndIf * * * * * * * * Until PixelGetColor(16, 192) = 0 * * * * * * * * MouseClick("Left", 887, 161, 1, 0) * * * * * * * * Sleep(2000) * * * * * * * * MouseClick("Left", 962, 282, 1, 0) * * * * * EndSelect * * * * * * * * *Case $Resolution = "1280x1024" * * * * * MouseClick("Left", 960, 980, 1, 0) * * * * * Sleep(1500) * * * * * MouseClick("Left", 825, 800, 1, 0) * * * * * Sleep(1500) * * * * * MouseClick("Left", 1125, 910, 1, 0) * * * * * Sleep(3000) * * * * * Select * * * * * * *Case $MinParty = 2 * * * * * * * * Do * * * * * * * * * *MouseClick("Left", 520, 720, 1, 0) * * * * * * * * * *Sleep(2000) * * * * * * * * * *MouseClick("Left", 595, 659, 1, 0) * * * * * * * * * *Sleep($PaDelay) * * * * * * * * Until PixelGetColor(15, 105) = 0 * * * * * * * * MouseClick("Left", 1015, 290, 1, 0) * * * * * * * * Sleep(2000) * * * * * * * * MouseClick("Left", 1120, 535, 1, 0) * * * * * * * * * * * * * * *Case $MinParty = 3 * * * * * * * * Do * * * * * * * * * *MouseClick("Left", 520, 720, 1, 0) * * * * * * * * * *Sleep(2000) * * * * * * * * * *MouseClick("Left", 595, 659, 1, 0) * * * * * * * * * *Sleep($PaDelay) * * * * * * * * * *If PixelGetColor(15, 105) = 0 And PixelGetColor(15, 150) <> 0 Then * * * * * * * * * * * MouseClick("Left", 1195, 605, 1, 0) * * * * * * * * * * * Sleep(1000) * * * * * * * * * * * MouseClick("Left", 1195, 645, 1, 0) * * * * * * * * * * * Sleep(1000) * * * * * * * * * * * MouseClick("Left", 1195, 680, 1, 0) * * * * * * * * * * * Sleep(1000) * * * * * * * * * * * MouseClick("Left", 1195, 715, 1, 0) * * * * * * * * * *EndIf * * * * * * * * Until PixelGetColor(15, 150) = 0 * * * * * * * * MouseClick("Left", 1015, 290, 1, 0) * * * * * * * * Sleep(2000) * * * * * * * * MouseClick("Left", 1220, 535, 1, 0) * * * * * * * * * * * * * * *Case $MinParty = 4 * * * * * * * * Do * * * * * * * * * *MouseClick("Left", 520, 720, 1, 0) * * * * * * * * * *Sleep(2000) * * * * * * * * * *MouseClick("Left", 595, 659, 1, 0) * * * * * * * * * *Sleep($PaDelay) * * * * * * * * * *If PixelGetColor(15, 105) = 0 And PixelGetColor(15, 150) = 0 And PixelGetColor(15, 195) <> 0 Then * * * * * * * * * * * MouseClick("Left", 1195, 605, 1, 0) * * * * * * * * * * * Sleep(1000) * * * * * * * * * * * MouseClick("Left", 1195, 645, 1, 0) * * * * * * * * * * * Sleep(1000) * * * * * * * * * * * MouseClick("Left", 1195, 680, 1, 0) * * * * * * * * * * * Sleep(1000) * * * * * * * * * * * MouseClick("Left", 1195, 715, 1, 0) * * * * * * * * * *EndIf * * * * * * * * Until PixelGetColor(15, 195) = 0 * * * * * * * * MouseClick("Left", 1015, 290, 1, 0) * * * * * * * * Sleep(2000) * * * * * * * * MouseClick("Left", 1220, 535, 1, 0) * * * * * EndSelect * * EndSelect *ElseIf $Status = "PartyCheck" Then * * Select * * * *Case $Resolution = "1024x768" * * * * * Select * * * * * * *Case $MinParty = 2 * * * * * * * * If PixelGetColor(16, 108) <> 0 Then * * * * * * * * * *$Status = "PartyMatch" * * * * * * * * * *PartyHandle() * * * * * * * * EndIf * * * * * * *Case $MinParty = 3 * * * * * * * * If PixelGetColor(15, 150) <> 0 Then * * * * * * * * * *$Status = "PartyMatch" * * * * * * * * * *PartyHandle() * * * * * * * * EndIf * * * * * * *Case $MinParty = 4 * * * * * * * * If PixelGetColor(16, 192) <> 0 Then * * * * * * * * * *$Status = "PartyMatch" * * * * * * * * * *PartyHandle() * * * * * * * * EndIf * * * * * EndSelect * * * *Case $Resolution = "1280x1024" * * * * * Select * * * * * * *Case $MinParty = 2 * * * * * * * * If PixelGetColor(15, 105) <> 0 Then * * * * * * * * * *$Status = "PartyMatch" * * * * * * * * * *PartyHandle() * * * * * * * * EndIf * * * * * * *Case $MinParty = 3 * * * * * * * * If PixelGetColor(15, 150) <> 0 Then * * * * * * * * * *$Status = "PartyMatch" * * * * * * * * * *PartyHandle() * * * * * * * * EndIf * * * * * * *Case $MinParty = 4 * * * * * * * * If PixelGetColor(15, 195) <> 0 Then * * * * * * * * * *$Status = "PartyMatch" * * * * * * * * * *PartyHandle() * * * * * * * * EndIf * * * * * EndSelect * * EndSelect *EndIf EndFunc;==>PartyHandle Func FreezeHandle() *$FreezeCheck1 = PixelChecksum($FreezeLeft, $FreezeTop, $FreezeRight, $FreezeBottom, 2) *Sleep(10000) *$FreezeCheck2 = PixelChecksum($FreezeLeft, $FreezeTop, $FreezeRight, $FreezeBottom, 2) *If $FreezeCheck1 = $FreezeCheck2 Then * * If $InsertSend = "Yes" Or $InsertSend = "yes" Then * * * * * * *$ElapsedFreezeTime = $ElapsedFreezeTime + 20000 + $EnDelay * * * * * * *$Status = "Freezed" * * Else * * $ElapsedFreezeTime = $ElapsedFreezeTime + 10000 + $EnDelay * * $Status = "Freezed" * * EndIf *EndIf *If $Status = "Freezed" And $ElapsedFreezeTime >= $FDelay * 60 * 1000 Then * * SetLog("Screen has been freezed for/over " & $FDelay * 60 * 1000 *& " mins. , restarting silkroad.") * * $ElapsedFreezeTime = 0 * * $Status = "GameDisconnected" * * WinKill($SROClient) *EndIf EndFunc;==>FreezeHandle Func InsertHandle() *Sleep(10000) *If $FreezeCheck = "Yes" Or $FreezeCheck = "yes" Then * * * *$ElapsedInsertTime = $ElapsedFreezeTime + 20000 + $EnDelay *EndIf *$ElapsedInsertTime = $ElapsedFreezeTime + 10000 + $EnDelay *If $ElapsedInsertTime >= $IDelay * 60 * 1000 Then * * $ElapsedInsertTime = 0 * * ControlSend($SROClient, "", "", "{INSERT}") * * ControlSend($SROClient, "", "", "{INSERT}") *EndIf EndFunc;==>InsertHandle Func GameHandle() *ControlSend($SROClient, "", "", "{ENTER}") *Sleep($EnDelay) *If ProcessExists($SROExe) Then * * $Status = "GameConnected" *ElseIf ProcessExists($SROExe) = 0 Then * * $Status = "GameDisconnected" *EndIf EndFunc;==>GameHandle Func SetLog($LogIt) *$Date = @MDAY & "/" & @MON & " " & @HOUR & ":" & @MIN & ":" & @SEC & " > " *$Log = FileOpen("SRO_restart.log.txt", 1) *FileWrite($Log, $Date & $LogIt & @CRLF) *FileClose($Log) EndFunc;==>SetLog Func Minimize() *Const $Minimize = WinSetState($SROClient, "", @SW_MINIMIZE) EndFunc;==>Minimize Func Pause() *$Paused = Not $Paused *While $Paused * * Sleep(100) * * ToolTip('"Restart script paused"', 0, 0) *WEnd *ToolTip("") EndFunc;==>Pause
Now compile the
sro_restart.ini
Code:
;============================================================================== ;=============== julmuri's srobot restart script configuration ================ ;====== http://www.netikka.net/julmuri/Silkroad%20Online/SRO_restart.rar ====== ;============================================================================== ; All lines starting with a ";" are comments... All others are real variables. ; NOTE: If your delays are too low, they will most likely cause script to fail. ; Thanks for Bl4nk for making 1280x1024resolution support, guess im too lazy.:) ;============================================================================== [Settings] ;############################################################################## ; ; * * * * * * * * * * * * * * * * *GENERAL SETTINGS ; ; * * * Insert_Send => Set Yes if you want script to send insert to client time to time. ; ; * * * Srobot_Start => Set Yes if you want script to start srobot for you. ; ; * * * Srobot_Path => Path where you have srobot1.10 installed. ; ; * * * Srobot_Exe => Name of srobot executable (no need to change, usually). ; ; * * * Srobot_Title => Title of srobot config window (no need to change, usually). ; ; * * * Crack_Start => *Set Yes if you want script to start srobot's crack for you. ; ; * * * Crack_Path => Path where you have crack installed. ; ; * * * Crack_Exe => Name of srobot crack executable (no need to change, usually). ;. ; * * * Crack_Title => Title of crack window (no need to change, usually). ; ; * * * Party_Match => Set Yes If you want script to look party for you. ; ; * * * Party_Min => Minimun amount of players required in party to stay. 2-4. ; ; * * * Party_Check => Set Yes if you want script to check that your in party where Party_Min = True ; ; * * * Freeze_Check => Set Yes if you want script to check that your client isnt freezed. ; ; * * * NOTE: Dont edit Freeze_Coords if you dont know what your doing. ; * * * Freeze_CoordL => Left coord of freeze check pixelchecksum. ; ; * * * Freeze_CoordT *= Top coord of freeze check pixelchecksum. ; ; * * * Freeze_CoordR => Right coord of freeze check pixelchecksum. ; ; * * * Freeze_CoordB => Bottom coord of freeze check pixelchecksum. ; ; * * * Silkroad_Resize => Set Yes if your silkroad starts in windowed mode, ; * * * in order to work properly. ; ; * * * NOTE: party script isnt yet working with 800x600. ; * * * Silkroad_Resolution => Set 800x600, 1024x768 or 1280x1024. ; ; * * * Silkroad_Path => Path where you have Silkroad installed. ; * Example of a path: C:\Program Files\Silkroad ; ; * * * Silkroad_LExe => Name of Silkroad launcher executable (no need to change, usually). ; ; * * * Silkroad_Exe => Name of Silkroad client executable (no need to change, usually). ; ; * * * Silkroad_Launcher => Title of Silkroad launcher (no need to change, usually). ; ; * * * Silkroad_Client => Title of Silkroad client (no need to change, usually). ; ;============================================================================== Insert_Send = No Srobot_Start = Yes Srobot_Path = C:\sroboten1.18 Srobot_Exe = srobot.exe Srobot_Title = Silkroad Online-Power Bot Crack_Start = Yes Crack_Path = C:\Crackit-1070 Crack_Exe = Crackit-1070.exe Crack_Title = SROBOT Crackit V1.070 Party_Match = Yes Party_Min = 3 Party_Check = No Freeze_Check = No Freeze_CoordL = 15 Freeze_CoordT = 215 Freeze_CoordR = 390 Freeze_CoordB = 525 Silkroad_Resize = No Silkroad_Resolution = 1024x768 Silkroad_Path = C:\Program Files\Silkroad Silkroad_LExe = Silkroad.exe Silkroad_Exe = srO_client.exe Silkroad_Launcher = Silkroad Online Launcher Silkroad_Client = SRO_Client ;============================================================================== [Login] ;############################################################################## ; ; * * * * * * * * * * * * * * * * *LOGIN SETTINGS ; ; * * * Login_Account => *Your Silkroad account. ; ; * * * Login_Password => Your Silkroad password. ; ; * * * Login_Character_Pos => Your character position 1-3 (from left to right). ; ; * * * Login_Srobot => Set Yes if you want to log on paid srobot account. ; ; * * * Login_BOTAccount => Your srobot account. ; ; * * * Login_BOTPassword => Your srobot password. ; ;============================================================================== Login_SROAccount = Account Login_SROPassword = Password Login_Character_Pos = 1 Login_Srobot = No Login_BOTAccount = Account Login_BOTPassword = Password ;============================================================================== [Delays] ;############################################################################## ; ; * * * * * * * * * * * * * * * * *DELAY SETTINGS ; ; * * * NOTE most delays are in milliseconds, 1second = 1000milliseconds. ; * * * NOTE if your delays are too low, that will most likely cause script to fail. ; ; * * * Delay_Launcher => Delay when launching Silkroad launcher (in millis.). ; ; * * * Delay_Client => Delay when launching Silkroad client (in millis.). ; ; * * * Delay_SROAccount => Delay when typing Silkroad account (in millis.). ; ; * * * Delay_SROPassword => Delay when typing Silkroad password (in millis.). ; ; * * * Delay_Login => Delay when connecting to game server (in millis.). ; ; * * * Delay_Char => Delay when chosing character (in millis.). ; ; * * * Delay_2InGame => Delay when going ingame from char select (in millis.). ; ; * * * Delay_BOTAccount => Delay when typing srobot account (in millis.). ; ; * * * Delay_BOTPassword => Delay when typing srobot password (in millis.). ; ; * * * Delay_Party => Delay when using party match (in millis.). ; ; * * * Delay_Enter => Delay between enters at ingame (in millis.). ; ; * * * Delay_Restart => Delay when restarting Silkroad (in millis.). ; ; * * * Delay_Resize => Delay when resizing sro client (in millis.). ; ; * * * Delay_Freeze => Delay how long screen must be freezed to restart (in mins.). ; ; * * * Delay_Insert => Delay between insert sends (in mins.). ; ;============================================================================== Delay_Launcher = 8000 Delay_Client = 7500 Delay_SROAccount = 2500 Delay_SROPassword = 1000 Delay_BotAccount = 1000 Delay_BotPassword = 1000 Delay_Login = 6500 Delay_Char = 6500 Delay_2InGame = 12000 Delay_Party = 7000 Delay_Enter = 5000 Delay_Restart = 5000 Delay_Resize = 3500 Delay_Freeze = 10 Delay_Insert = 5 ;==============================================================================
After u created both files. One will have autoit icon the other one will have ini. type icon. Place both of em in bot directory.
Then run compile script to .exe from autoit menu.
Configure INI acording yer settings. Do not change values unless u know what ur doing. Script is meant to be used under 1024x768 in-game resolution. That's changable too.
Enjoy.