It is currently Sun May 20, 2018 6:45 am


[Help] TS Race Result Processor

Maybe you're a programmer and you've made some cool tool for TS. Share it here with all the other players.

Moderator: Forum Moderators

  • Author
  • Message
Offline

Rendy Andrian

Community User Level: 2

Community User Level: 2

  • Posts: 226
  • Joined: Sat Nov 24, 2007 11:10 pm
  • Location: Jakarta, Indonesia

[Help] TS Race Result Processor

PostSat Nov 11, 2017 3:28 am

Hi all! Actually I'm trying to make a web-based application that can read a race log and convert it to a "race result" thingy on web via php page a la the one used in the F1 World Championship (and to some extent GPOR.it's result uploader, which has been dead a long time ago) to kill my time but I couldn't figure it out how. Tried to figure out how to "explode" texts to bits and pieces but had no luck...

I'm starting out with my own race log to test the tool. The following is the particular section I'd like to explode the contents from, based on player names, car types, etc. Expected output would be the web app showing race position, player's name, the particular player's car, and the player's amount of laps finished and total time, as well as personal fastest lap.

Code: Select all
RaceStats, 33 laps, 20 players, first finished
Ryan McKane pos 2 (time: 23:49.311, 33 laps), best lap: 5 (42.350) Creation CA06/H 32bb46dd
Lap times: 45.553c 43.364 43.038c 42.539c 42.350 43.059 42.476 42.870 42.860 42.818 43.014 43.334c 42.988c 43.569c 42.696 42.874 43.660c 43.551c 44.306c 42.825c 45.538c 43.152c 43.032c 42.822c 42.599c 42.828c 44.680c 42.452c 43.354c 43.226 43.807c 43.889c 44.188
Cookie Lyon pos 7 (time: 23:57.265, 32 laps), best lap: 4 (44.171) Lola B05/40 818
Lap times: 48.805c 44.407 44.996c 44.171 44.402 44.694c 44.443c 45.710c 44.401c 44.487c 44.490 47.047c 44.708c 44.456 44.433 44.297 44.596 44.394 44.295 44.870 44.710c 44.909c 44.390 44.751 44.661 44.241 46.242c 45.379c 45.125c 45.365c 44.926c 44.464
Margo Spiegelman pos 4 (time: 23:52.043, 33 laps), best lap: 12 (42.491) Audi R10 TDI 7fb
Lap times: 46.478c 42.676 42.885c 42.957c 43.360 42.530 42.956 42.681 43.038 42.677 43.305 42.491 43.175c 43.271c 43.515c 42.764 43.233 43.289c 43.454c 43.524c 44.744c 43.265c 42.860c 43.035c 43.149c 42.644c 42.927c 44.447c 43.868c 43.954c 43.567c 45.825c 43.499c
Klaus Mikaelson pos 1 (time: 23:35.047, 33 laps), best lap: 30 (42.247) Audi R10 TDI 7ed
Lap times: 44.526c 43.131 42.907 42.917 42.468 42.372 42.587 42.421 42.773 42.333 42.579 43.627c 42.985c 43.210c 43.003 43.006c 42.516c 43.169c 42.400 42.261 42.746c 42.958c 42.814c 42.334c 43.134c 43.150c 43.699c 43.747c 42.603 42.247 42.820 42.905c 42.699c
So Ra Choi pos 10 (time: 24:11.631, 32 laps), best lap: 25 (44.882) Aston Martin DBR9 GT1 84c
Lap times: 50.301c 45.600c 46.213c 45.099 44.992 44.946 44.903 45.002 45.045 44.962 45.104 45.155 44.973 44.982 44.944 45.149 45.531c 45.141 45.462 45.892c 45.249 45.212c 45.590c 45.279 44.882 44.960 45.217 45.268 44.980 45.118 45.216 45.264
Carrie Mathison pos 5 (time: 23:49.891, 32 laps), best lap: 18 (44.130) Lola B05/40 81c
Lap times: 49.241c 44.255 45.119c 44.141 44.444 44.460c 44.470c 45.218c 44.938c 44.795c 44.405 44.929c 44.402 44.296 44.342 44.390 44.188 44.130 44.473 44.294 44.518 44.133 44.366c 44.719c 44.312c 45.699c 44.557c 44.477 44.655c 44.471c 44.717c 44.337
Nick Burkhardt pos 11 (time: 24:18.832, 32 laps), best lap: 6 (44.945) Aston Martin DBR9 GT1 811
Lap times: 51.018c 46.478c 45.633c 45.557c 45.479c 44.945 44.964 45.007 45.102 45.022 45.429 45.152 45.327 45.363 45.234c 46.016c 45.790c 45.397 45.182 45.909c 45.455c 45.455c 45.189 45.332 45.528 45.679c 45.380 45.041 45.084 45.971 45.505 45.209
Claire Fraser pos 20 (time: 24:03.626, 31 laps), best lap: 30 (45.782) Porsche 911 GT3 RSR (996) 800
Lap times: 52.557c 46.424c 45.783c 46.125c 46.376c 46.339c 46.452c 46.560c 46.566c 45.890 46.331c 46.715c 47.769c 46.684c 46.279c 46.896c 46.121c 45.807 45.956 45.973 45.926 45.914 46.834c 45.957c 47.035c 48.127c 46.959c 45.801 45.819 45.782 45.869
Bay Kennish pos 3 (time: 23:51.319, 33 laps), best lap: 28 (42.620) Audi R10 TDI 7f4
Lap times: 47.383c 42.853 42.800 42.961 42.843 42.958 42.746 43.074 42.872 42.991 42.977 43.344 43.743c 46.111c 43.373c 44.268c 43.050c 43.608c 43.233 43.017c 42.998c 43.464 43.271c 42.885c 42.967 42.894 43.097 42.620 43.387c 43.145c 42.846 44.299c 43.241c
Joan Watson pos 19 (time: 24:02.190, 31 laps), best lap: 28 (45.767) Porsche 911 GT3 RSR (996) 81a
Lap times: 51.592c 48.268c 46.303c 46.571c 46.504c 45.949 46.864c 46.533c 45.925c 45.807 46.400c 46.149c 46.411c 46.925c 45.986c 45.940 46.291c 45.819 45.850 45.942 46.027 45.781 45.833 46.233c 49.171c 46.801c 46.514c 45.767 46.281c 45.891 45.862
Damon Salvatore pos 15 (time: 23:53.165, 31 laps), best lap: 23 (45.775c) Porsche 911 GT3 RSR (996) 7ec
Lap times: 52.103c 46.445c 45.947c 46.039c 45.802 45.949 45.806 45.909 45.822 45.911 45.962 45.958c 46.569c 46.061c 45.865 46.277c 45.800 46.308c 45.895c 45.907c 46.907c 45.862c 45.775c 45.813 45.839 46.684c 45.876 45.999 46.036c 45.888 46.151c
Ryan Booth pos 6 (time: 23:54.045, 32 laps), best lap: 23 (44.187) Lola B05/40 816
Lap times: 47.871c 44.482 44.476 44.456 44.349 44.543 44.508 44.562 44.558 44.369 44.712 44.403 44.420 44.422 44.422 44.690 44.602 44.583 44.329 44.673 44.493 44.586 44.187 44.647c 44.876c 46.596c 44.842c 44.570 44.645c 45.315c 46.976c 44.882c
Katie Moore pos 12 (time: 24:20.144, 32 laps), best lap: 6 (44.902) Aston Martin DBR9 GT1 845
Lap times: 49.703c 46.868c 46.372c 44.923 45.119 44.902 45.336 45.001 45.232 45.425 45.125 45.251 45.157 45.664 45.774c 45.539c 44.988 46.015c 45.566 46.205c 45.105c 45.943c 46.022 45.130 45.176 45.619c 46.094 46.036 45.129 45.059 45.468c 45.198c
Mindy Lahiri pos 8 (time: 23:58.009, 32 laps), best lap: 15 (44.302) Lola B05/40 7d5
Lap times: 49.745c 46.606c 45.364c 44.521 44.803 44.559 44.590 45.013 44.541 44.509 44.639 44.459 45.060 44.530 44.302 44.415 44.566 44.533 44.530 44.561 44.500c 44.862c 44.500c 44.462 44.620 44.654c 45.525c 44.567 45.138c 45.498c 45.297c 44.540
Peggy Carter pos 18 (time: 24:00.542, 31 laps), best lap: 19 (45.697) Porsche 911 GT3 RSR (996) 802
Lap times: 52.646c 47.044c 46.192c 46.928c 45.992c 45.929 47.531c 46.741c 45.813c 45.938 46.744c 46.573c 45.971 46.336c 46.059c 46.104c 46.928c 45.786 45.697 45.951 45.898 45.723 46.022 46.332c 46.197c 46.008 46.018c 46.464c 45.769 47.414c 45.794
Steve Hale pos 16 (time: 23:54.702, 31 laps), best lap: 11 (45.228c) Aston Martin DBR9 GT1 7e6
Lap times: 50.793c 48.672c 46.016c 47.046c 45.330c 45.814c 47.587c 45.640 46.043c 45.349 45.228c 45.709c 46.943c 45.510 46.321c 45.283 45.239 45.762c 46.291c 45.841c 47.342c 45.417c 46.852c 46.167c 46.493c 46.217c 45.332 46.333c 45.342c 46.530c 46.260c
Jessica Huang pos 13 (time: 23:38.171, 31 laps), best lap: 12 (45.087) Aston Martin DBR9 GT1 7d7
Lap times: 51.187c 46.078c 46.085c 45.495c 45.928c 45.237 45.271 45.261 45.556 45.555 45.145 45.087 45.552 45.652 45.740c 46.952c 45.426 45.493 45.704c 45.736 45.486 45.325 45.841 45.669 45.132 45.299 45.243 45.387 45.651 45.551c 45.447
F Underwood pos 14 (time: 23:40.415, 31 laps), best lap: 26 (44.991) Aston Martin DBR9 GT1 820
Lap times: 52.748c 46.539c 45.564c 47.086c 46.043c 45.801c 46.902c 45.445c 45.466 45.435c 45.332 45.569c 45.820c 45.631c 45.745 45.052 45.887c 45.461 45.293 45.095 45.503 45.182 45.064 45.496 45.275 44.991 45.288 45.016 45.050 46.439c 45.197
Dee Reynolds pos 17 (time: 23:55.506, 31 laps), best lap: 12 (45.749c) Porsche 911 GT3 RSR (996) 7dd
Lap times: 51.848c 46.515c 45.926c 46.413c 46.102c 46.449c 45.882 45.929 45.971 46.398c 45.945c 45.749c 47.574c 45.994 46.330c 45.942 45.769 45.907 45.906 46.012 45.785 45.948 45.940c 45.793c 45.857c 46.379c 45.860 46.628c 46.515c 46.466c 45.774
Rae Earl pos 9 (time: 23:58.733, 32 laps), best lap: 8 (44.429) Lola B05/40 7e8
Lap times: 50.676c 45.495c 44.740c 44.441 44.877 44.607 44.445 44.429 44.604 44.457 44.536 44.953c 44.770c 44.751 44.632 44.742 44.654 44.521 44.442 44.483 44.801c 45.413c 44.676c 44.591 44.512 45.665c 44.982 45.789c 44.595 44.920c 44.923c 44.611
Best lap was made by Klaus Mikaelson


Thank you in advance!
Image
Offline
User avatar

Tijny

Community User Level: 5

Community User Level: 5

  • Posts: 1471
  • Joined: Sat Nov 06, 2004 2:59 pm
  • Location: Netherlands

Re: [Help] TS Race Result Processor

PostSat Nov 11, 2017 4:59 am

Some regex hocus pocus will do the job: https://ideone.com/VWW7mx
Offline

Rendy Andrian

Community User Level: 2

Community User Level: 2

  • Posts: 226
  • Joined: Sat Nov 24, 2007 11:10 pm
  • Location: Jakarta, Indonesia

Re: [Help] TS Race Result Processor

PostSat Nov 11, 2017 7:00 am

Tijny wrote:Some regex hocus pocus will do the job: https://ideone.com/VWW7mx

This should do the job! I'm gonna refine them from here. Thanks a lot!
Image

Return to Tools

Who is online

Users browsing this forum: No registered users and 0 guests

cron