Jump to content

If / If not problem


lasse46
 Share

Recommended Posts

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

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

@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

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 by lasse46
Link to comment
Share on other sites

@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 by FireFox
Link to comment
Share on other sites

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

@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 :o

what???
Link to comment
Share on other sites

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 by KentonBomb
Link to comment
Share on other sites

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

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 :o
Link to comment
Share on other sites

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

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...