CyberSlug Posted February 20, 2006 Posted February 20, 2006 (edited) Suggested simplification of your code in post #16. Not tested, of course, but should give you ideas.... expandcollapse popup; Program requires 5 command-line arguments if $cmdLine[0] < 5 Then Exit ;mount image in daemon tools run('"c:\program files\d-tools\daemon.exe" -mount 0,"' & $var5 &'"') sleep (1000) ;start chankast run($CmdLine[4]) WinWaitActive("Chankast Alpha v0.25") ; Set screen resolution to 800x600 or 1024x768 or 1280x1024 Select Case $cmdline[1] = 800 send("!o{down 2}{right 2}{down}{enter}") Case $cmdline[1] = 1024 send("!o{down 2}{right 2}{down 2}{enter}") Case $cmdline[1] = 1280 send("!o{down 2}{right 2}{down 3}{enter}") EndSelect ;set priority to high if $cmdline[2] = "prihigh" then send("!o{down 4}{right}{down}{enter}") ;set capcom hack on if $cmdline[3] = "capyes" then send("!o{down 5}{enter}") ;get rid of stats send("!o{down 2}{right}{down 4}{enter}") ;run the game send("!r{enter}") ;set fullscreen send("!{enter}") exit Edited February 20, 2006 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
KyJelly Posted February 20, 2006 Author Posted February 20, 2006 do i not need to declare $var5? is there any reason (speed wise) for using the refined code?
Developers Jos Posted February 20, 2006 Developers Posted February 20, 2006 do i not need to declare $var5?Think this line should read: run('"c:\program files\d-tools\daemon.exe" -mount 0,"' & $cmdline[5] &'"') is there any reason (speed wise) for using the refined code?Not really.. just looks better 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.
KyJelly Posted February 20, 2006 Author Posted February 20, 2006 ok then and thanks every1 for all your help if any1 cares here is the whole tested script: if $cmdline[0] = 5 Then $Var1 = $cmdline[1] $Var2 = $cmdline[2] $Var3 = $cmdline[3] $Var4 = $cmdline[4] $Var5 = $cmdline[5] EndIf hotkeyset("{esc}", "quit") hotkeyset("c", "capcom") hotkeyset("s", "stats") ;mount image in daemon tools run('"c:\program files\d-tools\daemon.exe" -mount 0,"' & $var5 &'"') sleep (1000) ;start chankast run($Var4) WinWaitActive("Chankast Alpha v0.25") ;set resolution to 800x600 if $Var1 = 800 Then send("!o") send("{down}") send("{down}") send("{right}") send("{right}") send("{down}") send("{enter}") endif ;set resolution to 1024x768 if $Var1 = 1024 then send("!o") send("{down}") send("{down}") send("{right}") send("{right}") send("{down}") send("{down}") send("{enter}") endif ;set resolution to 1280x1024 if $Var1 = 1280 then send("!o") send("{down}") send("{down}") send("{right}") send("{right}") send("{down}") send("{down}") send("{down}") send("{enter}") endif ;set priority to high if $Var2 = "prihigh" then send("!o") send("{down}") send("{down}") send("{down}") send("{down}") send("{right}") send("{down}") send("{enter}") endif ;set capcom hack on if $Var3 = "capyes" then send("!o") send("{down}") send("{down}") send("{down}") send("{down}") send("{down}") send("{enter}") endif ;get rid of stats send("!o") send("{down}") send("{down}") send("{right}") send("{down}") send("{down}") send("{down}") send("{down}") send("{enter}") ;run the game send("!r") send("{enter}") ;set fullscreen send("!{enter}") While 1 Sleep (1000) Wend Func quit() WinClose("Chankast Alpha v0.25") exit Endfunc func capcom() send("!o") send("{down}") send("{down}") send("{down}") send("{down}") send("{down}") send("{enter}") endfunc func stats() send("!o") send("{down}") send("{down}") send("{right}") send("{down}") send("{down}") send("{down}") send("{down}") send("{enter}") endfunc
KyJelly Posted February 20, 2006 Author Posted February 20, 2006 (edited) or this one wich is untested: ; Program requires 5 command-line arguments if $cmdLine[0] < 5 Then Exit hotkeyset("{esc}", "quit") hotkeyset("c", "capcom") hotkeyset("s", "stats") ;mount image in daemon tools run('"c:\program files\d-tools\daemon.exe" -mount 0,"' & $cmdline[5] &'"') sleep (1000) ;start chankast run($CmdLine[4]) WinWaitActive("Chankast Alpha v0.25") ; Set screen resolution to 800x600 or 1024x768 or 1280x1024 Select Case $cmdline[1] = 800 send("!o{down 2}{right 2}{down}{enter}") Case $cmdline[1] = 1024 send("!o{down 2}{right 2}{down 2}{enter}") Case $cmdline[1] = 1280 send("!o{down 2}{right 2}{down 3}{enter}") EndSelect ;set priority to high if $cmdline[2] = "prihigh" then send("!o{down 4}{right}{down}{enter}") ;set capcom hack on if $cmdline[3] = "capyes" then send("!o{down 5}{enter}") ;get rid of stats send("!o{down 2}{right}{down 4}{enter}") ;run the game send("!r{enter}") ;set fullscreen send("!{enter}") While 1 Sleep (1000) Wend Func quit() WinClose("Chankast Alpha v0.25") exit Endfunc func capcom() send("!o{down 5}{enter}") endfunc func stats() send("!o{down 2}{right}{down 4}{enter}") endfunc Edited February 20, 2006 by KyJelly
Moderators SmOke_N Posted February 20, 2006 Moderators Posted February 20, 2006 $ProperForumCodeTags = StringStripWS('[ code][ /code]', 8) ClipPut($ProperForumCodeTags) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Moderators SmOke_N Posted February 20, 2006 Moderators Posted February 20, 2006 umm, what?It was my way of saying to use code tags when you are posting code. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Moderators SmOke_N Posted February 20, 2006 Moderators Posted February 20, 2006 i dont know what that meansExample: [ code] $var = 1 [ /code] If you remove the spaces after '[' you get:$var = 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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