Jump to content

Why aren't these variables equal?


Recommended Posts

3 hours ago, darknezz21 said:

Please excuse bad programming

1. It makes things easier, if you include the sourcecode in the message using <> and not just make an attachment, that must be downloaded first ;).

test_reddit.au3 :

Opt("WinTitleMatchMode", 2)
Opt("SendKeyDelay", 102)
Opt("PixelCoordMode", 1)
$scal = "No delivery windows available. New windows are released throughout the day."

;while 1

;Func _reload()

Sleep ( 500 )
ControlSend("Reserve a Time Slot - Amazon.com Checkout - Google Chrome", "", "", ("{F5}"))
Sleep(10000)
ControlClick("Reserve a Time Slot - Amazon.com Checkout - Google Chrome", "", "", "left", 3, 689, 789)
Sleep ( 500 )
ControlSend("Reserve a Time Slot - Amazon.com Checkout - Google Chrome", "", "", ("^c"))
$clal = ClipGet()
Sleep(1500)

;EndFunc

MsgBox(1, "hi", "Open Chrome and login to Fresh. Go to checkout page where no slots are open and then click okay button here.")
Sleep(500)
WinActivate ("Reserve a Time Slot - Amazon.com Checkout - Google Chrome", "")
Sleep(1000)
WinSetState("Reserve a Time Slot - Amazon.com Checkout - Google Chrome", "", @SW_MAXIMIZE)
Sleep(500)

If $clal = $scal then
       MsgBox(1, "test", "The following data is now stored in the clipboard: " & @CRLF & $clal)
;ElseIf $clal =

EndIf

2. The naming of the variables with $clal and $scal is unfavorably chosen and can easily lead to confusion.

3. Insert these lines before your string comparison (If $clal = $scal then ...) and post the result :

ConsoleWrite("$clal   = " & $clal& @CRLF)
ConsoleWrite("$scal   = " & $scal & @CRLF)
ConsoleWrite("Compare = " & StringCompare($clal, $scal) & @CRLF)

EDIT: @Subz - same approach, but you were a few seconds quicker :lol:.

Edited by Musashi

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

There is indeed a line break in copied text, how to express it? {ENTER} isn't it.
 

$clal   = No delivery windows available. New windows are released throughout the day.

$scal   = No delivery windows available. New windows are released throughout the day.{ENTER}
Compare = -1
>Exit code: 0    Time: 17.09

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...