Sign in to follow this  
Followers 0
Overlord

starting up a exe (run())

5 posts in this topic

Hi guys,

I'm having a problem here and really can't find it.

I'm writing a small bot for Sacred Underworld.

my skills in programming suck really but then again, I learned myself vba in 4 months and could program in it with some help off others.

I got a few questions now...

1) I got a script compiled that runs besides the ini file where some parameters can be configured. for testing pursposes I created a msgbox to return my value from my located string in the ini file. This works fine but if you look at the code

$path = IniRead("[b]C:\Documents and Settings\Evil_elf\Desktop\sacred.ini[/b]", "startup", "path", "default")
MsgBox(4096, "Result", $path)
you will see that the location from where he will read my ini is a complete path. can't this be placed as a folder from where the script can ran, whoever wants to use it.

2) my return value from the above line is

path=C:\Program Files\Ascaron Entertainment\Sacred Underworld\sacred.exe

but the program starts and quits directly. why?

does it need to run in a specific folder or something?

Cheers,

Overlord

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You would do something like this for the dir of script

$path = IniRead(@scriptdir & "\sacred.ini", "startup", "path", "default")

Then to run the exe do this

run($path)
Edited by dirtymafia

Share this post


Link to post
Share on other sites

$path = IniRead( @scriptdir & "\sacred.ini", "startup", "path", "default")

This way it works not with the "" around @scriptdir


--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Share this post


Link to post
Share on other sites

$path = IniRead( @scriptdir & "\sacred.ini", "startup", "path", "default")

This way it works not with the "" around @scriptdir

k, thx guys. I will change it in my script. Now I can give that folder any name I want, right?

@Dirtymafia: I had already included that run($path) in my script but I found out meanwhile that sacred w on't start from a commandline.

I tried entering the path in my addressbar on my computer and did get the same result. Looks like I need to contact sacred to solve this.

Thx guys!!

Share this post


Link to post
Share on other sites

yup! it wroks like a charm now!!!

you guys are the greatest!

Share this post


Link to post
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
Sign in to follow this  
Followers 0