darknezz21 Posted April 5, 2020 Share Posted April 5, 2020 (edited) It's been a while for me. Why are the two variables towards the bottom not equal? Please excuse bad programming test reddit.au3 Edited April 5, 2020 by darknezz21 Link to comment Share on other sites More sharing options...
Subz Posted April 5, 2020 Share Posted April 5, 2020 Write both variables out using ConsoleWrite and compare, can't tell what ClipGet is? Link to comment Share on other sites More sharing options...
Musashi Posted April 5, 2020 Share Posted April 5, 2020 (edited) 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 . Edited April 5, 2020 by Musashi "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 More sharing options...
darknezz21 Posted April 5, 2020 Author Share Posted April 5, 2020 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 More sharing options...
Subz Posted April 5, 2020 Share Posted April 5, 2020 Use StringStripWs($sCal, 3), strips leading and trailing white space. Link to comment Share on other sites More sharing options...
markyrocks Posted April 6, 2020 Share Posted April 6, 2020 Could also use stringinstr(). I see an attempt to copy in the posted code. If its actually being selected first, Its anyone's guess. Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now