Sign in to follow this  
Followers 0
ZoneX

help with pic seartch

10 posts in this topic

how can i code it to search from 1.bmp to 100.bmp

Wrong way

AZPrintWindow()
$var = _findImageOnScreen("1.bmp", "0,0,0,0", 0)
$var = _findImageOnScreen("2.bmp", "0,0,0,0", 0)
$var = _findImageOnScreen("3.bmp", "0,0,0,0", 0)

Rigth way

AZPrintWindow()
$var = _findImageOnScreen("1.bmp,to,100.bmp", "0,0,0,0", 0)

can some one help me? :P

Share this post


Link to post
Share on other sites



I'm not familiar with the functions you're using, but try looking up For...Next loops in the help file. Here's an example:

For $num = 1 to 10
    MsgBox(0,"Example","The current number is: "&$num)
Next

Share this post


Link to post
Share on other sites

I'm not familiar with the functions you're using, but try looking up For...Next loops in the help file. Here's an example:

For $num = 1 to 10
    MsgBox(0,"Example","The current number is: "&$num)
Next

nice :P

Tanks :nuke:

Share this post


Link to post
Share on other sites

still need helpz0r :/

Share this post


Link to post
Share on other sites

try to use Do Until

Share this post


Link to post
Share on other sites

Sorry, I'm not psychic... could you post the code you have right now, and explain which part is bothering you? I'm not going to hand you a working script (how would you ever learn anything?), but if you show that you've put some effort into creating one, I or someone else will be happy to point out where you've gone wrong. If you're having trouble understanding the concept of For/Next loops, I would again recommend that you read the relevant help file topic.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

HotKeySet("{f1}", "startrank")
HotKeySet("{f2}", "restart")
HotKeySet("{f3}", "Terminate")

While 1
    Sleep(1000)
WEnd

Func Terminate()
    Exit 0
EndFunc

Func restart()
    If @Compiled = 1 Then
        Run( FileGetShortName(@ScriptFullPath))
    Else
        Run( FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath))
    EndIf
    Exit
EndFunc



    Func startrank()
        WinActivate( "NORDICMAFIA" , "NORDICMAFIA" )
MouseClick("left", 130, 368, 1)
Sleep( 1200 )
MouseClick("left", 365, 529, 1)
Sleep( 1200 )
MouseClick("left", 502, 628, 1)
Sleep( 1200 )
MouseClick("left", 122, 381, 1)
Sleep( 1200 )
MouseClick("left", 505, 330, 1)
Sleep( 1200 )
MouseClick("left", 115, 503, 1)
Sleep( 1200 )
MouseClick("left", 246, 389, 1)
Sleep( 1200 )
MouseClick("left", 428, 403, 1)
Sleep( 1200 )
MouseClick("left", 136, 431, 1)
Sleep( 1200 )
MouseClick("left", 278, 319, 1)
Sleep( 1200 )
MouseClick("left", 715, 412, 1)
sleep(182000)
SplashTextOn("Bot", "2Secons TO GO!.F2 TO restart! F3 TO Terminate!", -1, -1, -1, -1, 4, "", 24)
        WinActivate( "NORDICMAFIA" , "NORDICMAFIA" )
Sleep(2000)
SplashOff()

$go = send( "{f1}" )

EndFunc

Need to crack the anti bot.

http://www.hot-joints.biz/antibot.jpg

anti bot: sellect random 3 pic`s off cars

i have downloaded all off the pic`s en need to do an pic scan betwen MouseClick`s

#include "array.au3"
global $AZDLLName = "analizer.dll"

AZPrintWindow()
$var = _findImageOnScreen("ca1.bmp", "0,0,0,0", 0) <----- HOW can i gett it to seach from car1.bmp to car100.bmp ??

If $var <> 0 Then
    For $r = 1 to UBound($var)-1
        MouseMove($var[$r][1] , $var[$r][2], 20 )
        Sleep(200)
    Next
EndIf

;Find image on screen and return cords
;findFile: File you want to find on the screen
;rect: x,y,width,height
;first: 1 = find first 0 = find all
Func _findImageOnScreen($findFile, $rect, $first)
    Dim $mouseCords[1][3]
    
    $rects = ""
    $trans = 0
    $color = ""

    $result = DllCall($AZDLLName, "int", "image_in_clipscreen_rects", "str", $findFile, "int", $first, "int", $trans, "str", $color, "str", $rect, "str", $rects)

    AZDllError("AZTextRects")
    $rects = $result[6]
;MsgBox(0,"",$rects)

    if $rects <> "" then
        $rects = stringright($rects, stringlen($rects) - 1)
        $rects = stringsplit($rects, ";")
        $mouseIndex = $rects[0]
        ReDim $mouseCords[$mouseIndex+1][3]
    else
        $rects = _arraycreate(0)
    endif

    if $rects[0] < 1 then
        return 0
    endif
    
    
    if ($rects[0] <> 0) then
        For $n = 1 to $mouseIndex
  ;MsgBox(0,$n,$rects[$n])
            $items = stringsplit($rects[$n], ",")
            if $items[0] = 4 then
                $mouseCords[$n][1] = $items[1] + $items[3] / 2
                $mouseCords[$n][2] = $items[2] + $items[4] / 2
            
                $pWidth  = $items[3]
                $pHeight = $items[4]
            ElseIf $items[0] = 3 then
                $mouseCords[$n][1] = $items[1] + $pWidth / 2
                $mouseCords[$n][2] = $items[2] + $pHeight / 2
            Else
                AZTraceError("Index of the needed text rect out of bounds.")
                AZExit()
            Endif
            
      ;MsgBox(0,$mouseCords[$n][1],$mouseCords[$n][2])
            

        Next
    else
        $items = _arraycreate(0)
    endif

    return $mouseCords
EndFunc


; Print window to clipboard (don't ALT PRINTSCREEN)
func AZPrintWindow()
    $result = DllCall($AZDLLName, "none", "active_window_to_clip")
    AZDllError("AZPrintWindow")
endfunc

;Error
func AZDllError($func)
    if @error <> 0 then AZTraceError("'" & $func & "' function run error")
endfunc

; Tracing error
func AZTraceError($error)
    MsgBox(16, "Analizer error.", $error)
endfunc

:P:nuke:

Edited by ZoneX

Share this post


Link to post
Share on other sites

Ro ned løken påsan. 1,5 time er ikke mye å vente på et svar.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Any uppdate on this?

I currently have a bot witch does all functions on the page except this damn antibot.

Well i hope you are still working on this, here are some code i came upp with i have tried it, but i cant get it to work yett, but i think with a some adjustments we might get it to work.

$pic = 0
AZPrintWindow()
Do
$pic = $pic +1 ; vill add 1 for each loop, limited a few lines down.
$var = _findImageOnScreen($pic & ".bmp", "0,0,0,0", 0) ; what to search for.
ConsoleWrite("var = " & $var) ;just code for debug
ConsoleWrite(" scanning pic" & $pic & ".bmp |" & @CRLF) ;just code for debug
If $pic = 31 Then ; Limit the search to 31 pictures.
    $pic = 0 ;reset picture var to 0 for research.
EndIf
until $var <> 0 ; if var value <>0 then search completed.
Edited by jokke

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0