Advertisement
Guest User

Untitled

a guest
Apr 4th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  1. <?php
  2. $mn = $argv[1];
  3.  
  4. $file1 = array();
  5. $file2 = array();
  6.  
  7. $file1 = file($mn . '.ide');
  8. $file2 = file($mn . '.opl');
  9.  
  10. if (!$file1) return false;
  11. if (!$file2) return false;
  12.  
  13. list($a1, $b1, $c1, $d1, $e1, $f1, $g1, $h1, $i1, $j1, $k1, $l1, $m1, $n1, $o1, $p1, $q1, $r1, $s1, $t1, $u1, $v1, $w1, $x1, $y1, $z1) = explode(', ', trim($file1[0], ', '));
  14. list($a2, $b2, $c2, $d2, $e2, $f2, $g2, $h2, $i2, $j2, $k2, $l2, $m2, $n2, $o2, $p2, $q2, $r2, $s2, $t2, $u2, $v2, $w2, $x2, $y2, $z2) = explode(', ', trim($file2[0], ', '));
  15.  
  16. $t = '';
  17.  
  18. $g = '$schema';
  19.  
  20. $t .= <<<TXT
  21.         {
  22.             "aabbMin": [
  23.                 {$f1},
  24.                 {$g1},
  25.                 {$h1}
  26.             ],
  27.             "aabbMax": [
  28.                 {$i1},
  29.                 {$j1},
  30.                 {$k1}
  31.             ],
  32.             "centroid": [
  33.                 {$l1},
  34.                 {$m1},
  35.                 {$n1}
  36.             ],
  37.             "radius": {$o1},
  38.             "archetypeName": "{$a1}",
  39.             "txdName": "{$b1}"
  40.         },
  41. TXT;
  42.  
  43. $m = <<<TXT
  44. {$t}
  45.         {
  46.             "position": [
  47.                 {$a2},
  48.                 {$b2},
  49.                 {$c2}  
  50.             ],
  51.             "rotation": [
  52.                 {$d2},
  53.                 {$e2},
  54.                 {$f2},
  55.                 {$g2}
  56.             ],
  57.             "guid": "0",
  58.             "archetypeName": "{$h2}"
  59.         },
  60. TXT;
  61.  
  62. file_put_contents($mn . '.json', $m);
  63. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement