So i am making a rpg game and i am using s = fs.open("saves", "w"). I am putting in numbers for coords such as when i hit the up button or "200" as a raw key event it does some math on y taking away 1. What i want my program to do is write in the file saves being the first line as the x coord and the second line as the y coord and then the program reading that and then plugging that into the term.setCursorPos(a,

a is the final version of y and b is the final version of x. I use them to do that math such as a = y+1 or b= x+1. That way variables dont get screwed up by using x and y.
Here is my current code.
q = 1
x = 5
y = 5
term.setCursorPos(x,y)
print("@")
while true do
local event, p1 = os.pullEvent("key")
if p1 == 200 then
a = y-q
term.setCursorPos(x,a)
s = fs.open("saves", "w")
s.write(a)
s.close()
term.clear()
print("@")
end
end
and the pastebin id is VR7L6vcK