DNnlee Posted May 15, 2008 Posted May 15, 2008 (edited) i have 2 coordinates in my INI file, and i want the script to click randomly within this area [Pixel] topleft = 10,10 ;;;; topleft parameter bottomright = 30,30;;;;; bottomright parameter so i want it to click randomly within this region i don't want it to be a set number of clicks with set coordinates, cuz the parameter will change so i was thinking: but not sure if this is the best way. $Click = IniReadSection("data.ini", "pixel") $RandomX = random( $click[1][1] , $click[2][1] ) $RandomY = random( $click[1][2] , $click[2][2] ) mouseclick("left", $RandomX , $RandomY) i get a error in this thing... Edited May 15, 2008 by DNnlee
sandin Posted May 15, 2008 Posted May 15, 2008 search RANDOM function from help files, using this function you can set min random, and max. random number (which can be read from your ini file). Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll
DNnlee Posted May 15, 2008 Author Posted May 15, 2008 search RANDOM function from help files, using this function you can set min random, and max. random number (which can be read from your ini file).yea thats what i did.... forgot i left out the word random between the varaible.. ooopsi'll try again
sandin Posted May 15, 2008 Posted May 15, 2008 here's an example code: #include <GUIConstants.au3> Opt("MouseCoordMode", 2) $x = 600 $y = 450 $speed = 250; 0 = fastest $Form1 = GUICreate("AForm1", $x, $y, 200, 120) $Button1 = GUICtrlCreateButton("Random Click", 8, 416, 113, 25, 0) $Label1 = GUICtrlCreateLabel("Coordinates: X, Y", 150, 423, 200) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $Button1 $randomX = Random(0, $x, 1) $randomY = Random(0, $y, 1) GUICtrlSetData($Label1, "Coordinates: " & $randomX & ", " & $randomY) MouseClick("Left", $randomX, $randomY, 1, $speed) EndSwitch WEnd and you can make your script to read $x and $y variables from ini file ;p Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll
DNnlee Posted May 15, 2008 Author Posted May 15, 2008 here's an example code: #include <GUIConstants.au3> Opt("MouseCoordMode", 2) $x = 600 $y = 450 $speed = 250; 0 = fastest $Form1 = GUICreate("AForm1", $x, $y, 200, 120) $Button1 = GUICtrlCreateButton("Random Click", 8, 416, 113, 25, 0) $Label1 = GUICtrlCreateLabel("Coordinates: X, Y", 150, 423, 200) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $Button1 $randomX = Random(0, $x, 1) $randomY = Random(0, $y, 1) GUICtrlSetData($Label1, "Coordinates: " & $randomX & ", " & $randomY) MouseClick("Left", $randomX, $randomY, 1, $speed) EndSwitch WEnd and you can make your script to read $x and $y variables from ini file ;p ooOoOOoO i like it, thx... i'll play around with it
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now