Sign in to follow this  
Followers 0
goldenix

[Solved]_If then Variable Q

4 posts in this topic

#1 ·  Posted (edited)

Shouldnt this write to console only once? Instead it keeps on writing to console Hidden,Hidden,Hidden..etc.

$btn1_ADD_state = 'Visible'

    While 1
        Sleep(1000)

        If $btn1_ADD_state = 'Visible' Then         
            $btn_ADD_state = 'Hidden'
            ConsoleWrite($btn_ADD_state & @CRLF)
        EndIf
    WEnd

Edit Thanx Verox

Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites



Shouldnt this write to console only once? Instead it keeps on writing to console Hidden,Hidden,Hidden..etc.

$btn1_ADD_state = 'Visible'

    While 1
        Sleep(1000)

        If $btn1_ADD_state = 'Visible' Then         
            $btn_ADD_state = 'Hidden'
            ConsoleWrite($btn_ADD_state & @CRLF)
        EndIf
    WEnd
It's doing what you told it to do. Your setting the state back to hidden after checking it's visible.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

That sends it to console every second try this:

$btn1_ADD_state = 'Visible'
$sendedstat = "false"

While 1
    Sleep(1000)
    If $btn1_ADD_state = 'Visible' Then
        $btn_ADD_state = 'Hidden'
        If $sendedstat == "false" Then
            $sendedstat = "true"
            ConsoleWrite($btn_ADD_state & @CRLF)
        EndIf
    EndIf
WEnd

edited the code... now it works and just sends 1x hidden

sorry i forgot sdomething in there

Edited by Verox743

Started with AutoIt on 12th June, 2008.

Share this post


Link to post
Share on other sites

nope thats no bug

look at your second code at the

$btn_ADD_state = 'Hidden'

ConsoleWrite($btn_ADD_state & @CRLF)

you forgot the 1s

at the end of $btn

it should be

$btn1_ADD_state = 'Hidden'

ConsoleWrite($btn1_ADD_state & @CRLF)


Started with AutoIt on 12th June, 2008.

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