Sign in to follow this  
Followers 0
ramirez

Use a Ctrl+C as a variable

4 posts in this topic

Hi everyone.

I've made a script tha retrieves information from a ticket program and tries to send the info via Mail.

#include <Misc.au3>
#include <INet.au3>
#Include <Date.au3>
Sleep (1000)
Dim $i = 0
Dim $ctrlc = MouseClick("left", 340, 282) and Sleep (1000) and MouseClickDrag("left", 340, 282, 370, 282) and send ("^c")
;While 1

            If "0x" & Hex ( PixelGetColor ( 768 , 510 ) , 6) <> "0x404040" Then
            Do
                Send ( "{DOWN}" )
                Sleep (500)
                $i += 1
                ToolTip  ( $i )
            Until "0x" &  Hex ( PixelGetColor ( 768 , 510 ) , 6) = "0x404040"
        If _IsPressed ( "28" ) Then
        $i += 1
        ToolTip ( $i )
        
        EndIf 
    
$Address = "<mail@adress>"
$Subject = "Number of Tickets at " & @MDAY & "/" & @MON & "/" & @YEAR
$Body = "Number of tickets " & $i+1 & " beeing the first " & $ctrlc
 _INetMail($address, $subject, $body)
Sleep (1000)
Send ("!s")  

EndIf

;WEnd

Everything works fine but the result of the body of the mail is

"Number of tickets 10 beeing the first True"

What is going wrong here?

Thanks in advance.

Share this post


Link to post
Share on other sites



MouseClick("left", 340, 282) and Sleep (1000) and MouseClickDrag("left", 340, 282, 370, 282) and send ("^c")

That evaluates as a boolean statement. 'and' is a logical operator.

Share this post


Link to post
Share on other sites

#include <Misc.au3>
#include <INet.au3>
#Include <Date.au3>
Sleep (1000)
Dim $i = 0
MouseClick("left", 340, 282) 
Sleep (1000)
MouseClickDrag("left", 340, 282, 370, 282) 
send ("^c")
Dim $ctrlc = ClipGet()
;While 1

            If "0x" & Hex ( PixelGetColor ( 768 , 510 ) , 6) <> "0x404040" Then
            Do
                Send ( "{DOWN}" )
                Sleep (500)
                $i += 1
                ToolTip  ( $i )
            Until "0x" &  Hex ( PixelGetColor ( 768 , 510 ) , 6) = "0x404040"
        If _IsPressed ( "28" ) Then
        $i += 1
        ToolTip ( $i )
        
        EndIf 
    
$Address = "<mail@adress>"
$Subject = "Number of Tickets at " & @MDAY & "/" & @MON & "/" & @YEAR
$Body = "Number of tickets " & $i+1 & " beeing the first " & $ctrlc
 _INetMail($address, $subject, $body)
Sleep (1000)
Send ("!s")  

EndIf

;WEnd

Share this post


Link to post
Share on other sites

Thanks a lot guys

Manadar (you rock) never used the "ClipGet()" function but it was the logical answer :D

Once again thanks

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