Guest Guest_Nathan546 Posted June 11, 2004 Share Posted June 11, 2004 Im trying to make it get the cordinates of something and put them into a config file heres what i have but when i run it it clicks in the wrong spot. $thing = IniRead("Config.ini", "Cordinates", "thing", "Thing Not Found") Sleep(2000) MouseClick("left", $thing, 1) and the file to get the cordinates has this Sleep(1000) MsgBox(4096, "Paused", "Put your cursor on the cordinates",) Sleep(5000) $pos = MouseGetPos() IniWrite("Config.ini", "Cordinates", "thing", $pos[0] & "," & $pos[1]) MsgBox(4096, "Paused", "thing cordinates have been set",) when i run the cordinates script and it sets the cordinates fine, then i run the script to make it click at the cordinates and it clicks completly off. Whats wrong!? Thanks. Link to comment Share on other sites More sharing options...
Guest Guest Posted June 11, 2004 Share Posted June 11, 2004 Ok it still doesn't work but, i changed IniWrite("Config.ini", "Cordinates", "thing", $pos[0] & "," & $pos[1]) to IniWrite("Config.ini", "Cordinates", "thing", $pos[0] & ", " & $pos[1]) theirs a space that i added. Space here^^ And now when i take the cordinates out of the config manually and insert them into the script it clicks in the right spot but when i tell it to read it from the config file thing it doesnt click in the right spot. Help again. Thanks. Link to comment Share on other sites More sharing options...
nathan546 Posted June 11, 2004 Share Posted June 11, 2004 Forgot to log in Also i just tried this and it doesnt work Sleep(1000) MsgBox(4096, "Paused", "Put your cursor on the coordinates",) Sleep(5000) $pos = MouseGetPos() MsgBox(4096, "Paused", "Blah blah",) Sleep(2000) MouseClick("left", $pos[0] & ", " & $pos[1], 1) oh well off to sleep *hopes someone knows* Link to comment Share on other sites More sharing options...
nathan546 Posted June 11, 2004 Share Posted June 11, 2004 When it clicks its, it clicks completly at the top of my screen, so the cordinates 1, 1 work but thats about all. $user = IniRead("Config.ini", "Cordinates", "user", "not found") MouseClick("left", $user, 1, 1) [Cordinates] user=1, 1 but if user is something like user=800, 700 it doesnt even get close to where its supposed to click. Link to comment Share on other sites More sharing options...
pekster Posted June 11, 2004 Share Posted June 11, 2004 (edited) Also i just tried this and it doesnt work Sleep(1000) MsgBox(4096, "Paused", "Put your cursor on the coordinates",) Sleep(5000) $pos = MouseGetPos() MsgBox(4096, "Paused", "Blah blah",) Sleep(2000) MouseClick("left", $pos[0] & ", " & $pos[1], 1)Found the problem. You can't use the comma as a string, since you actually want to give another argument. Also, when you read from the ini file in your first example, it's the entire string. So, it actually ended up sending MouseClick("left", "800,600", 1). Now, to further understand why it clicked the top of your screen, remember that AutoIt uses a string as the number 0 if it should have been a number. That accounts for your strange click location. In the quoted example above in this post, you'll notice you have the same problem. It's actually clicking at the coordinates (0, 1) since the string is 0, and you gave it a 1 (probably ment to be the number of clicks, but since that's optional, AutoIt thought you ment coordinates 0 by 1.) To solve your problem, don't concatenate your paramaters. Just use $pos[0], $pos[1]. Also, you'd have to parse your string that you sent to your ini to get 2 seperate paramaters that you can enter. Edited June 11, 2004 by pekster [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
Guest Guest Posted June 12, 2004 Share Posted June 12, 2004 Thanks i came up with this after you gave me some help. Sleep(1000) MsgBox(4096, "Paused", "Put cursor on cordinates",) Sleep(3000) $Cordinates = MouseGetPos() MsgBox(4096, "Paused", "Cordinates Set",) Mouseclick("left", $Cordinates[0], $Cordinates[1], 1, 1) Going to try to put it in a ini now. Link to comment Share on other sites More sharing options...
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