Author Topic: Maplist Randomizer =~-|- Version 1.1 -|-~=  (Read 5143 times)

0 Members and 2 Guests are viewing this topic.

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Maplist Randomizer =~-|- Version 1.1 -|-~=
« on: May 10, 2009, 02:22:21 pm »
Script Name: Maplist Randomizer
Script Description Randomizes your mapslist
Author: Hacktank
Compile Test: Passed
Core Version: 2.6.4
Hosted by: Soldat Central - http://soldatcentral.com/

Full Description:
Maplist Randomzier

Maplist Randomizer changes the order of your mapslist.txt when your server starts, every hour, and when you do /randomize.

Version 1.1



(Size 1.08 KB)
- http://soldatcentral.com/index.php?page=script&f=111 -


** Script hosted by Soldat Central! Please visit the author's script page and Rate this script **
« Last Edit: May 10, 2009, 05:31:08 pm by Hacktank »


Offline tk

  • Soldier
  • **
  • Posts: 235
Re: Maplist Randomizer
« Reply #1 on: May 10, 2009, 02:49:55 pm »
pkd: array of string;
//...
for i := 0 to getarraylength(pkd)-1 do pkd[ i] := 'false';
//...
if pkd[ i] = 'true' then
//...
if pkd[ i] = 'false' then begin
pkd[ i] := 'true';
//...

Have you ever heard about type "boolean"?
It can have two values: true and false. Using it is much faster than checking if two strings match.


(216000 * 1) 
Whats the point of this calculation? I think (216000 * 1) is equal to 216000 so why are you multiplying it?
« Last Edit: May 10, 2009, 02:56:38 pm by tk »

Offline JFK

  • Camper
  • ***
  • Posts: 255
    • My TraxInSpace Account
Re: Maplist Randomizer
« Reply #2 on: May 10, 2009, 02:51:54 pm »
Script seems very handy.

But I can't stand to see a random function coded like the way you did, sorry ;)..

If you have a large maplist your script might be doing a lot of unneeded loops, so:
Code: [Select]
Function Shuffle(input: array of string): array of string;
var
len, high : integer;
begin
   
  len := GetArrayLength(input);
  setArrayLength(result, len)
  high := len-1
 
  for i := 0 to len-1 do begin   
    rand := Random(0, high);
    result[i] := input[rand];
    input[rand] := input[high];
    dec(high, 1);
  end;
end;

Haven't tested it, but I hope you get the idea.
Come join: EliteCTF
Listen to: My Music

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Maplist Randomizer
« Reply #3 on: May 10, 2009, 05:27:47 pm »
Thank you JFK, I wasnt thinking straight last night when I made this.
TK, same response as JFK about the boolean, and the ticks thing, 216000 ticks is one hour, the *1 is there for customization.
Updated, version 1.1!
« Last Edit: May 10, 2009, 05:29:48 pm by Hacktank »


Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
Re: Maplist Randomizer =~-|- Version 1.1 -|-~=
« Reply #4 on: August 14, 2009, 01:38:44 pm »
its not working

worked the first time but not again. i think when it reaches the end of the randomized mapslist it goes back to original?
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Maplist Randomizer =~-|- Version 1.1 -|-~=
« Reply #5 on: August 16, 2009, 06:22:58 am »
If it doesnt work on startup do /randomize, ill check it out and see what the deal is later.


Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: Maplist Randomizer =~-|- Version 1.1 -|-~=
« Reply #6 on: August 17, 2009, 09:41:48 am »
216000 ticks is one hour, the *1 is there for customization.
you could make it a constant to make it more obvious ::)

Offline miketh2005

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 668
  • What's the URL for www.microsoft.com?
Re: Maplist Randomizer =~-|- Version 1.1 -|-~=
« Reply #7 on: August 17, 2009, 10:53:20 pm »
If it doesnt work on startup do /randomize, ill check it out and see what the deal is later.

Yes, but admins aren't in the server all the time, and I don't think that worked either.
Quote from: 'Ando.' pid='12999178' dateline='1309046898'
My new password is secure as shit :)
Mate, I am not sure Shit is even secured nowadays.

Offline jrronimo

  • Major(1)
  • Posts: 3
Re: Maplist Randomizer =~-|- Version 1.1 -|-~=
« Reply #8 on: December 07, 2011, 11:41:53 pm »
Does anyone have this script still? Or is there a better way to do a random map rotation than this?

Thanks.

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: Maplist Randomizer =~-|- Version 1.1 -|-~=
« Reply #9 on: December 08, 2011, 06:31:14 am »
there you go

Im chill like that

Offline machina

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1117
  • The world isn't nice. Why should I be...?
Re: Maplist Randomizer =~-|- Version 1.1 -|-~=
« Reply #10 on: December 08, 2011, 09:09:19 am »
I thought there was a mod like this one cause it's very simple thing to code... Eh, why do you keep with Pascal? It's so annoying cause you have to write these all "then", "begin", "end".... Bleee ;)

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: Maplist Randomizer =~-|- Version 1.1 -|-~=
« Reply #11 on: December 08, 2011, 09:41:45 am »
<machina> don't answear if you don't really have idea what's going on...
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 jrronimo

  • Major(1)
  • Posts: 3
Re: Maplist Randomizer =~-|- Version 1.1 -|-~=
« Reply #12 on: December 08, 2011, 10:45:18 am »

Offline machina

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1117
  • The world isn't nice. Why should I be...?
Re: Maplist Randomizer =~-|- Version 1.1 -|-~=
« Reply #13 on: December 08, 2011, 11:49:57 am »
<machina> don't answear if you don't really have idea what's going on...
Hey! Are you spying me!?  :o

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: Maplist Randomizer =~-|- Version 1.1 -|-~=
« Reply #14 on: February 26, 2012, 09:12:43 am »
looks like the script causes server crash everytime map switches

Im chill like that

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Maplist Randomizer =~-|- Version 1.1 -|-~=
« Reply #15 on: February 28, 2012, 12:18:13 am »
Must be the new changes to the scriptcore.

This is the latest version, dont know if it is the same as the one uploaded above.

Download newest version
« Last Edit: February 28, 2012, 12:53:28 am by Hacktank »