You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GetUrlScript.txt 1.5 KiB

4 years ago
4 years ago
4 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. var res:string;
  2. i:byte;
  3. osX,osY,prX,prY:integer;
  4. begin
  5. res:='t';
  6. osX:=round(intpower(2,GetZ-1)) div 2;
  7. osY:=round(intpower(2,GetZ-1)) div 2;
  8. prX:=osX; prY:=osY;
  9. for i:=2 to GetZ do
  10. begin
  11. prX:=prX div 2;
  12. prY:=prY div 2;
  13. if GetX<osX
  14. then begin
  15. osX:=osX-prX;
  16. if GetY<osY then begin
  17. osY:=osY-prY;
  18. res:=res+'q';
  19. end
  20. else begin
  21. osY:=osY+prY;
  22. res:=res+'t';
  23. end;
  24. end
  25. else begin
  26. osX:=osX+prX;
  27. if Gety<osy then begin
  28. osY:=osY-prY;
  29. res:=res+'r';
  30. end
  31. else begin
  32. osY:=osY+prY;
  33. res:=res+'s';
  34. end;
  35. end;
  36. end;
  37. if GetY <7 then insert('10',GetURLBase,13) else insert('8',GetURLBase,13);
  38. case GetY of
  39. 7: ResultURL:=GetURLBase+COPY(res,1,6)+'/'+res+'.png';
  40. 8: ResultURL:=GetURLBase+COPY(res,1,6)+'/'+res+'.png';
  41. 9: ResultURL:=GetURLBase+COPY(res,1,6)+'/'+res+'.png';
  42. 10: ResultURL:=GetURLBase+COPY(res,1,6)+'/'+res+'.png';
  43. 11: ResultURL:=GetURLBase+COPY(res,1,6)+'/'+res+'.png';
  44. 12: ResultURL:=GetURLBase+COPY(res,1,6)+'/'+res+'.png';
  45. 13: ResultURL:=GetURLBase+COPY(res,1,6)+'/'+res+'.png';
  46. else
  47. ResultURL:=GetURLBase+res+'.png';
  48. end
  49. end.