Jump to content

superboss

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by superboss

  1. Thanks Melba, that was the solution. That'll teach me for thinking the problem was with me, hah, I forgot Im perfect :-)
  2. Perfect. Thanks very much for this post and solution. No idea why this wasnt identified earlier. The Teeeract.au3 file should be fixed asap.
  3. Hi there guys, long time no speak :-) Im having an issue, which took me a long time to debug, as normally I only execute this function call maybe 15 times, sometimes it does a few more. So for a long time it appeared as if simply put, sometimes it works and sometimes it doesnt. Anyway To cut a long story short, this is my piece of debugging code ************************** Start Code $Counter = 0 While 1 = 1 $Counter = $Counter + 1 $Qty = _TesseractScreenCapture(0,"",1,2,1096,1677,1658,1048,0) $Qty = StringLeft($Qty, 2) $Qty = Number($Qty) Sleep(200) If $Qty = 0 then ExitLoop WEnd MsgBox(0,"Msg", $Counter) End Code *********************************** Basically, it ends at 24 every time. Whats happening is, the 24th Call and onwards, Tesseract is returning a blank tif image and therefore $Qty becomes 0. It was strange how it sometimes just refused to work and returned a 0, until I figured out what was happening. So Im guessing all I need to do is clear the memory after every call? _TesseractScreenCapture Function calls the standard UDF as taken from the following link The reason im posting it here, is because I dont think it is a problem with the Tesseract.au3 file I am using, but rather How I am calling the function and not releasing the memory? Is there a different way of calling the function so this doesnt keep happening? Any help greatly appreciated Thanks S
  4. DOnt Worry, I figured it out. The problem was the rounding and/or Ceiling function $TAKE must have been equal to something like 1.899898 etc etc Using Int($TAKE) worked, although that also does not make sense. as Int($TAKE) should yield 1 and not 2 Whatever, its working now so I guess its ok, weird though. So if I say If $TAKE = 2 then Msgbox "blah blah" this DOES NOT GET FIRED but If Int($TAKE) = 2 does get fired. And trust me the real value is not 2.12321342 etc.
  5. CODESelectTickets() $ABC = PixelChecksum(128, 586, 196, 618) ;CurrentSelected Tickets $GHI = IniRead("d:\Tickets.ini", "Tickets", $ABC, 0) ;GHI = CurrentSelected Ticket Number If $TAKE <> $GHI then ExitLoop ;MsgBox(0,"msg", "debug2") WaitFinalConfirm1() CODE For $i = 1 to $BUYAMOUNT Step 1 $TOTPRICE = Round(($TOTPRICE + $PRICE),2) $Y = $Y + 12 Next $ASK = ($TOTPRICE * $DISCOUNT) $ASK = $ASK - $CREDIT $ASK = Round(($ASK),2) $TAKE = Ceiling($ASK) In Both Cases when I MsgBox $TAKE and $GHI the Answer is the same, however the ExitLoop is always triggered. I cant Paste my whole code of my program here, for 2 reasons, 1 its over 1500 lines, and secondly its kinda top secret stuff Dont see how this will help. My only question really was if IniRead somehow forces the Value to be captured as a "String" and the $TAKE was a number, then a String "2" and number 2 would not be equal??? But I did use Number($TAKE) and Number($GHI) with the same result, so Im a little confused Thanks
  6. OK, straight to the problem we go. EXAMPLE CODE For $i = 1 to 10 Step 1 $TOTPRICE = Round(($TOTPRICE + $PRICE),2) $ASK = ($TOTPRICE * $DISCOUNT) $ASK = $ASK - $CREDIT $ASK = Round(($ASK),2) $TAKE = Ceiling($ASK) Next ; SO if I MsgBox $TAKE I get "2" Next I do the following $READ = PixelChecksum(128, 586, 196, 618) $VALUE = IniRead("d:\Lookup.ini", "LookUp", $READ, 0) If I MsgBox $VALUE I get "2" Then my CODE says If $TAKE <> $VALUE then ExitLoop My problem is the ExitLoop is always firing even though $TAKE = $VALUE Now I even tried inserting the following $NEW1 = Number($TAKE) $NEW2 = Number($VALUE) If I MsgBox $NEW1 & ":" $NEW2 I get "2:2" So 2 is definately = 2 However when I use the 2 values in the code Like If $NEW1 = $NEW2 then MsgBox(0,"msg","test") the messagebox does not get fired even though 2=2. I am really amazed at whats going on here. Is it some conversion problem? Because I am getting the Second value using an IniRead? Help would be greatly appreciated Thanks Supe
  7. Dude!!! Thanks Yes, thats all I need, I never noticed the level option for the exit loop, that would help me enough to do what I want to do....I think. Sorry cant show you the code top secret But that should help me now, my code was getting stuck one level too low down, now that problem will go away I should be able to actually finish my code now. Still would love the GoTo command though. But its 5am now, been coding since 10am, think I need some sleep Thanks again
  8. Thanks for the reply, but it doesnt help me. My problem is that I have lots of Functions I have coded, and some of the functions are nested in other functions. And at any point in time a user can leave or do something that must make the program go to the begining again. I have a Return command, but that puts me back at the parent function. I have an ExitLoop function, but again, that just end the current While statement. What I really want is, if user exits, then GoTo, beginning of program again. Its just really getting the better of me not having a simple GoTo command. One thing I can think of is creating an entire copy of my code as a Function, then simply call the Function as a goto, but man Im not sure what would happen with the Global variable values, and memory leak and such. I just wish a goto command was there :-(
  9. I am actually considering using AutoHotKey just because it has that command Please stop me from going to the Dark Side
  10. I will sever my left arm off clean at the shoulder blade for the GoTo Command in Autoit. What can I do, I know its not available. I know I am a sloppy programmer, but Ive been battling for days to get the correct While and Loops and Nested if's going and its driving me nuts when a simple GoTo command would solve all my problems. I dont care if its sloppy. Please tell me there is a version out there with the GoTo command added in, I read somewhere that the developer said if there was enough call for it he would add it back in? Is there a custom version out there somwhere with this command included? Please please please
×
×
  • Create New...