Jump to content

Sims 2 Auto It Script Help


ender341

Recommended Posts

I have a working script that runs fine if i run it in windows, but if I try to run in from RunOnceEx it tells me it can't find

C:\AutoRunGUI.dll

but the script is being run from

%PP%Disk Images\Disk1

so if anything it should be searching there

so my question is does anyone know how to fix this, or if not how to do something similar to:

FOR %%i IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\HD.txt SET PP=%%i:

in autoit?

Link to comment
Share on other sites


Cannot access the best solution to your problem with the current information.

Some questions need answers:

Q. Disk Images\Disk 1. Is this a 1 cd compilation?

Q. Is this a multi-boot cd?

Q. Is Sims 2 loaded from files in a folder or a mounted ISO?

Q. Is Sims 2 loaded from the Harddrive?

Q. Is RunOnceEx running the game executable or AutoRunGUI.dll or ...?

Q. Where is this AutoRunGUI.dll in reference to your RunOnceEx?

Q. Where is this AutoRunGUI.dll in reference to your AutoIt script?

Q. Is your RunOnceEx file a cmd file or a AutoIt script?

Q. Could you post the part of the script that seems to be causing the issue.

I could come up with more questions indeed...

Simply put, too many questions to give any kind of solution currently. I do not know if you even need a find drive letter function, for what type of drive? or that you are presumably using a cmd file, so it would render it perhaps useless in your case? More informatiom would be nice.

Link to comment
Share on other sites

Q. Disk Images\Disk 1. Is this a 1 cd compilation?

Q. Is Sims 2 loaded from files in a folder or a mounted ISO?

Q. Is Sims 2 loaded from the Harddrive?

it is copies of the disks on my HD. The reason it is in the misleading named folders was i was following EA's directions to create a backup on the HD of the Game. there are multiple folders (Disk 1, Disk 2, Disk 3, Disk 4). It is not an image.

Q. Is this a multi-boot cd?

No, it only installs XP Pro

Q. Is RunOnceEx running the game executable or AutoRunGUI.dll or ...?

Runonce is only calling the Autoit Script which in turn calls the AutoRun.exe (which depends on the AutoRunGUI.dll and runs the sims 2 setup)

Q. Where is this AutoRunGUI.dll in reference to your RunOnceEx?

Q. Where is this AutoRunGUI.dll in reference to your AutoIt script?

RunOnceEx is in the root of the drive

the Autoit script and AutoRunGUI.dll file are both in "Images\Disk 1" of the disk

Q. Is your RunOnceEx file a cmd file or a AutoIt script?

its a .cmd file that calls the Autoit Script for some of my installs

Q. Could you post the part of the script that seems to be causing the issue.

RUN("AutoRun.exe")

its at that that it calls autorun which depends on AutoRunGUI.DLL

normally i would just hardcode the drive letter in, but windows install likes to mess with my head and change drive letters on each install i do

its kinda strange though cause it works fine if i double click on the script in windows though

Link to comment
Share on other sites

Well, I would first consider it as a working directory issue. A path could be allocated to the command interpreter, to allow autorun.exe, to see with in it's own directory or you may need to specify in the AutoIt script of the current working directory.

A solution in your AutoIt script could be

Run(@ScriptDir & '\Autorun.exe', @ScriptDir)

or you could go alittle more excessive with

; Backup the current working directory
$directory = @WorkingDir
; Change to the script directory, if not already
FileChangeDir(@ScriptDir)
; Run the executable with the working directory as the script directory
Run(@ScriptDir & '\Autorun.exe', @ScriptDir)

; Restore working directory at end of script
FileChangeDir($directory)

Or you can type Start /? into a command interpreter window, and it will show you parameters to use, especially on the path parameter.

I would try these concepts out before going any further. As I would consider that one of these would solve your problem, with fingers crossed.

Link to comment
Share on other sites

Thank you so much, I have been rackimg my brain over this all day.

If i may ask, what is the differnece between single and double quotes in Autoit?

This Worked

Run(@ScriptDir & '\Autorun.exe', @ScriptDir)

[Edit] I will be Adding this script to the sticky

Edited by ender341
Link to comment
Share on other sites

Single or double quotes are both allowed in AutoIt use. I use singles as I find it convenient in usage. No shift key required to insert, running a Comspec line is easier to manage as doubling up quotes are not normally needed. For example:

Run(@Comspec & ' /c "' & @ScriptDir & '\Autorun.exe" /s')

Notice how I can easily insert the double quotes that Comspec may require for a long path easily within the single quotes. This makes the script easy to interpret.

Link to comment
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...