Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
scan function in wait command
#1
Im still creating a macro for a game here.
The game can be run in windowed mode as well as fullscreen.
Thats why i created my code to use client area for scans, so it works in both modes.
All commands that accept this mode like mou/lef/rig/pixel all work, but.....

When you use the scan functionality in the wait command i get a RT error about window not found when i use flag 16, while the application is in fullscreen.
When its in windowed mode no error is generated and all works fine.

Here is the piece of code:
The 1st line generates the error mentioned.
While the 2nd works. (Only for fullscreen ofcourse)
Code:
Copy      Help
bFound = wait(Application.IR.dTimeout, S, IR.filename, Application.sClientWindowClass, IR.r, iScanFlags)
bFound = wait(Application.IR.dTimeout, S, IR.filename, Application.sClientWindowClass, IR.r, iScanFlags ^ 16)

So i think there is a small bug in that functionality...

Complete function code im using:
Code:
Copy      Help
/
*******************************************
    FindImage v1.0
*******************************************
This is a macro to find images in screen.
*******************************************
function# tIR&IR [int'bCenterMouse] [int'bTransparent] [int'bDebug]
int bFound, iScanFlags
POINT pCurMousePos

iScanFlags = 16
if(bCenterMouse)
    iScanFlags | 1
if(bTransparent)
    iScanFlags | 4
Fill rectangle with search area.
IR.r = Application.IR.Search

Save curpos
xm(pCurMousePos, Application.sClientWindowClass, 1)
Move mouse at skill buton "S", to not obstruct IR
mou 432 576 Application.sClientWindowClass 1
wait Application.dMousePosDelay
Find the image
err-
bFound = wait(Application.IR.dTimeout, S, IR.filename, Application.sClientWindowClass, IR.r, iScanFlags)
bFound = wait(Application.IR.dTimeout, S, IR.filename, Application.sClientWindowClass, IR.r, iScanFlags^16)
err+
    out "%s[]%s" IR.filename, Application.sClientWindowClass
if(!bCenterMouse)
     Move mouse back to saved pos
    mou pCurMousePos.x pCurMousePos.y Application.sClientWindowClass 1
    wait Application.dMousePosDelay

if(bDebug)
    out "Search: left=%i, top=%i, right=%i, bottom=%i", Application.IR.Search.left, Application.IR.Search.top, Application.IR.Search.right, Application.IR.Search.bottom
    out "Button: file=''%s'', left=%i, top=%i, right=%i, bottom=%i", IR.filename IR.r.left, IR.r.top, IR.r.right, IR.r.bottom
    out "Found: %i", bFound

ret bFound
Well thats all for now, 3M
#2
Thank you. Now scan fails if flag 16 is used and client area coordinates are the same as window rectangle coordinates (no border and titlebar). Will be fixed in QM 2.1.8.6 (tomorrow).
#3
Thx for fixing so fast Wink

Where can i find this new version?
I checked the normal link and i think thats still 2.1.8.5?
At least when i look at the What's new

*edit*
Hmmm seems the file on link has grown 25KB, so it must be 2.1.8.6?

*edit2*
Nope i reinstalled the DLed file and the about etc all still say 2.1.8.5 :?
Well thats all for now, 3M
#4
Will upload 2.1.8.6 today.
#5
Hehe ok np, i just thought when you said tomorrow it would be by the time i checked (2 day later)...
I will check and see whenever you had time to upload it :wink:
Thanks...
Well thats all for now, 3M
#6
I just DL'ed the new version and all works as expected.
Great job! :wink: :lol:
Well thats all for now, 3M


Forum Jump:


Users browsing this thread: 1 Guest(s)