Jump to content

Read numbers from file


Recommended Posts

I have a txt named coords.txt, theres some number in it, 1 number in every line like:

600
800

My program read this 2 coords then write it back to the file and bring the cursor to this pixels:

If FileExists("coords.txt") Then
$file = FileOpen("coords.txt", 1)
FileReadLine($file, $mapx)
FileReadLine($file, $mapy)
FileWriteLine($file, GUICtrlRead($mapx))
FileWriteLine($file, GUICtrlRead($mapy))
FileClose($file)
MouseMove($mapx,$mapy, 0)

But after the program ends the file contains:

600
800
0
0

and the mouse at the 0,0 pixel, any idea why?

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