Dragon-RD Posted November 25, 2005 Share Posted November 25, 2005 (edited) Hey guys here's the deal. I have never programed in anything before and i thought id start with Autoit3. After doing the tuts included in the helpfile i thought id try and make a program that ran an exe for me using a .ini file. I got a few errors and sorted them out studying the helpfile as i went. After no success i decided it was time to check some sorce code out. So i downloaded a Diablo2 pindle bot sorce and looked into it.Well it wont run the exe file i want it too , doesnt come up with an error or anything. It just wont load up. Well i looked at the pindlebot somemore and saw he used a "MyIniRead" function. But when i try it out it tells me its an unknown function, so i'm guessing it is as there isnt anything in the helpfile about it. I'm at a loss to whats going on and any help would be great.Here's my code , i'm pretty sure its 200% trash as ive never coded before but hey we all have to start somewhere.Run the exe code : $SRPath = IniRead("silkroad.ini", "GLOBAL", "SRPath", "") $SRExe = IniRead("silkroad.ini", "GLOBAL", "SRExe", "Silkroad.exe") $SRWinTitle = IniRead("silkroad.ini", "GLOBAL", "SRWinTitle", "") Func StartSR() Run($SRPath & $SRExe) WinWaitActive("Silkroad Online") WinWaitActive("Silkroad Online", "The server is in examination or out of working time. Connect http://www.silkroadonline.co.kr to see more information.") Sleep(10000) EndFuncIni[GLOBAL] SRPath=C:\Program Files\Silkroad SRExe=Silkroad.exe SRWinTitle=Silkroad Online Edited November 25, 2005 by Dragon-RD Link to comment Share on other sites More sharing options...
ChrisL Posted November 25, 2005 Share Posted November 25, 2005 (edited) Run($SRPath & $SRExe , $SRPath) There was no Directory specified for the exe to run in so it was trying to run local to the script I think you should have a \ at the end of SRPath=C:\Program Files\Silkroad or add it in to the run command Run($SRPath & "\" & $SRExe , $SRPath) Is the ini file local tot he script? if not you need to specify the full location to the ini, IniRead("C:\Program Files\Silkroad\silkroad.ini", "GLOBAL", "SRPath", "") Edited November 25, 2005 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Developers Jos Posted November 25, 2005 Developers Share Posted November 25, 2005 Need a \ between directory and program: $SRPath & "\" & $SRExe SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
greenmachine Posted November 25, 2005 Share Posted November 25, 2005 (edited) ... Run the exe code : $SRPath = IniRead("silkroad.ini", "GLOBAL", "SRPath", "") $SRExe = IniRead("silkroad.ini", "GLOBAL", "SRExe", "Silkroad.exe") $SRWinTitle = IniRead("silkroad.ini", "GLOBAL", "SRWinTitle", "") Func StartSR() Run($SRPath & $SRExe) WinWaitActive("Silkroad Online") WinWaitActive("Silkroad Online", "The server is in examination or out of working time. Connect http://www.silkroadonline.co.kr to see more information.") Sleep(10000) EndFunc Ini [GLOBAL] SRPath=C:\Program Files\Silkroad SRExe=Silkroad.exe SRWinTitle=Silkroad Online The Func StartSR() statement is defining the function StartSR() for the rest of the program. It is not actually calling the function, so that's why nothing is happening. All you have to do is add a single line, StartSR(), before the function definition, and it will run. By putting that line there, you are calling the function, which tells the program to run whatever is inside the function definition. Another way would be to get rid of the Func StartSR() and EndFunc lines, because you really don't need a function for this short of a program. Version 1: $SRPath = IniRead("silkroad.ini", "GLOBAL", "SRPath", "") $SRExe = IniRead("silkroad.ini", "GLOBAL", "SRExe", "Silkroad.exe") $SRWinTitle = IniRead("silkroad.ini", "GLOBAL", "SRWinTitle", "") StartSR();<== this line calls the below function, and the semi-colon means that this is a comment. Func StartSR() Run($SRPath & "\" & $SRExe) WinWaitActive("Silkroad Online") WinWaitActive("Silkroad Online", "The server is in examination or out of working time. Connect http://www.silkroadonline.co.kr to see more information.") Sleep(10000) EndFunc Version 2: $SRPath = IniRead("silkroad.ini", "GLOBAL", "SRPath", "") $SRExe = IniRead("silkroad.ini", "GLOBAL", "SRExe", "Silkroad.exe") $SRWinTitle = IniRead("silkroad.ini", "GLOBAL", "SRWinTitle", "") Run($SRPath & "\" & $SRExe) WinWaitActive("Silkroad Online") WinWaitActive("Silkroad Online", "The server is in examination or out of working time. Connect http://www.silkroadonline.co.kr to see more information.") Sleep(10000) Edited November 25, 2005 by greenmachine Link to comment Share on other sites More sharing options...
Dragon-RD Posted November 25, 2005 Author Share Posted November 25, 2005 Thanks ALOT guys for the replys , its working great!. Link to comment Share on other sites More sharing options...
ChrisL Posted November 25, 2005 Share Posted November 25, 2005 The Func StartSR() statement is defining the function StartSR() for the rest of the program. It is not actually calling the function, so that's why nothing is happening.Oh yeah.. hadn't noticed that [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire 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