how to make random mouse click

06/26/2013 23:09 sander2828#1
well i have movable gui and i want to make random mouseclicks inside the gui
gui positions are $Bpos[0] $Bpos[1] $Bpos[2] $Bpos[3].

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:
[Only registered and activated users can see links. Click Here To Register...]
06/26/2013 23:15 lordsill#2
Do you know the size of the black box?

Then:
Code:
$x = $Bpos[2]-(width of the black box); Define the lowest X position
$y = $Bpos[3]-(height of the black box); Define the lowest Y postion

While 1; Enless-Loop
$randomX = Random($x, $Bpos[2], 1); Random X-Coordinates
$randomY = Random($y, $Bpos[3], 1); Random Y-Coordinates

MouseClick("left", $randomX, $randomY); Left-MouseClick on this Coordinates
WEnd
06/26/2013 23:20 sander2828#3
hmm i think i figured it out how will try and let u know

well it is messing up may i send u the full script so u could test it and look why?

Quote:
#NoTrayIcon
AutoItSetOption("TrayIconHide", 1)
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=favicon.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GDIPlus.au3>
#include <WinApi.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <GDIPlus.au3>
#include <WinApi.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
HotKeySet("{F10}", "_Toggle")
HotKeySet("{q}", "killall")
HotKeySet("{Esc}", "_Exit")
HotKeySet("{e}", "test")
$Size1 = 760
$Size2 = 530
$Size3 = 225
$Size4 = 148
$Color = 0xFFFFAA00
$Thick = 3
$Toggle = False
$kill = False

$Form1 = GUICreate("Aimbot", $Size1, $Size2, -1, -1, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
GUISetState()
$Pic1 = GUICtrlCreatePic("bg.gif", 0, 0, $Size1, $Size2)
$Button1 = GUICtrlCreateButton("i", -1000, -1000, -1000, -1000)
$Button2 = GUICtrlCreateButton("e", -1000, -1000, -1000, -1001)
_WinAPI_SetLayeredWindowAttributes($Form1, 0x00FF00)
_GDIPlus_Startup()
$Handle = _GDIPlus_GraphicsCreateFromHWND($Form1)
$Pencil = _GDIPlus_PenCreate($Color, $Thick)
_GDIPlus_GraphicsDrawRect($Handle, 5, 5, $Size1 - 10, $Size2 - 10, $Pencil)
_GDIPlus_GraphicsDrawRect($Handle, 540, 387, $Size3 - 10, $Size4 - 10, $Pencil)



While 1
$nMsg = GUIGetMsg()
$Bpos = WinGetPos("Aimbot")
If $Toggle Then
ToolTip("Move your mouse (f10 to end)")
$pos = MouseGetPos()
WinMove("Aimbot", "", $pos[0], $pos[1])

Else
ToolTip("")
Sleep(200)
EndIf
WEnd

$xi = $Bpos[2] - (225)
$yi = $Bpos[3] - (148)

func test()
MouseClick("primary", Random($xi, $Bpos[2], 1), Random($yi, $Bpos[3], 1), 1)
EndFunc

HotKeySet("{ESC}", "_Exit")

Func _Exit()
Exit
EndFunc ;==>_Exit
well here is the script
06/27/2013 00:29 omer36#4
PHP Code:
;small box
$wdith 
140 ;edit this
$hight 
80   ;and this

$x 
$Bpos[0]+$Bpos[2]-$wdith
$y 
$Bpos[1]+$Bpos[3]-$hight

$x2 
$Bpos[0]+$Bpos[2]
$y2 $Bpos[1]+$Bpos[3]

MouseClick("primary"Random($x$x2), Random($y$y2)) 
06/27/2013 00:31 sander2828#5
will try and say what happened

ty to all who helped
#closerequest
06/28/2013 23:58 xxfabbelxx#6
closed