Sign in to follow this  
Followers 0
talss

Why script don't work?

11 posts in this topic

Here's my conditional:

$pixel = PixelGetColor(1278,966);

$pixel2 = PixelGetColor(1277,966);

if <$pixel == 15790320 & $pixel2 == 15780320> Then

MsgBox(0,"abc","abcde",2);

MouseMove(1278,966,1);

MouseClick("left");

Sleep(500);

EndIf

That condition is true,so why it won't show me message?

Share this post


Link to post
Share on other sites



Here's my conditional:

$pixel = PixelGetColor(1278,966);

$pixel2 = PixelGetColor(1277,966);

if <$pixel == 15790320 & $pixel2 == 15780320> Then

MsgBox(0,"abc","abcde",2);

MouseMove(1278,966,1);

MouseClick("left");

Sleep(500);

EndIf

That condition is true,so why it won't show me message?

It can't possibly be true.

if <$pixel == 15790320 & $pixel2 == 15780320> Then

Not sure what you are attempting to do here (you don't explain that part) but I think what you are looking for is;

If $pixel = 15790320 AND $pixel2 = 15780320 Then

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

It can't possibly be true.

if <$pixel == 15790320 & $pixel2 == 15780320> Then

Not sure what you are attempting to do here (you don't explain that part) but I think what you are looking for is;

If $pixel = 15790320 AND $pixel2 = 15780320 Then
Ok thx,

and someone got beginners tutorials for AutoIt?

BTW - How can i get the name of the window with the focus now??

(which function? give name please).

Share this post


Link to post
Share on other sites

Ok thx,

and someone got beginners tutorials for AutoIt?

BTW - How can i get the name of the window with the focus now??

(which function? give name please).

Hi there m8,

You should try by visiting this tutorial : Tutorial

Then read and train a lot with AutoIT Help file.

For now :

WinActive

take a look

Cheers


Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Share this post


Link to post
Share on other sites

How can I know how many elements do an array have?

Share this post


Link to post
Share on other sites

Count them with Ubound($Array) - 1

Share this post


Link to post
Share on other sites

And how do I stop For loop at the middle? (like break; in C++?)

I can't find it in tutorials!!

Share this post


Link to post
Share on other sites

Maybe your talking about ContinueLoop? ExitLoop?

Share this post


Link to post
Share on other sites

How can I know how many elements do an array have?

look at this

#include <array.au3>

Dim $a[10][20]

For $i = 0 to UBound($a)-1
    For $j = 0 to UBound($a,2)-1
        $a[$i][$j]=$i+$j
    Next
Next
_ArrayDisplay($a)
MsgBox(0,UBound($a,0),(UBound($a))*(UBound($a,2)))

I do not like stupid and idiot people that write idiot things...If you are one, do not write.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

My script switches between windows,and i want him to switch - and go back(give focus) to the original window.

so i tried this algorithem:

$windows = WinList()
    for $i = 0 to Ubound($windows)-1 Step +1
        $check = WinActive($windows[$i][0])
        if $check == 1 Then
            ExitLoop
        EndIf
    Next
Etc...Code...
WinActivate($windows[$check][0])

and it's not working,what should I do?

Sometimes when I check with MsgBox which window was active it writes :"Task Switching".

Edited by talss

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

My script switches between windows,and i want him to switch - and go back(give focus) to the original window.

so i tried this algorithem:

$windows = WinList()
    for $i = 0 to Ubound($windows)-1 Step +1
        $check = WinActive($windows[$i][0])
        if $check == 1 Then
            ExitLoop
        EndIf
    Next
Etc...Code...
WinActivate($windows[$check][0])

and it's not working,what should I do?

Sometimes when I check with MsgBox which window was active it writes :"Task Switching".

firs of all, when exiting the for loop, $check=1 or 0 so WinActivate($windows[$check][0]) will atempt to activate a number $windows[0[0]=number of windows

or will atempt to activate the first found window if $check=1.

It is not good.

$windows = WinList()
        $a = 0
    for $i = 0 to Ubound($windows)-1 Step +1
        $check = WinActive($windows[$i][0])
        if $check == 1 Then
                        $a = $i
            ExitLoop
        EndIf
    Next
Etc...Code...
WinActivate($windows[$a][0])

this will work but it will not have a functionality: when the window is found active, it atempts to activate it (but is already active).

What is is that you try to do?

Edited by darzanmihai

I do not like stupid and idiot people that write idiot things...If you are one, do not write.

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  
Followers 0