Estimize

How to use selected text in autoit

20 posts in this topic

I have a program that automatically selects this bit of text and I need it to make a decision based on what this text is. For example here it is "2.18", if it shows this number I need it to repeat the function it just previously executed which is called Click_1(). Also if this value is something else for example "0.00" I need it to go onto the next function which is called Click_2. Any help is appreciated and if I missed any bits of info out which would help you answer my question just let me know. This decision also needs to be made outside of the functions Click_1/2 if possible. Thanks in advance

2.18.png

Share this post


Link to post
Share on other sites



Local $Data, $NewData;variable placeholder for selected text

While 1; make a loop to keep the script running inefinately
    WinActive(name of your program);You will probably want to use this to make the screen with the text the active window
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
    If $NewData == $Data Then
        Click_1()
        $Data = $NewData
    EndIF
    IF $NewData == 0.00 Then
        Click_2()
        $Data == $NewData
    EndIF
    Sleep(1000);pause the program for 1 second so it doesn't overuse your processor.
WEnd

Func Click1()
    MouseClick("",x1,y1)
EndFunc

Func Click_2()
    MouseClick("",x1,y1)
EndFunc

Haven't tested this but it is how I would write what you are explaining.

1 person likes this

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Local $Data, $NewData;variable placeholder for selected text

While 1; make a loop to keep the script running inefinately
    WinActive(name of your program);You will probably want to use this to make the screen with the text the active window
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
    If $NewData == $Data Then
        Click_1()
        $Data = $NewData
    EndIF
    IF $NewData == 0.00 Then
        Click_2()
        $Data == $NewData
    EndIF
    Sleep(1000);pause the program for 1 second so it doesn't overuse your processor.
WEnd

Func Click1()
    MouseClick("",x1,y1)
EndFunc

Func Click_2()
    MouseClick("",x1,y1)
EndFunc

Haven't tested this but it is how I would write what you are explaining.

If $NewData == 2.18 Then
        Click_1()
        $Data = $NewData
    EndIF
    IF $NewData == 0.00 Then
        Click_2()
        $Data == $NewData
    EndIF

 

 

is this correct or should what i changed to 2.18 stay as $data  also thanks very much for the help

 

 

Edited by Estimize
misscode

Share this post


Link to post
Share on other sites

It depends on what you want the script to do. Will it run forever? How many values will there be? The code I wrote is made to work forever. If you only want to check the number a few times then leave it at 2.18. Bottom line here is that you need to take what I wrote and test it and make changes and then test it. If you get stuck add more questions to this thread and we will help.


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I am having trouble getting my code to recognise the second if statement any help? My code is shown belowproblems.thumb.png.7c75289e5ba64c4e3b2f7

 

Edited by Estimize
miss click

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Can you copy and paste your code in a code window (its the <> symbols) rather than a blurry screen shot? Thy this. you can use msgbox to debug what is happening in your code to find out why it does not do what you want it to.

#include <MsgBoxConstants.au3>
HotKeySet("{F6}","Terminalte")

Local $Data = 2.18;stored value of what the selected text was as of the last check
Local $NewData;most current value of what is the selected text

Click_1();Run the function Click_1() when the script starts before the while loop

While 1; make a loop to keep the script running inefinately
    If WinExists("Function2") Then
        WinActive("Functions2");You will probably want to use this to make the screen with the text the active window
        Sleep(250)
    Else
        MgBox(0,"Missing Window","Functions2 window is not running")
        Exit 0
    EndIf
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
    If $NewData == $Data Then;this value starts as 2.18 as declared by line 3
        Click_1()
        $Data = $NewData;Set $Data to 2.18 after Click_1() has been run
    EndIF
    If $NewData == 0.00 Then
        Click_2()
        $Data = $NewData;This will set $Data to 0.00
    EndIF
    If $NewData <> 2.18 and $NewData <> 0.00 Then
        MsgBox(0,"NewData Value not 2.18 or 0.00","The value of $NweData is neither 2.18 nor 0.00. The value of $NewData is: " & $NewData)
        Exit 0
    EndIf   
    Sleep(1000);pause the program for 1 second so it doesn't overuse your processor.
WEnd

Func Click1()
    MouseClick("",x1,y1)
EndFunc

Func Click_2()
    MouseClick("",x1,y1)
EndFunc

Func Terminate()
    Exit 0
EndFunc

 

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

This is the funtions2.au3 page this shouldnt be like the rest of the code sorry
Func Click_1()
   Sleep (10000)
   MouseClick("left" , 863, 356) ;Click the X button
   sleep (250)
   MouseClick("left" , 1300, 186) ;Click the X button
   sleep (250)
   MouseClick("left" , 1260, 200) ;Click Amount TextBox
   sleep (250)
   for $x - 1 to 8
      send ("{BACKSPACE down}")
      sleep (100)
      Send("{BACKSPACE up}")
      sleep (100)
   Next ;Clicks Backspace 3 times
   sleep (100)
   Send("1.16") ;Inputs '1' into the amount box
   sleep (250)
   MouseClick("left" , 1245, 512) ;Click Call
   sleep (250)
   MouseClick("Left" , 790, 400)
   sleep (90000)
   MouseClick("right" , 807, 439)
   MouseClick("left" , 860, 665)
   sleep (5000)
   MouseClick("left" , 1001, 296)
   MouseClick("left" , 1012, 309)
   MouseClick("left" , 1046, 351)
   MouseClick("left" , 1046, 351)
EndFunc

Func Click_2()
   Sleep (1000)
   MouseClick("left" , 863, 563) ;Click the X button
   sleep (250)
   MouseClick("left" , 1260, 200) ;Click Amount TextBox
   sleep (250)
   for $x - 1 to 8
      send ("{BACKSPACE down}")
      sleep (100)
      Send("{BACKSPACE up}")
      sleep (100)
   Next ;Clicks Backspace 3 times
   sleep (100)
   Send("3.74") ;Inputs '1' into the amount box
   sleep (250)
   MouseClick("left" , 1245, 512) ;Click Call
   sleep (250)
   MouseClick("Left" , 790, 400)
   sleep (90000)
   MouseClick("right" , 807, 439)
   MouseClick("left" , 860, 665)
   sleep (5000)
   MouseClick("left" , 1001, 296)
   MouseClick("left" , 1012, 309)
   MouseClick("left" , 1046, 351)
   MouseClick("left" , 1046, 351)
EndFunc

This is the mainbot.au3 page

#include <MsgBoxConstants.au3>
#include <Functions2.au3>


HotKeySet("{F6}", "_Terminate")
Local $Data, $NewData;variable placeholder for selected text

Click_1()

While 1; make a loop to keep the script running inefinately
    WinActive("Functions2");You will probably want to use this to make the screen with the text the active window
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
    If $NewData == 2.18 Then
       Click_1()
        $Data = $NewData
    EndIF
    IF $NewData == 0.00 Then
       Click_2()
        $Data == $NewData
    EndIF
    Sleep(1000);pause the program for 1 second so it doesn't overuse your processor.
WEnd

 

Edited by Estimize

Share this post


Link to post
Share on other sites

Can you copy and paste your code in a code window (its the <> symbols) rather than a blurry screen shot? Thy this. you can use msgbox to debug what is happening in your code to find out why it does not do what you want it to.

#include <MsgBoxConstants.au3>
HotKeySet("{F6}","Terminalte")

Local $Data = 2.18;stored value of what the selected text was as of the last check
Local $NewData;most current value of what is the selected text

Click_1();Run the function Click_1() when the script starts before the while loop

While 1; make a loop to keep the script running inefinately
    If WinExists("Function2") Then
        WinActive("Functions2");You will probably want to use this to make the screen with the text the active window
        Sleep(250)
    Else
        MgBox(0,"Missing Window","Functions2 window is not running")
        Exit 0
    EndIf
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
    If $NewData == $Data Then;this value starts as 2.18 as declared by line 3
        Click_1()
        $Data = $NewData;Set $Data to 2.18 after Click_1() has been run
    EndIF
    If $NewData == 0.00 Then
        Click_2()
        $Data = $NewData;This will set $Data to 0.00
    EndIF
    If $NewData <> 2.18 and $NewData <> 0.00 Then
        MsgBox(0,"NewData Value not 2.18 or 0.00","The value of $NweData is neither 2.18 nor 0.00. The value of $NewData is: " & $NewData)
        Exit 0
    EndIf   
    Sleep(1000);pause the program for 1 second so it doesn't overuse your processor.
WEnd

Func Click1()
    MouseClick("",x1,y1)
EndFunc

Func Click_2()
    MouseClick("",x1,y1)
EndFunc

Func Terminate()
    Exit 0
EndFunc

 

what are the last 11 lines for???

 

 

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

#include <MsgBoxConstants.au3>
HotKeySet("{F6}","Terminate")

Local $Data = 2.18;stored value of what the selected text was as of the last check
Local $NewData;most current value of what is the selected text

Click_1();Run the function Click_1() when the script starts before the while loop

While 1; make a loop to keep the script running inefinately
    If WinExists("Function2") Then
        WinActive("Functions2");You will probably want to use this to make the screen with the text the active window
        Sleep(250)
    Else
        MgBox(0,"Missing Window","Functions2 window is not running")
        Exit 0
    EndIf
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
    If $NewData == $Data Then;this value starts as 2.18 as declared by line 3
        Click_1()
        $Data = $NewData;Set $Data to 2.18 after Click_1() has been run
    EndIF
    If $NewData == 0.00 Then
        Click_2()
        $Data = $NewData;This will set $Data to 0.00
    EndIF
    If $NewData <> 2.18 and $NewData <> 0.00 Then
        MsgBox(0,"NewData Value not 2.18 or 0.00","$NewData is neither 2.18 nor 0.00. The value of $NewData is: " & $NewData)
        Exit 0
    EndIf   
    Sleep(1000);pause the program for 1 second so it doesn't overuse your processor.
WEnd

Func Click_1()
   Sleep (10000)
   MouseClick("left" , 863, 356) ;Click the X button
   sleep (250)
   MouseClick("left" , 1300, 186) ;Click the X button
   sleep (250)
   MouseClick("left" , 1260, 200) ;Click Amount TextBox
   sleep (250)
   for $x - 1 to 8
      send ("{BACKSPACE down}")
      sleep (100)
      Send("{BACKSPACE up}")
      sleep (100)
   Next ;Clicks Backspace 3 times
   sleep (100)
   Send("1.16") ;Inputs '1' into the amount box
   sleep (250)
   MouseClick("left" , 1245, 512) ;Click Call
   sleep (250)
   MouseClick("Left" , 790, 400)
   sleep (90000)
   MouseClick("right" , 807, 439)
   MouseClick("left" , 860, 665)
   sleep (5000)
   MouseClick("left" , 1001, 296)
   MouseClick("left" , 1012, 309)
   MouseClick("left" , 1046, 351)
   MouseClick("left" , 1046, 351)
EndFunc

Func Click_2()
   Sleep (1000)
   MouseClick("left" , 863, 563) ;Click the X button
   sleep (250)
   MouseClick("left" , 1260, 200) ;Click Amount TextBox
   sleep (250)
   for $x - 1 to 8
      send ("{BACKSPACE down}")
      sleep (100)
      Send("{BACKSPACE up}")
      sleep (100)
   Next ;Clicks Backspace 3 times
   sleep (100)
   Send("3.74") ;Inputs '1' into the amount box
   sleep (250)
   MouseClick("left" , 1245, 512) ;Click Call
   sleep (250)
   MouseClick("Left" , 790, 400)
   sleep (90000)
   MouseClick("right" , 807, 439)
   MouseClick("left" , 860, 665)
   sleep (5000)
   MouseClick("left" , 1001, 296)
   MouseClick("left" , 1012, 309)
   MouseClick("left" , 1046, 351)
   MouseClick("left" , 1046, 351)
EndFunc

Can you point them out for me? I am adding features to the code in the event that the selected text is neither 2.18 nor 0.00. Its optional and you can remove it if that will never happen.

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

my code is now working and chooses call_1 or 2 appropriately and I renamed them to call because I felt it fitted it's purpose better. I used this

 

#include <MsgBoxConstants.au3>
#include <Functions2.au3>

HotKeySet("{F6}", "_Terminate")
Local $Data, $NewData;variable placeholder for selected text

Sleep (5000)

MouseClick ("right", 1260, 260)
Sleep (250)
MouseClick ("left", 1214, 485)
sleep (250)
Call_1()

While 1; make a loop to keep the script running inefinately
    WinActive("Functions2");You will probably want to use this to make the screen with the text the active window
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
    If $NewData == 2.18 Then
       Call_1()
        ;$Data = $NewData
     Else
       $NewData == 0.00
       Call_2()
       ;$Data == $NewData
    EndIF
    Sleep(1000);pause the program for 1 second so it doesn't over use your processor.
WEnd

 

Now I need it to go onto call _3 if the result of the If statement call_2 is also 0.00 but if the result of the call_3 statement is 7.31 I need it to start back at call_1. If you don't understand I can explain it better because I'm sure I missed some sort of detail out, also thanks for the help so far very much appreciated. Also there can only be two values (like here 0.00 or 2.18) as what the program is asking a question and there are basically two answers every time it asks the question and one will always be 0.00. If the answer is 0.00 it will always go onto the next function for example if I was on call_2 and the answer was 0.00 I need the program to go onto call_3 but if the answer was 7.31 it goes back to call_1. Best explanation I can give. As well as this the program cannot skip call_1/2/3/4 to get to call_5 it has to go through all the call_'s in numerical order until the answer which isn't 0.00 is given then we loop back to call_1

 

 

Edited by Estimize
more info needed

Share this post


Link to post
Share on other sites

How many calls are there going to be? 5? What are the values that you want to call a click function on for these 5 calls? ie there will be click_1() = 2.18  click_2() = 0.00 click_3() =7.31 etc


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

there will be a max of 10 calls,  and you might have misunderstood, so the program executes call_1 then the result of call_1 which can either be 2.18 or 0.00 decides whether it will move onto call_2 or stay on call_1. the result of call_1 to move onto call_2 is 0.00 but if the result of call_1 is 2.18 then it just repeats call_1. So when it executes call_2 it gets a result back at the end of the function which is either 7.31 or 0.00 if the result is 0.00 it will move onto call_3 but if the result of call_2 was 7.31 then I need it to loop back to call_1 and repeat like that. the numbers are the least relevant bits I think. So if the result of call_1 and 2 and 3 was all 0.00 it moves onto call_4 and if the result of call_4 is  17.16 (that may change in future but it j=should be easily replaced) then the program loops back to call_1 and carries on from there, but if the result of call_4 is 0.00 then it needs to go onto call_5 and so on.

Share this post


Link to post
Share on other sites

You need a while loop where you have 10 + if statements or you need a do while loop or possibly several nested if statements. Really the point of this forum is to help you understand the concept of what you want your script to do and be able to write and modify your own. Are you stuck? Where are you stuck?


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

You need a while loop where you have 10 + if statements or you need a do while loop or possibly several nested if statements. Really the point of this forum is to help you understand the concept of what you want your script to do and be able to write and modify your own. Are you stuck? Where are you stuck?

The while loop is the bit of program I am stuck on.

 

 

Share this post


Link to post
Share on other sites

See if you can wrap your mind around this. It would help me write more if the info you gave me was correct and complete. What would help me the most would look something like this:

1. 0.00 or 2.18

2. 0.00 or 7.13

3. 0.00 or ?

4. 0.00 or 17.16

There's  a pattern here. Find it. Manipulate it to work for you.

#include <Array.au3>

Function_1();call the main function when the program starts

Func Function1()
    While 1; make a loop to keep the script running inefinately
        GetClipData();get the value of the number
        If $NewData == 2.18 Then
            Action_1()
        EndIf
        If
            $NewData == 0.00 Then
            Function_2()
        EndIF
        Sleep(1000);pause the program for 1 second so it doesn't over use your processor.
WEnd
EndFunc

Func Function_2()
    While 1; make a loop to keep the script running inefinately
        GetClipData();get the value of the number
        If $NewData == 7.13 Then
            Action_1()
            Function_1()
        EndIf
        If
            $NewData == 0.00 Then
            Action_3()
            Function_3()
        EndIF
        Sleep(1000);pause the program for 1 second so it doesn't over use your processor.
    WEnd
EndFunc

Func Function_3()
    While 1; make a loop to keep the script running inefinately
        GetClipData();get the value of the number
        If $NewData == 17.16 Then
            Action_1()
            Function_1()
        EndIf
        If
            $NewData == 0.00 Then
            Action_4()
            Function_4()
        EndIF
        Sleep(1000);pause the program for 1 second so it doesn't over use your processor.
    WEnd
EndFunc

Func GetClipData();get the number copied to the clipboard and then the value declared as a variable
    WinActive("Functions2");You will probably want to use this to make the screen with the text the active window
    Send("^c");Send Ctrl + C to copy the copied text
    sleep(250);I add this to give the computer time to copy the data to the clipboard. It may not be necessary
    $NewData = ClipGet();This will read the clipboard data in windows and set it to the variable $data for comparisons
EndFunc     

Func Action_1()
   Sleep (10000)
   MouseClick("left" , 863, 356) ;Click the X button
   sleep (250)
   MouseClick("left" , 1300, 186) ;Click the X button
   sleep (250)
   MouseClick("left" , 1260, 200) ;Click Amount TextBox
   sleep (250)
   for $x - 1 to 8
      send ("{BACKSPACE down}")
      sleep (100)
      Send("{BACKSPACE up}")
      sleep (100)
   Next ;Clicks Backspace 3 times
   sleep (100)
   Send("1.16") ;Inputs '1' into the amount box
   sleep (250)
   MouseClick("left" , 1245, 512) ;Click Call
   sleep (250)
   MouseClick("Left" , 790, 400)
   sleep (90000)
   MouseClick("right" , 807, 439)
   MouseClick("left" , 860, 665)
   sleep (5000)
   MouseClick("left" , 1001, 296)
   MouseClick("left" , 1012, 309)
   MouseClick("left" , 1046, 351)
   MouseClick("left" , 1046, 351)
EndFunc

Func Action_2()
   Sleep (1000)
   MouseClick("left" , 863, 563) ;Click the X button
   sleep (250)
   MouseClick("left" , 1260, 200) ;Click Amount TextBox
   sleep (250)
   for $x - 1 to 8
      send ("{BACKSPACE down}")
      sleep (100)
      Send("{BACKSPACE up}")
      sleep (100)
   Next ;Clicks Backspace 3 times
   sleep (100)
   Send("3.74") ;Inputs '1' into the amount box
   sleep (250)
   MouseClick("left" , 1245, 512) ;Click Call
   sleep (250)
   MouseClick("Left" , 790, 400)
   sleep (90000)
   MouseClick("right" , 807, 439)
   MouseClick("left" , 860, 665)
   sleep (5000)
   MouseClick("left" , 1001, 296)
   MouseClick("left" , 1012, 309)
   MouseClick("left" , 1046, 351)
   MouseClick("left" , 1046, 351)
EndFunc

 


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

Thanks so much, I'll try it out for a bit and then get back to you with my progress, really appreciated thanks.

Share this post


Link to post
Share on other sites

what is the action_1 etc meant to represent?

 

 

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

Function_1 searches for the number 0.00 and 2.18 then it calls the function action_1 or function_2. 

Object oriented design

1. Get the number.(call the function GetClipData())

2. If the number is 0.00 then Call function_2. If the number is 2.18 run action_1 again. (The if statements in Function_1())

3. In function_2, get the number. If the number is 0.00 then call function_3. If the number is 7.18 then call function_1 (start over).(The if statements in function_2())

etc.

Look at the function_# as the sequence you were describing for the numbers you want to compare. ie Function_1 compares 0.00 and 2.18. Function_2 compares 0.00 and 7.18. Function_3 I was given missing information from you so I dont know what the comparison is. You would make Function_4 to compare 0.00 and 17.16.

 

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

I think I made a mistake in the code above.

Func Function_1();Only the first function needs to use a while loop.
    While 1; make a loop to keep the script running inefinately
        GetClipData();get the value of the number
        If $NewData == 2.18 Then
            Action_1()
        EndIf
        If
            $NewData == 0.00 Then
            Function_2()
        EndIF
        Sleep(1000);pause the program for 1 second so it doesn't over use your processor.
    WEnd
EndFunc

Func Function_2()
    ;you might want to put a sleep here depending on how long it takes for the value to change    
        GetClipData();get the value of the number
        If $NewData == 2.18 Then
            Action_1();your click sequence
            Function_1();restart back at the top (Function_1())
        EndIf
        If
            $NewData == 0.00 Then
            Action_2();Do something because the value is 0.00
            Function_2();Go on to the next function
        EndIF
        Sleep(1000);pause the program for 1 second so it doesn't over use your processor.
EndFunc

 

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

Are we on track for nested IF statements?  I wonder what the source data represents? And the fact that it can always only be one item from a set of predefined values?  Do these values always increment? Can a value reduce? What are the implications if a wrong choice is made?

Intriguing.


Skysnake

Why is the snake in the sky?

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

  • Similar Content

    • xuzo
      By xuzo
      This might be the wrong forum topic...but it's very busy, so figured it would be best to post a poll here to get a representative sample.
      I'm trying to understand how I could use my skills with Auto IT to make some money...
      Any suggestion as what kind of services I could offer? 
      What are the most common required tasks and services that you use this for?
    • Yash91
      By Yash91
      Hi Experts,
      I want to integrate AutoIT with Eclipse to write my code in java for automating the desktop base application, i have integrate jacob 1.18 and verify the dll's also but i am getting How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version 51 issue.
      I am using 32 bit windows xp with java 1.6 version.
      Java 1.7 is unsupported in 32 bit windows xp. is there any solution for the same.
    • Gorby7
      By Gorby7
      I have an Autoit-based client GUI that uses a single MS SQL Server database. I have no problem connecting to and executing queries against this database from my AutoIT code, with the below exception:
      One of the database's stored procedures I need to execute requires a parameter that is a table. I've set up the appropriate table_type on the database and everything works fine on the database itself when I execute the stored proc with a table variable for the parameter (no AutoIT involved). The problem is that I can't figure out how to pass a table parameter from AutoIT, assuming it's even possible. The code below shows the two methods I've tried, both methods return a RecordSet object that is at EOF.
      #include <Array.au3> Opt("MustDeclareVars", 0) $sDBSrv = "ITSQL01.domain.com" $sDBName = "INVDEV" $sADOName = "ADODB.Connection" $oSQLConn = ObjCreate($sADOName) $sConnStr = "Driver={SQL Server};Server=" & $sDBSrv & ";Database=" & $sDBName & ";Trusted_Connection=yes;" $oSQLConn.Open ($sConnStr) $rsoFacFriendly = $oSQLConn.Execute("SELECT TOP 5 FriendlyName FROM Facility") If Not $rsoFacFriendly.EOF Then $aFacFriendly = $rsoFacFriendly.GetRows() _ArrayDisplay($aFacFriendly) $rsoSPResults = $oSQLConn.Execute("EXEC spTableParameterPassTest " & $aFacFriendly) Select Case $rsoSPResults.EOF = False MsgBox(0, "sp exec1", "not end of file") $aSPResults = $rsoSPResults.GetRows() _ArrayDisplay($aSPResults) Case IsObj($rsoSPResults) = 0 MsgBox(0, "sp exec1", "rso isn't even an object") Case $rsoSPResults.EOF = True MsgBox(0, "sp exec1", "At end of file") Case Else MsgBox(0, "sp exec1", "Something else happened") EndSelect $rsoSPResults = 0 $rsoSPResults = $oSQLConn.Execute("EXEC spTableParameterPassTest " & $rsoFacFriendly) Select Case $rsoSPResults.EOF = False MsgBox(0, "sp exec2", "not end of file") $aSPResults = $rsoSPResults.GetRows() _ArrayDisplay($aSPResults) Case IsObj($rsoSPResults) = 0 MsgBox(0, "sp exec2", "rso isn't even an object") Case $rsoSPResults.EOF = True MsgBox(0, "sp exec2", "At end of file") Case Else MsgBox(0, "sp exec2", "Something else happened") EndSelect $rsoSPResults = 0 $rsoFacFriendly = 0 $oSQLConn.Close $oSQLConn = 0 Exit  
    • Swatcat
      By Swatcat
      Hi All,
      So I need Help.
      I am developing code to handle Authentication Popup For IE. The issue I am facing is that this code runs smoothly on unlock desktop but fails on VM machine and when machine is locked. So could you suggest what should I do to make it work. My automation Tool is a Selenium Based tool and is able to launch the script, but the AutoIT Script is unable to pass the username and password on the authentication popup.
      Below is the code.
      I am passing the values through Command line arguments.
      #include <Array.au3> Local $browser, $BAuthMode, $BWinAuthUserName, $BWinAuthPassword, $BChromeClaimsURL, $BChromePolicyURL, $BIEPolicyURL, $BIEClaimsURL; $browser = $CMDLine[1] $BAuthMode = $CMDLine[2] $BWinAuthUserName = $CMDLine[3] $BWinAuthPassword = $CMDLine[4] $BChromeClaimsURL = "" $BChromePolicyURL = "" $BIEURL = "" ;$BIEClaimsURL = "" If $browser = "chrome" And $BAuthMode = "m" Then If WinExists($BChromeClaimsURL,"") Then WinWaitActive($BChromeClaimsURL) ; set control to the window for proxy authentication Sleep(500) Send("{ESCAPE}") ElseIf WinExists($BChromePolicyURL,"") Then WinWaitActive($BChromePolicyURL) ; set control to the window for proxy authentication Sleep(500) Send("{ESCAPE}") EndIf ElseIf $browser = "ie" And $BAuthMode = "m" Then If WinExists($BIEPolicyURL,"") Then WinExists($BIEPolicyURL) ; set control to the window for proxy authentication Sleep(500) Send("{ESCAPE}") ElseIf WinExists($BIEClaimsURL,"") Then WinWaitActive($BIEClaimsURL) ; set control to the window for proxy authentication Sleep(500) Send("{ESCAPE}") EndIf ElseIf $browser = "ie" And $BAuthMode = "w" Then WinWaitActive($BIEURL,"","20") if(WinExists($BIEURL)) Then Sleep(500) Send($BWinAuthUserName & "{TAB}") ; send username and press TAB Sleep(100) Send($BWinAuthPassword & "{ENTER}") ; send the password and press enter Sleep(100) EndIf ElseIf $browser = "chrome" And $BAuthMode = "w" Then If WinExists($BChromeClaimsURL,"") Then WinWaitActive($BChromeClaimsURL) ; set control to the window for proxy authentication Sleep(500) Send($BWinAuthUserName & "{TAB}") ; send username and press TAB Send($BWinAuthPassword & "{ENTER}") ; send the password and press enter ElseIf WinExists($BChromePolicyURL,"") Then WinWaitActive($BChromePolicyURL) ; set control to the window for proxy authentication Sleep(500) Send($BWinAuthUserName & "{TAB}") ; send username and press TAB Send($BWinAuthPassword & "{ENTER}") ; send the password and press enter EndIf EndIf WinSetState("[ACTIVE]", "", @SW_RESTORE) Sleep(500) WinSetState("[ACTIVE]", "", @SW_MAXIMIZE)  
       
       
       
    • Gowrisankar
      By Gowrisankar
      Dear members of the forum,
      I'm new to AutoIt and I'm having a good time exploring and enjoying the features of AutoIt.
      For one of my tasks, I've to open few particular mails from outlook based on subject of the mails and then print the mails. Can someone please guide me how to do it?
      My question could be very silly for experts. But I'm just a beginner. Kindly advice.
      Thanks and regards,
      Gowrisankar R.