Jump to content
Sign in to follow this  
bennyvo

need help with if stament

Recommended Posts

hi,

i'm new to this but i have play around with visual basiic before.

anyone have some begiiner axample on:

.if statement

.case statement

.loop /while

.mouse positions

.color detection

.multiple key press

etc..

any short script that work for beginner.

I need the above to write something like this:

==============================================

If position A is Black Then write Color Black Else do nothing

And If position B is color Green then write Color Green Else do nothing.

end if

end if

==============================================

thanks if anyone can help on the script or a link to the example above.

Share this post


Link to post
Share on other sites

$workstation = InputBox ( "Client Assistant", "Please type in the WORKSTATION name.","")

$patchname = InputBox ( "Client Assistant", "Please type in the MICROSOFT PATCH #.","")

$qfile = FileOpen("\\" & $workstation & "\c$\winnt\" & "Q" & $patchname & ".log", 0)

;Check if file opened for reading OK

If $qfile = -1 Then

MsgBox(4096,"Patch Log Status", "Q" & $patchname & ".log was not found.")

EndIf

this asked for two variables, queries the workstation name for a specific file, if it finds it, it i will open the file, if it doens't it prompts to tell you.

i would highly suggest looking at the help file..

Share this post


Link to post
Share on other sites

$PS = PixelSearch ( 0, 0, @DesktopWidth, @DesktopHeight, 0x000000 ) 
If Not @error Then
    MsgBox ( 0, "Found a black pixel", "Found a black pixel at " & $PS[0] & " x " & $PS[1] )
    $PS = PixelSearch ( 0, 0, @DesktopWidth, @DesktopHeight, 0x00ff00 )
    If Not @error Then
        MsgBox ( 0, "Found a green pixel", "Found a green pixel at " & $PS[0] & " x " & $PS[1] )
    EndIf
EndIf

that will search the whole screen for a black pixel, if it finds one it shows a message box then checks for a green one, if it finds that it shows a message box


[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...