Sign in to follow this  
Followers 0
Overlord

game won't start

11 posts in this topic

it's very strange but my game won't start if I use the script. Did I do something wrong?

I attached my script and my ini file. I really don't get it why it won't run.

ini file:

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

won't work with or without ""

script:

;; start script
run($path)
sleep(90000)
mpstart1()
if $type="closed" then closed1()
if $type="open" then open1()
sleep(50000)
if $location = "1" then Loc1()
if $location = "2" then Loc2()
if $location = "3" then Loc3()
if $location = "4" then Loc4()
if $location = "5" then Loc5()
if $location = "6" then Loc6()
if $location = "7" then Loc7()
if $location = "8" then Loc8()

;; all scripts

Func mpstart1() ;; click for multiplayer startup
MouseClick("left",500,350)
EndFunc
func closed1() ;;click for closed internet
MouseClick("left",500,345)
Sleep(1000)
Send($password)
Send("{ENTER}")
Sleep(1000)
MouseClick("left",515,440)
EndFunc
func open1() ;;click for open internet
MouseClick("left",500,380)
Sleep(1000)
Send($password)
Send("{ENTER}")
Sleep(1000)
MouseClick("left",515,440)
EndFunc
func Loc1() ;;char locatie 1
MouseClick("left",100,450,2)
EndFunc
func Loc2() ;;char locatie 2
MouseClick("left",220,450,2)
EndFunc
func Loc3() ;;char locatie 3
MouseClick("left",370,450,2)
EndFunc
func Loc4() ;;char locatie 4
MouseClick("left",540,450,2)
EndFunc
func Loc5() ;;char locatie 5
MouseClick("left",630,450,2)
EndFunc
func Loc6() ;;char locatie 6
MouseClick("left",730,450,2)
EndFunc
func Loc7() ;;char locatie 7
MouseClick("left",830,450,2)
EndFunc
func Loc8() ;;char locatie 8
MouseClick("left",890,450,2)
EndFunc

Share this post


Link to post
Share on other sites



need to see how you read the ini... and post the text of the ini to make sure it is correct also

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

...Did I do something wrong?...

I'll let Val fix your run game issue... but I thought that you wanted your code small:

http://www.autoitscript.com/forum/index.ph...st&p=202400

;; start script
Run($path)
Sleep(90000)

;; click for multiplayer startup
MouseClick("left", 500, 350, 1, 2)
Sleep(1000)

;; click for closed internet
If $type = "closed" Then MouseClick("left", 500, 345, 1, 2)

;; click for open internet
If $type = "open" Then MouseClick("left", 500, 380, 1, 2)

Sleep(1000)
Send($password)
Send("{ENTER}")
Sleep(50000)

If $location = "1" Then MouseClick("left", 100, 450, 2)
If $location = "2" Then MouseClick("left", 220, 450, 2)
If $location = "3" Then MouseClick("left", 370, 450, 2)
If $location = "4" Then MouseClick("left", 540, 450, 2)
If $location = "5" Then MouseClick("left", 630, 450, 2)
If $location = "6" Then MouseClick("left", 730, 450, 2)
If $location = "7" Then MouseClick("left", 830, 450, 2)
If $location = "8" Then MouseClick("left", 890, 450, 2)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

it's very strange but my game won't start if I use the script. Did I do something wrong?

I attached my script and my ini file. I really don't get it why it won't run.

ini file:

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

won't work with or without ""

script:

CODE
;; start script

Run($path)

Sleep(90000) ; 90s

mpstart1()

If $type = "closed" Then closed1()

If $type = "open" Then open1()

Sleep(50000) ; 50s

If $location = "1" Then Loc1()

If $location = "2" Then Loc2()

If $location = "3" Then Loc3()

If $location = "4" Then Loc4()

If $location = "5" Then Loc5()

If $location = "6" Then Loc6()

If $location = "7" Then Loc7()

If $location = "8" Then Loc8()

;; all scripts

Func mpstart1() ;; click for multiplayer startup

MouseClick("left", 500, 350)

EndFunc ;==>mpstart1

Func closed1() ;;click for closed internet

MouseClick("left", 500, 345)

Sleep(1000)

Send($password)

Send("{ENTER}")

Sleep(1000)

MouseClick("left", 515, 440)

EndFunc ;==>closed1

Func open1() ;;click for open internet

MouseClick("left", 500, 380)

Sleep(1000)

Send($password)

Send("{ENTER}")

Sleep(1000)

MouseClick("left", 515, 440)

EndFunc ;==>open1

Func Loc1() ;;char locatie 1

MouseClick("left", 100, 450, 2)

EndFunc ;==>Loc1

Func Loc2() ;;char locatie 2

MouseClick("left", 220, 450, 2)

EndFunc ;==>Loc2

Func Loc3() ;;char locatie 3

MouseClick("left", 370, 450, 2)

EndFunc ;==>Loc3

Func Loc4() ;;char locatie 4

MouseClick("left", 540, 450, 2)

EndFunc ;==>Loc4

Func Loc5() ;;char locatie 5

MouseClick("left", 630, 450, 2)

EndFunc ;==>Loc5

Func Loc6() ;;char locatie 6

MouseClick("left", 730, 450, 2)

EndFunc ;==>Loc6

Func Loc7() ;;char locatie 7

MouseClick("left", 830, 450, 2)

EndFunc ;==>Loc7

Func Loc8() ;;char locatie 8

MouseClick("left", 890, 450, 2)

EndFunc ;==>Loc8

I think we've been here before, Dude... :D

What sets $path, $type, $location, and $password to valid value? You could change the top like this to see what's up:

;; start script

; Debug info
MsgBox(64, "Debug Info", "Starting values:" & @CRLF & _
        @TAB & "$path = " & $path & @CRLF & _
        @TAB & "$type = " & $type & @CRLF & _
        @TAB & "$location = " & $location & @CRLF & _
        @TAB & "$password = " & $password)

Run($path)

That will tell you if the required vaues are present. :wacko:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

@valuater: here's the ini file:

[startup]

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

password=********

type=closed

@herewasplato: true, I waned it smaller but since some clicks will be recurring, I'm gonna keep using them as a function. That way, I can always recall them. Thx anyway for your help so far!

@PsaltyDS:

What sets $path, $type, $location, and $password to valid value? You could change the top like this to see what's up:

they get read from a ini file.

here's he command's from where to read them:

$path = IniRead( @scriptdir & "\sacred.ini", "startup", "path", "default")
$password = IniRead( @scriptdir & "\sacred.ini", "startup", "password", "default")
$type = IniRead( @scriptdir & "\sacred.ini", "startup", "type", "default")
$char = IniRead( @scriptdir & "\sacred.ini", "character", "selection", "default")
$location = IniRead( @scriptdir & "\sacred.ini", "character", "location", "default")
$pw = IniRead( @scriptdir & "\sacred.ini", "game", "pw", "default")

they are located right above the run($path) line but didn't include them

If I try to start up something else that works (dap, xfire, ...)

when I goto start > run and tell it to run C:\Program Files\Ascaron Entertainment\Sacred Underworld\sacred.exe it works

I hope this clears up a bit.

Share this post


Link to post
Share on other sites

could try:

Run(@Comspec & ' /c "' & $path & '"')
won't work. CTD

another thing I noticed...

in the original game folder is a folder called templates, a txt called debug, explog and global and some other stuff.

when I run the script from my folder on the desktop, the game creates these folder inside my scriptfolder?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

A fantastic chance that you need to set a working directory with FileChangeDir() before using Run() or use the working directory parameter within the Run() function. Software installed and run from the HDD normally require this.

Edited by MHz

Share this post


Link to post
Share on other sites

u mean to tell it from where it should be running?

the normal link has this also. when I start that link it starts but in the properties of that link is a line that says: start in : "C:\Program Files\Ascaron Entertainment\Sacred Underworld"

could that be the reason?

how do I set that parameter?

Share this post


Link to post
Share on other sites

I did mention 2 methods, so here is 2 examples of setting a workingdir other then the @scriptdir.

Changing the working directory of the Run() function only. Notice 2nd parameter.

$workingdir = @ProgramFilesDir & '\Ascaron Entertainment\Sacred Underworld'
$executable = 'start.exe'
Run($workingdir & '\' & $executable, $workingdir)

:D

Share this post


Link to post
Share on other sites

hehe, It's working now.

this even has got me started thinking again.

here's the code I'm using now:

$workingdir = RegRead("HKEY_CURRENT_USER\Software\Ascaron Entertainment\Sacred Underworld","InstallLocation")
$executable = 'sacred.exe'
Run($workingdir & '\' & $executable, $workingdir)
sleep(60000)

no more needing to tell the bot where the game is installed :">

It gives directly a better look to the bot... :D

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