Jump to content

Mouseclick coordinate changing


Recommended Posts

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..

Link to comment
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, 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!

Link to comment
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

Link to comment
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

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.
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...