Jump to content

Filewrite error


Recommended Posts

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!

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