Blockland Forums > Modification Help
1024 byte scripting contest
Kalphiter:
--- Quote from: mctwist on January 24, 2011, 01:17:11 AM ---Wait a minute. I sent in an another script, and he didn't accepted it. It was 1024 bytes.
--- End quote ---
--- Quote from: Truce on January 13, 2011, 09:01:05 PM ---to shorten it to under 1024 bytes
--- End quote ---
1024 bytes is too much :cookieMonster:
Bauklotz:
Partly uncompressed version of Truce's mining mod example:
--- Code: ---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();
--- End code ---
Truce:
--- Quote from: mctwist on January 24, 2011, 03:52:27 AM ---Also, the script file size still isn't updated on the first post... :cookieMonster:
--- End quote ---
I'll update it when I modify the first post later today.
--- Quote from: Kalphiter on January 24, 2011, 09:30:30 AM ---1024 bytes is too much :cookieMonster:
--- End quote ---
--- Quote from: Truce on January 13, 2011, 09:01:05 PM ---1024 bytes or less
--- End quote ---
reading comprehension pls
Truce:
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.
DrenDran:
Wait so space guy made a wand that kills bricks?
How's it different form the regular wand?