Sign in to follow this  
Followers 0
DNnlee

Mouseclick coordinate changing

4 posts in this topic

How would i get this to work... i want to Input a number.. and make the program CLick at a different place according to the number i input... input number range from 1 to 7

$S = inputbox("Question", "Position", "0", "", -1, -1, 0, 0)


Dim $Slot[8]
$Slot[0] = "45, 15"   ;;;;;; these are the diff coordinates  for each number
$Slot[1] = "115, 15"
$Slot[2] = "45, 35"
$Slot[3] = "115, 35"
$Slot[4] = "45, 60"
$Slot[5] = "115, 60"
$Slot[6] = "45, 80"
$Slot[7] = "115, 80"

mouseclick("left" , $Slot[$S])

it says my parameter is wrong..

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Fixed your code:

$S = inputbox("Question", "Position", "0", "", -1, -1, 0, 0)

Dim $Slot[8][2]
$Slot[0][0] = "45"   
$Slot[0][1] = "15"
$Slot[1][0] = "115"
$Slot[1][1] = "15"
$Slot[2][0] = "45"
$Slot[2][1] = "35"
$Slot[3][0] = "115"
$Slot[3][1] = "35"
$Slot[4][0] = "45"
$Slot[4][1] = "60"
$Slot[5][0] = "115"
$Slot[5][1] = "60"
$Slot[6][0] = "45"
$Slot[6][1] = "80"
$Slot[7][0] = "115"
$Slot[7][1] = "80"

mouseclick("left" , $Slot[$S][0],$Slot[$S][1])

Edit: Oh and so you know what was going on, Mouseclick takes 3 parameters, not 2 like you gave it. In fact what you did was saying to it "Click the left button at xpos 45, 15 and no ypos" :D

Edited by monoceres

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

Fixed your code:

$S = inputbox("Question", "Position", "0", "", -1, -1, 0, 0)

Dim $Slot[8][2]
$Slot[0][0] = "45"   
$Slot[0][1] = "15"
$Slot[1][0] = "115"
$Slot[1][1] = "15"
$Slot[2][0] = "45"
$Slot[2][1] = "35"
$Slot[3][0] = "115"
$Slot[3][1] = "35"
$Slot[4][0] = "45"
$Slot[4][1] = "60"
$Slot[5][0] = "115"
$Slot[5][1] = "60"
$Slot[6][0] = "45"
$Slot[6][1] = "80"
$Slot[7][0] = "115"
$Slot[7][1] = "80"

mouseclick("left" , $Slot[$S][0],$Slot[$S][1])

Edit: Oh and so you know what was going on, Mouselick takes 3 parameters, not 2 like you gave it. In fact what you did was saying to it "Click the left button at xpos 45, 15 and no ypos" :D

thx.. that really clarified a lot :D

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Fixed your code:

$S = inputbox("Question", "Position", "0", "", -1, -1, 0, 0)

Dim $Slot[8][2]
$Slot[0][0] = "45"   
$Slot[0][1] = "15"
$Slot[1][0] = "115"
$Slot[1][1] = "15"
$Slot[2][0] = "45"
$Slot[2][1] = "35"
$Slot[3][0] = "115"
$Slot[3][1] = "35"
$Slot[4][0] = "45"
$Slot[4][1] = "60"
$Slot[5][0] = "115"
$Slot[5][1] = "60"
$Slot[6][0] = "45"
$Slot[6][1] = "80"
$Slot[7][0] = "115"
$Slot[7][1] = "80"

mouseclick("left" , $Slot[$S][0],$Slot[$S][1])

Edit: Oh and so you know what was going on, Mouselick takes 3 parameters, not 2 like you gave it. In fact what you did was saying to it "Click the left button at xpos 45, 15 and no ypos" :D

Or maybe

$coords = "45, 15; 115, 15;45, 35;115, 35;45, 60;115, 60;45, 80;115, 80"
$slotA = StringSplit(StringStripWS($coords,8),";")
Dim $slot[$slotA[0]][2]
For $n = 1 To $slotA[0]
    $temp = StringSplit($slotA[$n],',')
    $slot[$n - 1][0] = $temp[1]
    $slot[$n - 1][1] = $temp[2]
Next

$S = inputbox("Question", "Position", "0", "", -1, -1, 0, 0)
mouseclick("left" , $Slot[$s][0],$Slot[$S][1])
Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
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
Sign in to follow this  
Followers 0