Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
scan function problem
#1
Hello.

Im having problem with image recognition. If i use flag 128 it works with no problem. But if i want specify region it works only in first run. Once it repeats it wont detect object. Any sugestions? If i rerun script it will detect again in first run.
 
Code:
Copy      Help
    SetEndThreadHotkey "F12"    
    
    opt save; opt slowkeys 1;opt slowmouse 0; spe 50
    
    
    int+ w1=act(win("game" "D3D Window"))
    str+ dash="1"
    str+ key_retarget="y"
    str+ attack1="3"
    str+ attack2="4"
    str+ attack3="5"
    int+ center_pos_x=520
    int+ center_pos_y=50
    
    
    RECT scan_target
    SetRect &scan_target 330 5 420 60
    
        
    
    //START
    rep
        if scan("resource:fight.png" w1 scan_target 4|16|0x1100 60)
            key (attack1)(attack2)(attack3)
        else
            mou center_pos_x center_pos_y
            key (dash)(key_retarget)(key_retarget)
#2
Move the SetRect line into the rep loop. Because scan overwrites the RECT variable.


Code:
Copy      Help
    rep
        SetRect &scan_target 330 5 420 60
        if scan("resource:fight.png" w1 scan_target 4|16|0x1100 60)


Forum Jump:


Users browsing this thread: 1 Guest(s)