Jump to content

newbie question :S


kazhkaz
 Share

Recommended Posts

I looked to help files but i didnt found what i wanted so i will ask for your help :P

Thirst fing i want to ask how to make that mouse move all over the screen and then its point changes that it stop and make some commands :lmao:

If u dont understand what i just said becose of my bad english i will explain easier :)

I am making a bot so i need that the mouse move all over the screen and when it tips on the mob,it makes other commands :( sorry for my bad english and thanks for your help :)

Link to comment
Share on other sites

I looked to help files but i didnt found what i wanted so i will ask for your help :P

Thirst fing i want to ask how to make that mouse move all over the screen and then its point changes that it stop and make some commands :lmao:

If u dont understand what i just said becose of my bad english i will explain easier :)

I am making a bot so i need that the mouse move all over the screen and when it tips on the mob,it makes other commands :( sorry for my bad english and thanks for your help :)

I am not into gaming but rather than having the mouse move all over the place it would surely be better to search for a particular colour using PixelSearch and then do a MouseClick on that coordinates.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

ok :P now i have another problem :lmao: how can i order to move the mouse where that color is? :(

Just use MouseClick to click on the coordinate you want .


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

  • Moderators

Opt('PixelCoordMode', 0); check help file with OPT to see what 0 should be
Opit('MouseCoordMode', 0); same as above

While 1
$PixCoord = PixelSearch(x-StartCoord, y-StartCoord, x-StopCoord, y-StopCoord, Color)
If Not @error And IsArray($PixCoord) Then
MouseClick("left", $PixCoord[0], $PixCoord[1], 1, 1)
EndIf
Wend

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Opt('PixelCoordMode', 0); check help file with OPT to see what 0 should be
Opit('MouseCoordMode', 0); same as above

While 1
$PixCoord = PixelSearch(x-StartCoord, y-StartCoord, x-StopCoord, y-StopCoord, Color)
If Not @error And IsArray($PixCoord) Then
MouseClick("left", $PixCoord[0], $PixCoord[1], 1, 1)
EndIf
Wend
thanks for this, but i have a problem :S when i start this script my mouse goes to corner and i cant do anything so if i want to shut it down i have to restart computer :S maybe u can tell me whats the problem and what i dont understand? :S thanks
Link to comment
Share on other sites

  • Moderators

Why don't you show your whole code... I'm not much into reading crystal balls till after midnight :P

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

WinActivate("SRO_Client")

Opt('PixelCoordMode', 1); check help file with OPT to see what 0 should be
Opt('MouseCoordMode', 1); same as above

While 1
$PixCoord = PixelSearch(0, 0, 900, 680, 0x625161)
If Not @error And IsArray($PixCoord) Then
MouseClick("left", $PixCoord[0], $PixCoord[1], 1, 1)
EndIf
Wend

Link to comment
Share on other sites

  • Moderators

1. That's pretty funny 'whole code', everything i wrote but the winactivate.

2. Get the Client Coords or the Window Coords of the window you are activating... your bound to have the color your looking for on your desktop, and Opt('PixelCoordMode', 1) (and mousecoordmode), are not window specific as 'window coords' or 'client coords' are.

3. Use Hotkeys if you want to exit or pause the script, the perfect example is right in the help file under hotkeyset.

4. Put a sleep() in the while loop so you don't burn your cpu up. Example Sleep(100) gives the cpu a bit of a rest.

Hope that helps...

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

yhanks that helped :P now i have another question :) where should i put these lines and what should i write that this proccess will go till a color in some place changes :lmao: thats the proccess:

Send("{1}")
Sleep(1000)
Send("{2}")
Sleep(500)
Send("{4}")
Sleep(500)
Send("{3}")

and that my whole script :( :

Opt('PixelCoordMode', 0); check help file with OPT to see what 0 should be
Opt('MouseCoordMode', 0); same as above

While 1
Sleep(100)
$PixCoord = PixelSearch(0, 0, 900, 680, 0x625161)
If Not @error And IsArray($PixCoord) Then
MouseClick("left", $PixCoord[0], $PixCoord[1], 1, 1)
Send("{1}")
Sleep(1000)
Send("{2}")
Sleep(500)
Send("{4}")
Sleep(500)
Send("{3}")
EndIf
Wend
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...