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

I don't think you understand how keybinds work.

Made a 949 byte terrain generator
« Last Edit: January 19, 2011, 08:56:50 AM by Resonance_Cascade »

I think Flaw/bauklotz version removed consideration for the fact that the keybind triggers the function on key press and release.

The function is passed a boolean, with true indicating a press. He checked that boolean.


Made a 949 byte terrain generator
Could you PM that to me? I really want it.

Made a 949 byte terrain generator
So you got that thing working then? I though it only generated terrain from actual .ter files?

Code: [Select]
function z(%a){if(%a)moveForward(!$mvForwardAction);}%c=$remapCount;$remapDivision[%c]="Move";$remapName[%c]="AutoMove";$remapCmd[%c]="z";$remapCount++;
Code: [Select]
function z(%a){if(%a)moveForward(!$mvForwardAction);}$remapDivision[%c=$remapCount]=Move;$remapName[%c]=AutoMove;$remapCmd[%c]=z;$remapCount++;

It appears to work when I put it in the console, anyway.
« Last Edit: January 19, 2011, 01:44:58 PM by Space Guy »

Code: [Select]
function z(%a){if(%a)moveForward(!$mvForwardAction);}$remapDivision[%c=$remapCount]=Move;$remapName[%c]=AutoMove;$remapCmd[%c]=z;$remapCount++;

It appears to work when I put it in the console, anyway.

Code: [Select]
function a(){moveForward($a++%4);}$remapDivision[%a=$remapCount]=Move;$remapName[%a]=Automove;$remapCmd[%a]=a;$remapCount++;

I don't think you understand how keybinds work.
Me?
I generally did, but I didn't know that
The function is passed a boolean, with true indicating a press. He checked that boolean.
And now I do.

Added in another block to my mining mod but had to come up with a compression system to make it all fit.

Here's an overview of all the features it has:
- Executing the script sets up the initial mine and places you in it.
   - The mine expands as you dig deeper into it (will last forever).
   - The spawn is in the mine for Self Deleters and others who join.
- Different block types / colors are present throughout the mine.
   - 90% chance of dirt, 8% chance of silver, 2% chance of gold.
- The default hammer tool is used to mine the bricks.
   - The block type you just mined is indicated in the chat for clarity.
   - The wrench is disabled, as well as using the plant brick button.
- A varying number of hits are required for different block types.
   - The remaining hits are indicated to the user mining the block.
   - Dirt takes 5, silver takes 25, and gold takes 50 hits.
- Typing /status will tell the user their block counts.
- Messages are easy to understand and are colored.

Quote
//6a&{`=Ètrandom(0,99>new fxdts7(aøÅ=%a;datablock=74xcubedata;is
|ed=1;isbaseplate=1;Ë=`<2?1:(`<10?5:8);a=`<2?50:(`<10?25:5);}.|(
>$a[%a]=1;}packaÈ a{6fxdts7Á{'Á;for(`=0;`<18;`+=3)if(!$a[%c=vect
oradd(%a.Å,Ètwords("#-#0 #-#0 #-2",`,`+2))])a(%c>}6hammerimaÈz{i
f(%d.aø%i=%d.a--É=`.clientÉ.centerprint("\c3"@%i@" hits left.",1
>if(!%iø'z;%h=%d.ËÉ.a[%h]++É^mined "@(%h==8?dirt:(%h==5?silver:g
old))@".">}}}6Èttrustlevel(øreturn 2;}6gameconneqÄ{'Ä;%a.~.settr
ansform("0 0 -3">}Â|7(ø}6wrenchimaÈ::onfire(ø}};activatepackaÈ(a
>Âstatus&{%a^have "À8*Êdirt+"À5*Êsilver+"À1*Êgold.">}missiongrou
p.Ètobject(5).delete(>a("0 0 0">ÃÃlocalclientconneq.~.kill(>

new fileobject(a).openforread($con::file);$a=a.readline();a.clos
e();while($b++<25)$a=strreplace($a,getsubstr(" øËÊÉÈÅÄÃÂÁÀ|`'>~&
^#76zq/",$b,1),getfield("){\tcolorid\t1@\" \t;%g\tge\tposition\t
::spawn~&\ta.kill7(>\t6servercmd\t::ondeath&\t@%a.a\tplant\t%b\t
parent\t);\tplayer\t(%a)\t.chatmessage(\"\\c3You \t2 0 0 \tbrick
\tfunq \t::onhitobject(%a,%b,%c,%d,%e,%f)\tction",$b-1));eval($a);

Make sure to delete the line breaks EXCEPT the one after the green.
(There should be 2 lines, and the file should be 1024 bytes with \r\n).

So you got that thing working then? I though it only generated terrain from actual .ter files?

It does - but I'm generating .ter files using TGE's inbuilt terraformer, hence being under 1000 bytes :cookieMonster:

seems like truce is recreating inf mining, in a smaller file :o

That doesnt look like torque, what the heck?  I have no idea what you are doing in that compression system of yours, with all the weird symbols.

That doesnt look like torque, what the heck?  I have no idea what you are doing in that compression system of yours, with all the weird symbols.
The symbols like ÈÃÂ are in quotes in the code he showed.
So it's probably a part of the compression, but I haven't looked real closely.
But symbols like ÈÃÂ can be in strings, but not variable names.

The symbols like ÈÃÂ are in quotes in the code he showed.
So it's probably a part of the compression, but I haven't looked real closely.
But symbols like ÈÃÂ can be in strings, but not variable names.
They are "place holders" for the actual code which is then put it by the decoder.(If I'm right)
So you can have different symbols, and have them decoded as different things.