Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 17:43

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Mouse random move and click only on box

Discussion on Mouse random move and click only on box within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2012
Posts: 3
Received Thanks: 2
Mouse random move and click only on box

hello,
i want to ask something.
i need the code for mouse random move and click so just like this :
Move > click > Keys > Click and repeat.
i already made 1 just like this :

Code:
HotKeySet("{F1}", "Start")
HotKeySet("{F2}", "Stop")

while  1 = 1
WEnd

Func Stop()
   Exit
EndFunc

Func Start()
   While 1 = 1
$moveX = random (1,500,1)
$moveY = random (1,500,1)
Mouseclick("left",$moveX,$MoveY,1,20)
Sleep (100)
Send ("2")
Sleep (100)
Mouseclick("left",$moveX,$MoveY,1,20)
WEnd
EndFunc
But, the mouse still move into outside the box,
i used it for Ragnarok Online.

Thank's
joshxp is offline  
Old 03/24/2016, 11:13   #2
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
You have to place the window in that position to do it this way. Otherwise I would recommend you to get the position of the window and use it as an offset for your random-x and random-y values so they start at that point and end after offset+500 (I would suggest to adjust the 500 value too since I don't think the window is 500/500 big is it?)
alpines is offline  
Old 03/24/2016, 12:16   #3
 
°Incinerate's Avatar
 
elite*gold: 400
Join Date: Jun 2011
Posts: 513
Received Thanks: 101
As alpines said. The random retunds u from 1 to 500 but i dont think that yout box is in this area. So i have modified your script. Just do what i write in the messagebox.

Code:
#include <Misc.au3>

HotKeySet("{F1}", "Start")
HotKeySet("{F2}", "Stop")

Global $TopLeft, $BottomRight, $dll, $left, $bottom, $top, $right
$dll = DllOpen("user32.dll")

;~~~ set the area of your box
MsgBox(0, "TopLeft", "Put the mouse top left of your box and press then F8.")
While Not _IsPressed("77", $dll)
	$pos = MouseGetPos()
	ToolTip($pos[0] & " x " & $pos[1])
	Sleep(10)
WEnd
$top = $pos[1]
$left = $pos[0]
MsgBox(0, "TopLeft", $pos[0] & " x " & $pos[1] &  [MENTION=3576271]CRLF[/MENTION] &  [MENTION=3576271]CRLF[/MENTION] & "Put the mouse bottom right of your box and press then F8.")


While Not _IsPressed("77", $dll)
	$pos = MouseGetPos()
	ToolTip($pos[0] & " x " & $pos[1])
	Sleep(10)
WEnd
$bottom = $pos[1]
$right = $pos[0]
MsgBox(0, "BottomRight", $pos[0] & " x " & $pos[1] &  [MENTION=3576271]CRLF[/MENTION] &  [MENTION=3576271]CRLF[/MENTION] & "Now you can start you bot with F1 and end it with F2.")
;~~~ until here

;~~~ your modified script
While  1 = 1
	Sleep(10)
WEnd

Func Stop()
   Exit
EndFunc

Func Start()
   While 1 = 1
	$moveX = Random($left, $right, 1)
	$moveY = Random($top, $bottom, 1)
	Mouseclick("left", $moveX, $moveY, 1, 20)
	Sleep (100)
	Send ("2")
	Sleep (100)
	Mouseclick("left", $moveX, $moveY, 1, 20)
	WEnd
EndFunc
;~~~ until here
°Incinerate is offline  
Reply


Similar Threads Similar Threads
How to synchronization mouse click on minimap random time
09/25/2015 - DarkOrbit - 1 Replies
Hı guys I dont know in pixelbots mouseclik on minimap time settings example while(true) { int x = random.next(1110,1235); int y = random.next(840,950); point px = new point(x,y);
how to make random mouse click
06/28/2013 - AutoIt - 5 Replies
well i have movable gui and i want to make random mouseclicks inside the gui gui positions are $Bpos $Bpos $Bpos $Bpos. and i want clicks to be made in lower right corner of the gui. well that messed up my head lol well here is the screen of this movable gui the area where random clicks should be made is painted black: http://www.upload.ee/image/3407420/vajadus123.jpg
Mouse Click Move
01/26/2012 - Metin2 - 0 Replies
Hello I Have a Question for all the people who have experience in Metin2 Hacking, what function gets called when Mouse Walking I been moving my bot using the fuction that gets called be pressing the keys for movement and teleporting in small steps, the way that I am doing this gives me alot of problems I think the correct way would be calling the fuction that gets executed when left mouse click, I havent had any luck could anyone point me into the correct direction on solving this. I hope some...
How to npt move when using mouse double hit?
04/06/2006 - Conquer Online 2 - 3 Replies
when i use mouse double hit that lvling in tg. If some1 come near by it will go out. Does any1 know how to get not move?



All times are GMT +2. The time now is 17:43.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.