Author Topic: 1024 byte scripting contest  (Read 18851 times)

Wait a minute. I sent in an another script, and he didn't accepted it. It was 1024 bytes.
to shorten it to under 1024 bytes
1024 bytes is too much :cookieMonster:

Partly uncompressed version of Truce's mining mod example:
Code: [Select]
function mining_createBrick(%a) {
   %b = getRandom(0, 99);
   new fxDTSBrick(a) {
      position = %a;
      datablock = brick4xCubeData;
      isPlanted = 1;
      isBaseplate = 1;
      colorID = %b<2?1:(%b<10?5:8);a=%b<2?50:(%b<10?25:5);
   }.plant();
   $mining_locTaken[%a] = 1;
}
package mining_package {
   function fxdtsbrick::ondeath(%a) {
      parent::ondeath(%a);
      for(%b=0;%b<18;%b+=3)
         if(!$a[%c=vectoradd(%a.position,getwords("2 0 0 -2 0 0 0 2 0 0 -2 0 0 0 2 0 0 -2",%b,%b+2))])
            mining_createBrick(%c);
   }
   function hammerimage::onHitObject(%this, %obj, %col, %d,%e,%f) {
      if(%d.a) {
         %i = %d.a--;
         %g = %b.client;
         %g.centerprint("\c3"@%i@" hits left.",1);
         if(!%i) {
            parent::onHitObject(%a,%b,%c,%d,%e,%f);
            %h = %d.colorID;
            %g.a[%h]++;
            %g.chatmessage("\c3You mined "@(%h==8?dirt:(%h==5?silver:gold))@".");
         }
      }
   }
   function getTrustLevel() {
      return 2;
   }
   function gameConnection::spawnPlayer(%a) {
      parent::spawnPlayer(%a);
      %a.player.setTransform("0 0 -3");
   }
   function serverCmdPlantBrick() {
   }
   function wrenchImage::onFire() {
   }
};
activatepackage(mining_package);
function serverCmdStatus(%a) {
   %a.chatmessage("\c3You have "@%a.a8*1@" dirt+"@%a.a5*1@" silver+"@%a.a1*1@" gold.");
}
missiongroup.getobject(5).delete();
mining_createBrick("0 0 0");
a.killBrick();
a.killBrick();
localclientconnection.player.kill();
« Last Edit: January 24, 2011, 09:36:57 AM by Bauklotz »

Also, the script file size still isn't updated on the first post... :cookieMonster:

I'll update it when I modify the first post later today.

1024 bytes is too much :cookieMonster:
1024 bytes or less

reading comprehension pls

Mkay, finally got the opinion of my last judge. Results are posted in the table in the first post.
Thanks for participating everyone, was fun. Hopefully stuff like this comes up again sometime.

Wait so space guy made a wand that kills bricks?
How's it different form the regular wand?

What no :c
I couldn't debug mine :(
Even though contest is over and it doesn't work i'll post for heck of it k
I fixed it up since last time but didn't test cause i'm lazy at the moment, but if anyone can, please spot my errors thanks
Code: [Select]
function b(%p,%t)
{
if(%t!=0)
{
%n="b"@%t;
new aiplayer(%n)
{
datablock=playerstandardarmor;
position=%p;
};
%x=getword(%p,0);
%y=getword(%p,1);
%z=getword(%p,2);
%p=%x@SPC@%y+3@SPC@%z;
%t--;
b(%p,%t);
}
}
function servercmdbbw(%c,%h,%w,%ps)
{
if(isObject(%c.player))
{
   if(%w!=0)
   {
   %pl=%c.player;
   if(%ps="")
   {
%ps=%pl.getposition();
   }
   if(%h=="" && %w=="")
   {
   $ay=%h;
   $az=%w;
   }
   %x=getword(%ps,0);
   %y=getword(%ps,1);
   %z=getword(%ps,2);
   %p=%x+4@%y SPC %z;
   b(%p,%h);
   %w--;
   %p=%x SPC @%y SPC %z+4;
   servercmdbbp(%c,%h,%w,%p);
   }
   %total=$az*$ay;
   echo("Cube Finished with "@%total@" bot(s).");
}
echo("omgnoob");
}
its under 1024 bytes yay
Makes (or should make) a wall of bots infront of you with  the given height (%h) and width (%w) of bots you want, just leave the position (%ps) var blank when typing the command.

Good win. Both ideas was great. And now we have a bunch of scripts we could use for our mods... :cookieMonster:

Even though, I look forward for the next competition. This have been very entertaining.

Wait so space guy made a wand that kills bricks?
How's it different form the regular wand?

fake kill wand, the bricks respawn later on

Wait so space guy made a wand that kills bricks?
How's it different form the regular wand?

It's basically a physics wand.

Hah, surprised mine won anythang. :cookieMonster:

Free examples for free! :cookieMonster:

My guess is 2 weeks before someone decides to package and release these.