Leopardfist Posted January 22, 2010 Posted January 22, 2010 Func write() $pos = MouseGetPos() $file = FileOpen("C:\Users\Admin\Desktop\coordinates.txt", 1) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, $pos(0) & ", " & $pos(1)) FileClose($file) EndFunc this is the error I get C:\Users\Admin\Desktop\coord.au3 (19) : ==> Error in expression.: FileWrite($file, $pos(0)) FileWrite($file, ^ ERROR ->12:47:38 AutoIT3.exe ended.rc:1 Can anyone tell me how I can write with a variable or array? If not how would you suggest I perform this function... but keep in mind this is a function called from a hotkey, which I am using several times.... which is why I was attempting to write to a file rather than use a msgbox. Also the game is full screen mode so I cant use windowinfo. Thanks for the help!
somdcomputerguy Posted January 22, 2010 Posted January 22, 2010 Use square brackets in arrays FileWrite($file, $pos[0] & ", " & $pos[1]) - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Leopardfist Posted January 22, 2010 Author Posted January 22, 2010 AHH!! Thanks man, been awhile since I used Autoit hehe.
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