Jump to content

Recommended Posts

Posted

If you have time to experiment, then just try what i said. And feel free to ask any doubt. :) 

Spoiler

My Contributions

Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language.

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Posted

Bad attitude to have. Do you want someone to write the software for you? It seems to me that you have gotten a great deal of straight forward answers and many helpful tips. You had code that wouldn't compile and now you have halfway working code and a vastly better understanding of how it functions.

Posted
1 minute ago, FlashpointBlack said:

Bad attitude to have. Do you want someone to write the software for you? It seems to me that you have gotten a great deal of straight forward answers and many helpful tips. You had code that wouldn't compile and now you have halfway working code and a vastly better understanding of how it functions.

It's not about attitude, it's about knowing when to walk away. I had code that would compile yesterday, when trying to add the if, then, elseif statement it broke. It was pointed out there was an "endif" error, and i fixed that and compiled. Since, i have spent time being told its a pixel color issue, i replied once that the pixel color was not the issue, then replied a second time to the same statement that again it was not a pixel issue. Today makes my 3rd day of working on this stupid 45 lines of code, i am making no headway past finding a missed "endif" and still not being any closer to understanding why it is skipping over the end of the loop after the endif statement. I dont want to continue explaining that it is NOT a pixel color issue time and again, as i have a pixel finder tool that tells me it is, every time. Why, when i am not getting paid, and doing this out of kindness to help my mother have a little extra free time here and there, would i continue to beat my head against the wall in a state of frustration which in itself is distracting my ability to see something that is probably so obvious its painful when i can just walk away, and come back with a fresh mind and fresh perspective on it tomorrow? It's 45 lines of code, it's simple code, and anyone with coding experience here could probably look at it and see why it is skipping the end bit after the endif. Tomorrow with fresh eyes and a clear head, i may see it too.

Posted
40 minutes ago, Aelyus said:

Then restart the loop. Instead, it just keeps repeating the "s" "s" "h" portion as if the condition was not met and never goes to the "d" "s" to flag, save and reset the loop.

Do
            Sleep(5000)
            Send("s")
            Sleep(2000)
            Send("s")
            Sleep(2000)
            Send("h")
            ConsoleWrite(PixelGetColor(811, 512) & @CRLF)
        Until PixelGetColor(811, 512) = 0x33FF33

Adding in the ConsoleWrite command will display the current pixel color being read to verify SadBunny's theory:

30 minutes ago, SadBunny said:

The only reason for that loop to keep going on forever is that apparently the (811, 512) pixel color never equals that 0x33FF33.

 

You can insert those ConsoleWrite commands throughout the code to see where the looping is going wrong. This is a straight-forward answer.

"It was pointed out there was an "endif" error, and i fixed that and compiled." Truly, kcvinu fixed it for you. That was a straight-forward answer.

Prior to the code being written for you, Jos provided you with details so you could help yourself find the issue.

I gave you information about formatting if-then-else statements. That was a straight-forward answer.

 

Here's the crux of it: You have a non-working program and 3 different people who have given you a boatload of information and experience for you to take under advisement. It is not a bad attitude to walk away, it's a bad attitude to trivialize the help that you've gotten thus far. You catch more flies with honey, afterall... best of luck!

 

Posted

Thank you for the ConsoleWrite idea, it did confirm that it is indeed the correct pixel color as i already was aware of, beyond that, i'm not here to argue semantics.

 

After careful analysis of the functioning of the code, it is clear that the code is not executing anything that is not bracketed in a do/until wrapper except the initial "s" "h" after the first do/until.

 

If PixelGetColor(811, 512) = 0x33FF33 Then
        Sleep(3000)
        Send("d")
        Sleep(3000)
        Send("s")

Does not function even though the pixel color requirements have been met and verified by the consolewrite,

and

    Until PixelGetColor(811, 512) = 0x33FF33
    EndIf

    Sleep(1000)
    Send("d")
    Sleep(3000)
    Send("s")
WEnd

Does not function even though the pixel color requirements have been met and verified by the consolewrite,

 

I'll start with why 

If PixelGetColor(811, 512) = 0x33FF33 Then
        Sleep(3000)
        Send("d")
        Sleep(3000)
        Send("s")

is not working, once i figure out why that seems to not be correct, then i will move on.

 

Posted (edited)

I also don't see how the answers in this thread were anything but straightforward.

About why that last bit isn't working... Apparently the PixelGetColor is not returning the color that you expected. A plausible reason for this is your coordinates being wrong. This is why I mentioned checking your coordinates and your pixel color value with AU3Info. You may need to specify different coordinates, depending on your "PixelCoordMode" setting, which make the coordinates that you give to the PixelGetColor function relate to the entire display, the active gui or the client area of that active gui. (Check the help file for more info: https://www.autoitscript.com/autoit3/docs/functions/AutoItSetOption.htm)

Of course there could be other things wrong, but given your information the only other explanation that I see (and I may be missing stuff too obviously) is that the color could be wrong after all due to some sort of misunderstanding. Maybe you could post an anonymized example of one of those invoices so we have something to test your code with to exclude that possibility.

/edit: yes, I know you are stating you verified that with consolewrite tests, but apparently there's some sort of misunderstanding there because otherwise it would work :)

Edited by SadBunny

Roses are FF0000, violets are 0000FF... All my base are belong to you.

  • Developers
Posted
23 minutes ago, SadBunny said:

 

I also don't see how the answers in this thread were anything but straightforward.

 

Could it be you guys fire too much info at the OP, whim is already in a state of despair as "the stupid script isn't doing what  it is supposed to do"? ;)
Maybe you all need to slow down a little and not roll over each other answering in  different directions.

Jos 
 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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
  • Recently Browsing   0 members

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