Jump to content

Recommended Posts

Guest BL@(K-R34P3R
Posted

StartupFunc()
Func StartupFunc()
   Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt Help")
   WinSetState("AutoIt Help", "", @SW_MAXIMIZE)
   Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt v3 Active Window Info")
   WinSetState("AutoIt v3 Active Window Info", "", @SW_MAXIMIZE)
   Run('"C:\Program Files\AutoIt3\SciTe\SciTE.exe"', "C:\Program Files\AutoIt3\SciTe")
   Sleep(500)
   Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer")
   Sleep(2000)
   WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" )
   WinSetState("Internet Explorer", "", @SW_MAXIMIZE)
   MouseClick("left", 300, 100, 1)
   Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}")
EndFunc

Just a startup script. Gives me a stupid error...

  Quote

>"C:\Program Files\AutoIt3\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Randall Degges\My Documents\Scripts\Startup.au3"   

C:\Documents and Settings\Randall Degges\My Documents\Scripts\Startup.au3 (32) : ==> Unable to execute the external program.:

Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3")

>Exit code: 0    Time: 0.219

Why isn't it working???
Guest BL@(K-R34P3R
Posted

One more thing to add:

Is it possible to assign that function to a variable? Or can you not assign functions to variables?

Posted (edited)

you can run .exe with run, but to open another program such as .txt files.. you need to run notepad.

i dont know what you need to run .chm.. but see what program opens that.. and then run that.

EDIT: ahahaaa matt you beat me by like 2 seconds

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Posted

a variable stores information.

you cannot assign a function to it.

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Guest BL@(K-R34P3R
Posted

So the helpfile is obsolete? That sucks =/. Also, I wanted to make an inputbox, if 1, then run script, if 0, then do not run script.

Posted

i have no idea what you are trying to do...

but the help file opens.. it is more advanced format than a simple .txt file

so, just doubleclick it

or right click run. why are you trying to open the help file from a script?

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Guest BL@(K-R34P3R
Posted

A startup script, so when you start the computer it automatically runs all the scripting tools, helpfile, scite, winspy, etc... and also opens up the autoit forums. How would I open the help file through Start->Run?

Guest BL@(K-R34P3R
Posted

I wanted to do:

IF the user inputs 1, then run the script

IF the user inputs 0, then do not run the script

Guest BL@(K-R34P3R
Posted

Fixed! I now know the problem, needed to add a few sleeps. Here is new script:

StartupFunc()
Func StartupFunc()
   Send("{LWIN}{ENTER}")
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}")
  ;Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt Help")
   WinSetState("AutoIt Help", "", @SW_MAXIMIZE)
   WinSetState("AutoIt Help", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt v3 Active Window Info")
   WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE)
   Sleep(500)
   Send("{LWIN}{ENTER}")
   Sleep(500)
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}")
   WinWaitActive("Scripts")
   WinSetState("Scripts", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer")
   Sleep(2000)
   WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" )
   WinSetState("Internet Explorer", "", @SW_MAXIMIZE)
   Sleep(500)
   MouseClick("left", 300, 100, 1)
   Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}")
EndFunc

Question:

How can I make this script into a yes or no script. So that the user can enter either yes, to start it, or no, to no start it...

Guest BL@(K-R34P3R
Posted

MsgBox(4, "AutoIt Startup Script -  Black Reaper", "Press either yes to run the script, or no to cancel it... The default is no.")
If 6 then
   Return
EndIf
If 7 then
   
StartupFunc()
Func StartupFunc()
   Send("{LWIN}{ENTER}")
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}")
  ;Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt Help")
   WinSetState("AutoIt Help", "", @SW_MAXIMIZE)
   WinSetState("AutoIt Help", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt v3 Active Window Info")
   WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE)
   Sleep(500)
   Send("{LWIN}{ENTER}")
   Sleep(500)
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}")
   WinWaitActive("Scripts")
   WinSetState("Scripts", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer")
   Sleep(2000)
   WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" )
   WinSetState("Internet Explorer", "", @SW_MAXIMIZE)
   Sleep(500)
   MouseClick("left", 300, 100, 1)
   Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}")
EndFunc

I added that part to the top. Problem is, I know that Return continues the script... But, if they pick 7, "No", then how do I stop it from performing the rest of the script?

Posted (edited)

If MsgBox(4, "AutoIt Startup Script - Black Reaper", "Press either yes to run the script, or no to cancel it... The default is no.")=7 then exit

Edited by magaf
Posted

  BL@(K-R34P3R said:

MsgBox(4, "AutoIt Startup Script -  Black Reaper", "Press either yes to run the script, or no to cancel it... The default is no.")
If 6 then
   Return
EndIf
If 7 then
   
StartupFunc()
Func StartupFunc()
   Send("{LWIN}{ENTER}")
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}")
  ;Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt Help")
   WinSetState("AutoIt Help", "", @SW_MAXIMIZE)
   WinSetState("AutoIt Help", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt v3 Active Window Info")
   WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE)
   Sleep(500)
   Send("{LWIN}{ENTER}")
   Sleep(500)
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}")
   WinWaitActive("Scripts")
   WinSetState("Scripts", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer")
   Sleep(2000)
   WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" )
   WinSetState("Internet Explorer", "", @SW_MAXIMIZE)
   Sleep(500)
   MouseClick("left", 300, 100, 1)
   Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}")
EndFunc

I added that part to the top. Problem is, I know that Return continues the script... But, if they pick 7, "No", then how do I stop it from performing the rest of the script?

<{POST_SNAPBACK}>

Return doesn't continue the script. just do a return 0.

*** Matt @ MPCS

Guest BL@(K-R34P3R
Posted

I have this:

;Starts up AutoIt scripting tools on startup with a yes or no option.
$start = InputBox("AutoIt Startup Script - B1@(K-R34P3R", "Enter 1 to start, or 0 to abort. Default is 0.", 0)
If $start = 1 Then
  ;What Do i put here to make it continue running script...
EndIf
If $start = 0 Then
   Exit
StartupFunc()
Func StartupFunc()
   Send("{LWIN}{ENTER}")
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}")
  ;Run('"C:\Program Files\AutoIt3\AutoIt.chm"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt Help")
   WinSetState("AutoIt Help", "", @SW_MAXIMIZE)
   WinSetState("AutoIt Help", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt v3 Active Window Info")
   WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE)
   Sleep(500)
   Send("{LWIN}{ENTER}")
   Sleep(500)
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}")
   WinWaitActive("Scripts")
   WinSetState("Scripts", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer")
   Sleep(2000)
   WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" )
   WinSetState("Internet Explorer", "", @SW_MAXIMIZE)
   Sleep(500)
   MouseClick("left", 300, 100, 1)
   Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}")
EndFunc

What do I insert after If $start = 1 to make it run the script?

Guest BL@(K-R34P3R
Posted

;Starts up AutoIt scripting tools on startup with a yes or no option.
$start = InputBox("AutoIt Startup Script - B1@(K-R34P3R", "Enter 1 to start, or 0 to abort. Default is 0.", 0)
If $start = 0 Then
   Exit
EndIf
If $start = 1 Then
   StartupFunc()
Func StartupFunc()
   Send("{LWIN}{ENTER}")
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Program Files\AutoIt3\AutoIt.chm{ENTER}")
   WinWaitActive("AutoIt Help")
   WinSetState("AutoIt Help", "", @SW_MAXIMIZE)
   WinSetState("AutoIt Help", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\AutoIt3\AU3_Spy.exe"', "C:\Program Files\AutoIt3")
   WinWaitActive("AutoIt v3 Active Window Info")
   WinSetState("AutoIt v3 Active Window Info", "", @SW_MINIMIZE)
   Sleep(500)
   Send("{LWIN}{ENTER}")
   Sleep(500)
   MouseClick("left", 237, 875, 1)
   Sleep(500)
   Send("C:\Documents and Settings\Randall Degges\My Documents\Scripts{ENTER}")
   WinWaitActive("Scripts")
   WinSetState("Scripts", "", @SW_MINIMIZE)
   Sleep(500)
   Run('"C:\Program Files\Internet Explorer\IEXPLORE.EXE"', "C:\Program Files\Internet Explorer")
   Sleep(2000)
   WinSetTitle ( "Dell - Client & Enterprise Solutions, Software, Peripherals, Services - Microsoft Internet Explorer", "", "Internet Explorer" )
   WinSetState("Internet Explorer", "", @SW_MAXIMIZE)
   Sleep(500)
   MouseClick("left", 300, 100, 1)
   Send("http://www.autoitscript.com/forum/index.php?act=idx{ENTER}")
EndFunc
EndIf

Edited: BUT, now it's giving me an error. Ideas?

  Quote

>"C:\Program Files\AutoIt3\autoit3.exe" /ErrorStdOut "C:\Documents and Settings\Randall Degges\My Documents\Scripts\Startup.au3"   

C:\Documents and Settings\Randall Degges\My Documents\Scripts\Startup.au3 (36) : ==> "If" statement has no matching "EndIf" statement.:

Func StartupFunc()

>Exit code: 1    Time: 0.214

Guest BL@(K-R34P3R
Posted

Thanks JdeB, I never even thought of it like that.

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...