Jump to content

Über n00b requires assistance!


PR3BI
 Share

Recommended Posts

Hey guys. I'm just wondering this one thing, because I saw a script by a guy ( I cannot remember :/ ). And his script was a bot that you could set where you wanted your bot to pixelsearch and what colors to look for etc. But what I was wondering was if anyone could show me a script where you press hold your mouse cursor where you want the pixels to search. I point my cursor where I want the pixelsearch to search left and I hit F1 or whatever button assigned for it. And I just continue with my Up, Right and Bottom coords. I tried to do this myself, by using MouseGetCoord but of course, failed epicly :D

NOTE! I'm not asking you to make me an entire script, only the function and explained command, so that I'll understand. pl0x?

Link to comment
Share on other sites

  • Moderators

PR3BI,

Does this help you get started? :D

HotKeySet("{ESC}", "On_Exit")
HotKeySet("{F1}", "_Get_Coords")

While 1
    Sleep(10)
WEnd

Func _Get_Coords()
    $aPos = MouseGetPos()
    ConsoleWrite("Mouse is at " & $aPos[0] & " - " & $aPos[1] & @CRLF)
EndFunc

Func On_Exit()
    Exit
EndFunc

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

$pos = MouseGetPos()
HotKeySet("{ESC}", "terminate")
HotKeySet("{F1}", "pos")
While 1
    Sleep(20)
WEnd

Func pos()
    $target = PixelSearch($pos[0], $pos[1], $pos[2], $pos[3], 0xDEFFD6)
    If Not @error Then
        MouseMove($target[0], $target[1], 0)
        EndIf
    EndFunc

    Func terminate()
        Exit
    EndFunc

PR3BI,

Does this help you get started? :D

HotKeySet("{ESC}", "On_Exit")
HotKeySet("{F1}", "_Get_Coords")

While 1
    Sleep(10)
WEnd

Func _Get_Coords()
    $aPos = MouseGetPos()
    ConsoleWrite("Mouse is at " & $aPos[0] & " - " & $aPos[1] & @CRLF)
EndFunc

Func On_Exit()
    Exit
EndFunc

M23

Firstly, thank you so much for replying, M23. This is somewhat what I am looking for, but it's hard to explain - I'm bad to explain things :')

But more specificly, I want the script to USE the coordinates my mouse is currently on. So lets say that I'm making a simple bot that works with any flash game etc. What I want is to make my 4 Pixelsearch locations ( Pixelsearch (Left, Up, Right, Bottom ). When I press F1 once, the script saves that Left coordinate. Second time, Up. Next time, Right and the last time Bottom. Do you understand? Hard to explain ^^. Here's an example of what I tried to script, but failed epicly.

Anyway, thanks a lot!

Link to comment
Share on other sites

  • Moderators

PR3BI,

First time you press F1 you mark the top-left corner of the area to search - second time the bottom-right:

HotKeySet("{ESC}", "On_Exit")
HotKeySet("{F1}", "_Get_Coords")

Global $iState = 1, $iColor = 0xFFFFFF ; or whatever you want
Global $aCoords[4][2], $iLeft, $iTop

While 1
    Sleep(10)
WEnd

Func _Get_Coords()

    $iState = Not $iState

    Switch $iState
        Case 0
            $aPos = MouseGetPos()
            $iLeft = $aPos[0]
            $iTop = $aPos[1]
            ConsoleWrite("Left coordinate is at " & $aPos[0] & @CRLF & "Top coordinate is at " & $aPos[1] & @CRLF)

        Case 1
            $aPos = MouseGetPos()
            ConsoleWrite("Right coordinate is at " & $aPos[0] & @CRLF & "Bottom coordinate is at " & $aPos[1] & @CRLF)

            $aPos = PixelSearch($iLeft, $iTop, $aPos[0], $aPos[1], $iColor)
            If @error Then
                ConsoleWrite("Colour not found" & @CRLF)
            Else
                ConsoleWrite("Colour found at " & $aPos[0] & " x " & $aPos[1] & @CRLF)
            EndIf
    EndSwitch

EndFunc

Func On_Exit()
    Exit
EndFunc

Getting closer? :D

Ask if anything is unclear.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Sobiech,

I quite agree that ToolTips would be a sensible way to do this in a finished product - the ConsoleWrite commands are just to show what is going on. Remember the OP wants to do this himself, he does not want a fully packaged solution. :D

I saw nice UDF for this

Quite correct, about 2 posta above this one! :huggles:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Sobiech,

I quite agree that ToolTips would be a sensible way to do this in a finished product - the ConsoleWrite commands are just to show what is going on. Remember the OP wants to do this himself, he does not want a fully packaged solution. :D

Quite correct, about 2 posta above this one! :

M23

HERE

http://www.autoitscript.com/forum/index.php?showtopic=93527&st=0&p=701504&hl=Smoke_N&fromsearch=1&#entry701504

This is awesome Tool for getting informations from screen / window :huggles:

Good Luck

This world is crazy

Link to comment
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
 Share

  • Recently Browsing   0 members

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