lasse46 Posted December 17, 2008 Share Posted December 17, 2008 Hi i didn't find anything about the IF and IF NOT commands so I'm just gonna write what i want it to do if pixelgetcolor(150,367)=0x8e0000 then open start.au3 if error / if not (the pixel is 8e0000) then open start2.au3 if some one could solve this one I would be very happy! Link to comment Share on other sites More sharing options...
trancexx Posted December 17, 2008 Share Posted December 17, 2008 Hi i didn't find anything about the IF and IF NOT commands so I'm just gonna write what i want it to do if pixelgetcolor(150,367)=0x8e0000 then open start.au3 if error / if not (the pixel is 8e0000) then open start2.au3 if some one could solve this one I would be very happy!For example: $a = 5 If $a = 5 Then ConsoleWrite($a & @CRLF) If @error Or Not $a = 5 Then ConsoleWrite("$a is not 5 or error occurred" & @CRLF) ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
FireFox Posted December 17, 2008 Share Posted December 17, 2008 @lasse46 Hi, if pixelgetcolor(150,367)=0x8e0000 then Run("start.au3") If @error then Msgbox(64,"","Error !") Else;if no error Run("start2.au3") Endif Endif And before ask other question please search in helpfile F1 in scite Link to comment Share on other sites More sharing options...
lasse46 Posted December 17, 2008 Author Share Posted December 17, 2008 (edited) thanks alot, I did search it but didn't find anything And i didn't get: if pixelgetcolor(150,367)=0x8e0000 then Run("start.au3") If @error then Msgbox(64,"","Error !") Else;if no error Run("start2.au3") Endif Endif to work? Edited December 17, 2008 by lasse46 Link to comment Share on other sites More sharing options...
lasse46 Posted December 17, 2008 Author Share Posted December 17, 2008 Its the Run("start.au3") that doesn't workWhen i tried Run("notepad.exe") it worked Link to comment Share on other sites More sharing options...
FireFox Posted December 17, 2008 Share Posted December 17, 2008 (edited) @lass46 perhaps your script isnt in your main scriptdirectory Notepad is included in autoit functions so you doesnt have to write full path of it Edit : this can help you Run("AutoIt3.exe","start.au3") Edited December 17, 2008 by FireFox Link to comment Share on other sites More sharing options...
Marlo Posted December 17, 2008 Share Posted December 17, 2008 Use the ShellExecute() Command instead of Run. Click here for the best AutoIt help possible.Currently Working on: Autoit RAT Link to comment Share on other sites More sharing options...
lasse46 Posted December 17, 2008 Author Share Posted December 17, 2008 @firefox yes it is.i've even tried giving it full directions like Run("D:\AutoIt3\start.au3")?? Link to comment Share on other sites More sharing options...
lasse46 Posted December 17, 2008 Author Share Posted December 17, 2008 Thanks marlo ShellExecute("start.au3") worked just fine! Link to comment Share on other sites More sharing options...
FireFox Posted December 17, 2008 Share Posted December 17, 2008 @lass46 have you tried my example ? Run("AutoIt3.exe","start.au3") Open folder : Run("explorer.exe","C:\") Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 18, 2008 Share Posted December 18, 2008 A very complicated problem in software design. We should all stop a moment and flowchart it.You can come back to this after you get BSD installed... 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 Link to comment Share on other sites More sharing options...
trancexx Posted December 19, 2008 Share Posted December 19, 2008 ...keen sence of humor I like it. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
oMBRa Posted December 19, 2008 Share Posted December 19, 2008 @lass46 perhaps your script isnt in your main scriptdirectory Notepad is included in autoit functions so you doesnt have to write full path of it Edit : this can help you Run("AutoIt3.exe","start.au3") Run ( "filename" [, "workingdir" [, flag[, standard_i/o_flag]]] ) Parameters: filename The name of the executable (EXE, BAT, COM, or PIF) to run. Notepad is included in autoit functions so you doesnt have to write full path of it what??? Link to comment Share on other sites More sharing options...
FireFox Posted December 19, 2008 Share Posted December 19, 2008 @oMBra I just want to say here that autoit know path of Notepad like it know path of cmd... perhaps it search in sysdir... Link to comment Share on other sites More sharing options...
oMBRa Posted December 19, 2008 Share Posted December 19, 2008 @oMBraI just want to say here that autoit know path of Notepad like it know path of cmd... perhaps it search in sysdir... that sounds better Link to comment Share on other sites More sharing options...
NELyon Posted December 19, 2008 Share Posted December 19, 2008 (edited) that sounds better Yet it is still wrong.You can run "notepad.exe" without the full path because it is in a directory included in the Windows PATH environment variable. These directories are by default (if I remember correctly): C:\WINDOWS\, C:\WINDOWS\system32\, and one more that I cannot seem to remember. Edited December 19, 2008 by KentonBomb Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 20, 2008 Share Posted December 20, 2008 Yet it is still wrong. You can run "notepad.exe" without the full path because it is in a directory included in the Windows PATH environment variable. These directories are by default (if I remember correctly): C:\WINDOWS\, C:\WINDOWS\system32\, and one more that I cannot seem to remember. The System PATH as it is stored in the registry, and as it is parsed in the environment: $sRegPATH = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" $sRegPATH = RegRead($sRegPATH, "Path") ConsoleWrite("Debug: Registry Path = " & $sRegPATH & @LF) $sEnvPATH = EnvGet("Path") ConsoleWrite("Debug: Environment Path = " & $sEnvPATH & @LF) 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 Link to comment Share on other sites More sharing options...
NELyon Posted December 20, 2008 Share Posted December 20, 2008 The System PATH as it is stored in the registry, and as it is parsed in the environment: $sRegPATH = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" $sRegPATH = RegRead($sRegPATH, "Path") ConsoleWrite("Debug: Registry Path = " & $sRegPATH & @LF) $sEnvPATH = EnvGet("Path") ConsoleWrite("Debug: Environment Path = " & $sEnvPATH & @LF) Well, I was close Link to comment Share on other sites More sharing options...
AlmarM Posted December 20, 2008 Share Posted December 20, 2008 if pixelgetcolor(150,367)=0x8e0000 then open start.au3 if error / if not (the pixel is 8e0000) then open start2.au3 If PixelGetColor(150, 367) = 0x8e000 Then #include "Start.au3" Else #include "Start2.au3" EndIf You could use this, but if you compile you should use Run. AlmarM Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 20, 2008 Share Posted December 20, 2008 If PixelGetColor(150, 367) = 0x8e000 Then #include "Start.au3" Else #include "Start2.au3" EndIf You could use this, but if you compile you should use Run. AlmarM Compiler directives are not conditional. I don't think that will do what you want. If there are any Function declarations inside either of those include files, it won't even pass syntax check or run at all. 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 Link to comment Share on other sites More sharing options...
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