Author Topic: [script request] Mapslist randomizer  (Read 762 times)

0 Members and 1 Guest are viewing this topic.

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
[script request] Mapslist randomizer
« on: May 18, 2012, 04:00:40 am »
Hey, I need a simple script which randomizes mapslist every time server is restarted. I tried using the one posted on forums but it crashes the server. Thx in advance

Im chill like that

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: [script request] Mapslist randomizer
« Reply #1 on: May 18, 2012, 04:19:01 am »
I have a bash script which you could add to cron table if you run linux and have shell access. I'll just paste it here, it's short enough.
Code: [Select]
#!/bin/sh
ls -1 $1/maps/ | grep PMS$ | sed s/\.PMS// | shuf > $1/mapslist.txt
if you save it under randomize.sh then you can run it using:
$ sh randomize.sh /path/to/your/server/
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: [script request] Mapslist randomizer
« Reply #2 on: May 18, 2012, 05:11:57 am »
Thanks for your effort but I need it in pascal i dont have ssh access

Im chill like that

Offline ExHunter

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 154
  • Speedy go!
Re: [script request] Mapslist randomizer
« Reply #3 on: May 18, 2012, 07:10:21 am »
I wrote one quickly for you. :)

ExHunter

Edit: Also I tested it and it works. ^^

Edit2: Brainstormed a bit, if there's an error, it will spam the server. Fixed that in the file "maprandomizer_fix1.rar".
« Last Edit: May 18, 2012, 07:56:00 am by ExHunter »

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: [script request] Mapslist randomizer
« Reply #4 on: May 18, 2012, 12:18:53 pm »
Thanks a lot exhunter!

Im chill like that