Author Topic: Script Combiner  (Read 5599 times)

0 Members and 1 Guest are viewing this topic.

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Script Combiner
« on: June 07, 2007, 08:47:26 pm »
I have created a website that helps in combining Soldat scripts.
All you have to do is paste in your current script and your new one and hit combine.

I recommend putting all your scripts into one file and using the template feature to begin with.

Things to know:
- All comments not in the begin section of a procedure will be removed
- Combiner will warn you about missing procedures and wrong number of begin/end statements
- Combined scripts will be formatted nicely with tabs

Also to script developers out there, this will remove "comments" inside of quotes.

I just finished this, so let me know of any bugs in it.
Also let me know what you think :D

http://scriptcombiner.awardspace.com/


For those of you releasing codes please follow these guidelines so those who use my script combiner can also use your code with it.

The full procedure/function line
The var statement if necessary, followed by the variables
The begin statement followed by the main code
The end; statement

For the built-in functions that have a return statement, only include a return statement if you are changing it's value in your script.

The only comments that will not get stripped out are single line comments using '//' in the begin section of a procedure
Lastly, comment type syntax cannot be used in strings. (myString := '//hello') Comments count as: //comment, (* comment *), and { comment }
« Last Edit: June 11, 2007, 11:37:23 am by mikembm »

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Script Combiner
« Reply #1 on: June 10, 2007, 04:46:22 pm »
Very nice man! Definitely deserves to be stickied (which it is).
This is going to be very useful for tons of people.

Is the template the one I made? I would check but I GTG.

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Script Combiner
« Reply #2 on: June 10, 2007, 05:04:06 pm »
No. It's just some boxes with CSS.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Script Combiner
« Reply #3 on: June 10, 2007, 08:40:34 pm »
No, I ment the scripting template... when you check off "Use Template."
I looked at it and it is mine. :D Sweet! Just without the spare enters nor indenting.

Date Posted: June 10, 2007, 06:08:36 PM
BUG!:

Quote
ERROR: Last procedure was never endedChecking new script... Script is good
Also, you should separate that text a little.

Current script:
Code: [Select]
procedure onadminconnect(ip: string);
begin
end;
procedure onadmindisconnect(ip: string);
begin
end;
procedure onadminmessage(ip, msg: string);
begin
end;
procedure activateserver();
begin
end;
procedure apponidle(ticks: integer);
begin
end;
function oncommand(id: byte; text: string): boolean;
begin
end;
function onplayercommand(id: byte; text: string): boolean;
begin
end;
procedure onexception(errormessage: string);
begin
end;
function onrequestgame(ip: string; state: integer): integer;
begin
end;
procedure onweaponchange(id, primarynum, secondarynum: byte);
begin
end;
procedure onjoingame(id, team: byte);
begin
end;
procedure onjointeam(id, team: byte);
begin
end;
procedure onleavegame(id, team: byte; kicked: boolean);
begin
end;
procedure onflaggrab(id, teamflag: byte; grabbedinbase: boolean);
begin
end;
procedure onflagreturn(id, teamflag: byte);
begin
end;
procedure onflagscore(id, teamflag: byte);
begin
end;
procedure onmapchange(newmap: string);
begin
end;
procedure onplayerkill(killer, victim: byte; weapon: string);
begin
end;
function onplayerdamage(victim, shooter: byte; damage: integer): integer;
begin
end;
procedure onplayerrespawn(id: byte);
begin
end;

procedure OnPlayerSpeak(ID: byte; Text: string);
begin
  if Text = 'noob' then begin
    Command('/say noob');
  end else begin
    Command('/say no noob');
  end;
end;

New script
Code: [Select]
procedure OnPlayerSpeak(ID: byte; Text: string);
begin
  Command('/say YOU NOOB Mr. ' + IDtoName(ID));
end;

doing "end else begin" seems to bug it :(

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Script Combiner
« Reply #4 on: June 10, 2007, 09:01:22 pm »
LOL. Thanks. It was the fact that you had the "end" on the same line as the "else begin" - But I fixed it, works now.

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Script Combiner
« Reply #5 on: June 10, 2007, 09:48:29 pm »
Why do you strip all the capitalization... thats retarded

And link doesn't work.

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Script Combiner
« Reply #6 on: June 10, 2007, 10:05:40 pm »
Why do you strip all the capitalization... thats retarded

And link doesn't work.

Ummmm.. it doesn't strip capitalization and the link works.. lol

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Script Combiner
« Reply #7 on: June 10, 2007, 10:22:10 pm »
Link does not work, cant resolve the URL.
And looking at the script posted above which was generated by your page, its all lowercase except the bit at the very end...

Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: Script Combiner
« Reply #8 on: June 10, 2007, 10:24:07 pm »
Link does not work, cant resolve the URL.
And looking at the script posted above which was generated by your page, its all lowercase except the bit at the very end...

URL works fine, must be a problem with your ISPs DNS cache.

Also, it does preserve case, unless someone combines scripts that did not have case present.

The only problem is combining scripts that return results; it causes all the results to be kept, so that you can end up with something like this:

Code: [Select]
function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
Result := Damage;
Result := 0;
end;

But not a big deal.
« Last Edit: June 10, 2007, 10:28:39 pm by chrisgbk »

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Script Combiner
« Reply #9 on: June 10, 2007, 10:33:13 pm »
Well any new script you add will be appended to the end of the procedure. So if you change the return value in your script then it will not affect anything.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Script Combiner
« Reply #10 on: June 11, 2007, 11:11:30 am »
I didn't have any caps except at the end because I just wanted to combine a quickly whipped up script and copied the error of missing events and pasted them, which have no caps... they should.

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Script Combiner
« Reply #11 on: August 13, 2007, 10:41:41 pm »
it says I'm forbidden to view the page O.o
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Script Combiner
« Reply #12 on: August 13, 2007, 10:42:22 pm »
it says I'm forbidden to view the page O.o

I took it down because it's no longer needed in this version

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Script Combiner
« Reply #13 on: August 13, 2007, 10:51:28 pm »
it isn't?


Date Posted: August 13, 2007, 11:50:05 PM
how do I make scripts work then?
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline mikembm

  • Soldier
  • **
  • Posts: 210
Re: Script Combiner
« Reply #14 on: August 13, 2007, 10:52:05 pm »
Nope. When you want to add a script just add a subfolder in the scripts folder and make a new .pas file with the script in it. Also make an Includes.txt in that same folder with the name of the .pas file. Most script releases also have an attachment which contains all the needed files ready to go.

Offline K_Sparkz

  • Major(1)
  • Posts: 13
Re: Script Combiner
« Reply #15 on: August 21, 2007, 10:36:32 am »
yea! but anyway, that require more power from the server, its way better to still combinde to save computer resourses!