Jump to content
Sign in to follow this  
Captain

Really Simple Question about if/else statements

Recommended Posts

Captain

hi, i'm trying to write this script to tag a bunch of entries in a very old DOS database. The script is supposed to check if there's any text in the line and if there is then move to the line below and check again until there is a free line at which point it would write the tag, for some reason this just isn't working, forgive me, i'm a relitave noob at this muttley but any help would be awesome as this could save me weeks and weeks of typing down down tag F9!

thanks

CODE
InputBox, loopcount, Message Box, Tag How Many Items?, 640, 480

InputBox, tag, Message Bog, Tag With What?, 640, 480

Loop, %loopcount%

{

WinWait, Shortcut to LISTS,

IfWinNotActive, Shortcut to LISTS, , WinActivate, Shortcut to LISTS,

WinWaitActive, Shortcut to LISTS,

PixelSearch, Px, Py, 189, 182, 201, 188, 16777215, 0, fast

if ErrorLevel

{

Send, {DOWN}%tag%{ENTER}{F9}

Sleep, 500

}

else

Send, {DOWN}

PixelSearch, Px, Py, 187, 194, 201, 200, 16777215, 0, fast

if Errorlevel

{

Send, {DOWN}%tag%{ENTER}{F9}

Sleep, 500

}

else

Send,{DOWN}

PixelSearch, Px, Py, 188, 207, 203, 212, 16777215, 0, fast

if Errorlevel

{

Send, {DOWN}%tag%{ENTER}{F9}

Sleep, 500

}

else

MsgBox, error!

}

Share this post


Link to post
Share on other sites
James

Isn't this AH? You need: InputBox(), Send, Sleep, MsgBox, WinWaitActive, For, Next, WinWait, @error and PixelSearch.

$Var = True
If $Var Then
    MsgBox(0, "", "TRUE!")
Else
   MsgBox(0, "", "FALSE!")
EndIf
Edited by JamesBrooks

Share this post


Link to post
Share on other sites
Captain

AH? i don't understand

everything works apart from the part when it's supposed to check for pixels. i.e. the if statement doesn't work

Share this post


Link to post
Share on other sites
ProgAndy

The Script is written in AutoHotkey, not in AutoIt. If you want help in this forum, you have to convert it.


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

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  

×