procedure UpdateWindowPositions;
var f : Integer;
var s : Integer;
var c : char;
var count : Integer;
var text : String;
var line : String;
begin
f := OpenFile(wurm_path + 'window_positions.txt', true);
s := FileSize(f);
ReadFileString(f, text, s);
CloseFile(f);
for f := 1 to s do
begin
c := StrGet(text, f);
if(line = 'skills ') then
begin
line := '';
count := 0;
while(count < 4) do
begin
c:=StrGet(text, f);
if ((c = ' ') or (GetKeyCode(c) = 13)) then
begin
count := count + 1;
windows[window_skills][count] := StrToInt(line);
line := '';
end else if isNumber(c) then
line := line + c;
f:= f+1;
end;
end else if(line = 'event ') then
begin
line := '';
count := 0;
while(count < 4) do
begin
c:=StrGet(text, f);
if ((c = ' ') or (GetKeyCode(c) = 13)) then
begin
count := count + 1;
windows[window_event][count] := StrToInt(line);
line := '';
end else if isNumber(c) then
line := line + c;
f:= f+1;
end;
end else if(line = 'inventory ') then
begin
line := '';
count := 0;
while(count < 4) do
begin
c:=StrGet(text, f);
if ((c = ' ') or (GetKeyCode(c) = 13)) then
begin
count := count + 1;
windows[window_inventory][count] := StrToInt(line);
line := '';
end else if isNumber(c) then
line := line + c;
f:= f+1;
end;
end else if(line = 'stats ') then
begin
line := '';
count := 0;
while(count < 4) do
begin
c:=StrGet(text, f);
if ((c = ' ') or (GetKeyCode(c) = 13)) then
begin
count := count + 1;
windows[window_stats][count] := StrToInt(line);
line := '';
end else if isNumber(c) then
line := line + c;
f:= f+1;
end;
end else if(line = 'chat ') then
begin
line := '';
count := 0;
while(count < 4) do
begin
c:=StrGet(text, f);
if ((c = ' ') or (GetKeyCode(c) = 13)) then
begin
count := count + 1;
windows[window_chat][count] := StrToInt(line);
line := '';
end else if isNumber(c) then
line := line + c;
f:= f+1;
end;
end else if not (GetKeyCode(c) = 13) then
line := line + c;
end;
end;