ID:114529
 
var{time=180;maxtime=180;}proc{convey(){spawn(){for(var/obj/block/B in world){B.y--}for(var/obj/reader/B in world){B.icon_state="impact"}for(var/obj/conveyor/B in world){B.icon_state="middleon"}for(var/obj/conveyor/top/B in world){B.icon_state="topon"}read();spawn(3){for(var/obj/conveyor/B in world){B.icon_state="middleoff"}for(var/obj/conveyor/top/B in world){B.icon_state="topoff"}for(var/obj/reader/B in world){B.icon_state="";}}}}}obj{conveyor{layer=-4;icon='conveyorbelt.dmi';icon_state="middleoff";top{icon_state="topoff"}}background{icon='background.dmi';layer=-5}Timegen{layer=11;New(){..();overlays.Add(icon('font.dmi',":"));gen()}proc{numbertotime(){var/number=time;var/minute=0;var/tensecond=0;var/second=0;while(number>=60){number-=60;minute++}while(number>=10){tensecond++;number-=10}while(number>=1){number--;second++}return"[minute][tensecond][second]"}gen(){for(var/obj/A in world){if(A.x==5||A.x==6){if(A.y==1){if(A.icon=='font.dmi'){del A}}}}var/obj/A=new(locate(5,1,1));var/obj/B=new(locate(6,1,1));A.x=5;A.y=1;B.x=6;B.y=1;A.icon='font.dmi';B.icon='font.dmi';icon='font.dmi';A.layer=11;B.layer=11;while(src){while(noplay){sleep(100);del src}time--;var/Q=numbertotime();icon_state="[copytext(Q,1,2)]";A.icon_state="[copytext(Q,2,3)]";B.icon_state="[copytext(Q,3,4)]";sleep(10)}}}}rail{icon='rail.dmi';layer=10}cannon{density=1;icon='cannon.dmi';icon_state="";pixel_step_size=16;layer=11;Click(){if(src.name=="r"){var/obj/laser/A=new(src.x,src.y,src.z);A.x=src.x-1;A.y=src.y;A.isr=1}if(src.name=="l"){var/obj/laser/A=new(src.x,src.y,src.z);A.x=src.x+1;A.y=src.y;A.isl=1}}r;l{New(){..();spawn(1){var/icon/I=icon(src.icon,src.icon_state);I.Flip(EAST);icon=I}}}}block{icon='block.dmi';animate_movement=0;icon_state="";layer=10;pixel_step_size=10}laser{icon='laser.dmi';icon_state="";layer=9;var{isl=0;isr=0}New(){..();spawn(0){if(x==1){del src}if(x==9){del src}}spawn(1){var/Q=0;if(isr){sleep(1);for(var/obj/block/B in get_step(src,WEST)){Q=1;src.icon_state="impact";var/icon/I=icon(src.icon,src.icon_state);I.Flip(EAST);src.icon=I;B.icon_state="impact";sleep(3);del B;sleep(1);del src}for(var/obj/rail/B in get_step(src,WEST)){Q=1;src.icon_state="impact";var/icon/I=icon(src.icon,src.icon_state);I.Flip(EAST);src.icon=I;B.icon_state="impact";B.density=1}if(!(Q)){var/obj/laser/A=new(src.x,src.y,src.z);A.x=src.x-1;A.y=src.y;A.isr=1;sleep(6);del src}}if(isl){sleep(1);for(var/obj/block/B in get_step(src,EAST)){Q=1;src.icon_state="impact";var/icon/I=icon(src.icon,src.icon_state);src.icon=I;B.icon_state="impact";sleep(3);del B;sleep(1);del src}if(!(Q)){var/obj/laser/A=new(src.x,src.y,src.z);A.x=src.x+1;A.y=src.y;A.isl=1;sleep(6);del src}}}}}reader{icon='reader.dmi';icon_state="";layer=12;}}mob{New(){..();spawn(1){spawn()login();spawn()reset();spawn(2){maxtime=60;time=60}spawn()Handlemusic()}}verb{cannonsdown(){set instant=1;if(!noplay){for(var/obj/cannon/A in world){if(A.y>5){step(A,SOUTH)}}}}cannonsup(){set instant=1;if(!noplay){for(var/obj/cannon/A in world){if(A.y<11){step(A,NORTH)}}}}firel(){set instant=1;if(!(locate(/obj/laser)in world))if(!noplay){var/obj/cannon/l/l;for(var/obj/cannon/l/ll in world){l=ll}var/obj/laser/A=new(l.x,l.y,l.z);A.x=l.x+1;A.y=l.y;shoot();A.isl=1}}firer(){set instant=1;if(!(locate(/obj/laser)in world))if(!noplay){var/obj/cannon/r/r;for(var/obj/cannon/r/rr in world){r=rr}var/obj/laser/A=new(r.x,r.y,r.z);A.x=r.x-1;A.y=r.y;shoot();A.isr=1}}turnblocks(){set instant=1;if(!noplay){for(var/obj/block/B in world){spin(B)}}}resetblocks(){set instant=1;resetblock();}}}var/noplay=0;design{var{oneone=0;onetwo=0;onethree=0;onefour=0;onefive=0;twoone=0;twotwo=0;twothree=0;twofour=0;twofive=0;threeone=0;threetwo=0;threethree=0;threefour=0;threefive=0;fourone=0;fourtwo=0;fourthree=0;fourfour=0;fourfive=0;fiveone=0;fivetwo=0;fivethree=0;fivefour=0;fivefive=0}Spaceship{oneone=1;onetwo=0;onethree=1;onefour=0;onefive=0;twoone=0;twotwo=1;twothree=0;twofour=0;twofive=0;threeone=0;threetwo=1;threethree=1;threefour=1;threefive=1;fourone=0;fourtwo=1;fourthree=0;fourfour=0;fourfive=0;fiveone=1;fivetwo=0;fivethree=1;fivefour=0;fivefive=0}X{oneone=1;onetwo=0;onethree=0;onefour=0;onefive=1;twoone=0;twotwo=1;twothree=0;twofour=1;twofive=0;threeone=0;threetwo=0;threethree=1;threefour=0;threefive=0;fourone=0;fourtwo=1;fourthree=0;fourfour=1;fourfive=0;fiveone=1;fivetwo=0;fivethree=0;fivefour=0;fivefive=1}U{oneone=0;onetwo=1;onethree=1;onefour=1;onefive=0;twoone=1;twotwo=0;twothree=0;twofour=0;twofive=1;threeone=1;threetwo=0;threethree=0;threefour=0;threefive=1;fourone=1;fourtwo=0;fourthree=0;fourfour=0;fourfive=1;fiveone=1;fivetwo=0;fivethree=0;fivefour=0;fivefive=1;}}proc{drawdesign(var/design/D){spawn(5){if(D.oneone){designloc.overlays.Add(icon('designing.dmi',"11"))}if(D.onetwo){designloc.overlays.Add(icon('designing.dmi',"12"))}if(D.onethree){designloc.overlays.Add(icon('designing.dmi',"13"))}if(D.onefour){designloc.overlays.Add(icon('designing.dmi',"14"))}if(D.onefive){designloc.overlays.Add(icon('designing.dmi',"15"))}if(D.twoone){designloc.overlays.Add(icon('designing.dmi',"21"))}if(D.twotwo){designloc.overlays.Add(icon('designing.dmi',"22"))}if(D.twothree){designloc.overlays.Add(icon('designing.dmi',"23"))}if(D.twofour){designloc.overlays.Add(icon('designing.dmi',"24"))}if(D.twofive){designloc.overlays.Add(icon('designing.dmi',"25"))}if(D.threeone){designloc.overlays.Add(icon('designing.dmi',"31"))}if(D.threetwo){designloc.overlays.Add(icon('designing.dmi',"32"))}if(D.threethree){designloc.overlays.Add(icon('designing.dmi',"33"))}if(D.threefour){designloc.overlays.Add(icon('designing.dmi',"34"))}if(D.threefive){designloc.overlays.Add(icon('designing.dmi',"35"))}if(D.fourone){designloc.overlays.Add(icon('designing.dmi',"41"))}if(D.fourtwo){designloc.overlays.Add(icon('designing.dmi',"42"))}if(D.fourthree){designloc.overlays.Add(icon('designing.dmi',"43"))}if(D.fourfour){designloc.overlays.Add(icon('designing.dmi',"44"))}if(D.fourfive){designloc.overlays.Add(icon('designing.dmi',"45"))}if(D.fiveone){designloc.overlays.Add(icon('designing.dmi',"51"))}if(D.fivetwo){designloc.overlays.Add(icon('designing.dmi',"52"))}if(D.fivethree){designloc.overlays.Add(icon('designing.dmi',"53"))}if(D.fivefour){designloc.overlays.Add(icon('designing.dmi',"54"))}if(D.fivefive){designloc.overlays.Add(icon('designing.dmi',"55"));}}}}var{obj{designloc=new/obj(locate(9,1,1));}}var/design/D;proc{gameovercheck(){while(world){sleep(1);if(time==-1){noplay=1;var/pass=1;var/list/locs[0];for(var/obj/block/B in world){locs.Add("[B.x],[B.y]")}if(!(D.oneone)){if("3,6"in locs){pass=0}}if(!(D.onetwo)){if("4,6"in locs){pass=0}}if(!(D.onethree)){if("5,6"in locs){pass=0}}if(!(D.onefour)){if("6,6"in locs){pass=0}}if(!(D.onefive)){if("7,6"in locs){pass=0}}if(!(D.twoone)){if("3,7"in locs){pass=0}}if(!(D.twotwo)){if("4,7"in locs){pass=0}}if(!(D.twothree)){if("5,7"in locs){pass=0}}if(!(D.twofour)){if("6,7"in locs){pass=0}}if(!(D.twofive)){if("7,7"in locs){pass=0}}if(!(D.threeone)){if("3,8"in locs){pass=0}}if(!(D.threetwo)){if("4,8"in locs){pass=0}}if(!(D.threethree)){if("5,8"in locs){pass=0}}if(!(D.threefour)){if("6,8"in locs){pass=0}}if(!(D.threefive)){if("7,8"in locs){pass=0}}if(!(D.fourone)){if("3,9"in locs){pass=0}}if(!(D.fourtwo)){if("4,9"in locs){pass=0}}if(!(D.fourthree)){if("5,9"in locs){pass=0}}if(!(D.fourfour)){if("6,9"in locs){pass=0}}if(!(D.fourfive)){if("7,9"in locs){pass=0}}if(!(D.fiveone)){if("3,10"in locs){pass=0}}if(!(D.fivetwo)){if("4,10"in locs){pass=0}}if(!(D.fivethree)){if("5,10"in locs){pass=0}}if(!(D.fivefour)){if("6,10"in locs){pass=0}}if(!(D.fivefive)){if("7,10"in locs){pass=0}}convey();sleep(10);convey();sleep(10);convey();sleep(10);convey();sleep(10);convey();sleep(10);convey();sleep(10);convey();sleep(10);convey();sleep(10);convey();sleep(10);convey();sleep(10);sleep(10);if(pass){spawn()readpositive();spawn()reset();return}else{readfail();sleep(10);world.Reboot();}}}}}proc{Handlemusic(){while(world){switch(rand(1,7)){if(1){world<<sound('Cuttin_Loose.ogg',0,0,5,300);sleep(1230)}if(2){world<<sound('Flap_Jack.ogg',0,0,5,300);sleep(890)}if(3){world<<sound('Both_Sides_Of_The_Tracks.ogg',0,0,5,300);sleep(890)}if(4){world<<sound('Corn_liquor.ogg',0,0,5,300);sleep(1230)}if(5){world<<sound('Dance_Party.ogg',0,0,5,300);sleep(760)}if(6){world<<sound('My_Dog_Blue.ogg',0,0,5,300);sleep(1270)}if(7){world<<sound('Everyone_In_Harmony.ogg',0,0,5,300);sleep(1260)}}sleep(60);}}}proc{reset(){spawn(5){new/obj/Timegen(locate(4,1,1))}maxtime=round(maxtime/6*5,1);time=maxtime;for(var/obj/block/B in world){del B}var/_x=2;var/_y=6;while(_y!=11&&_x!=8){_x++;if(_x==8){_x=3;_y++;if(_y==11){break}}var/obj/block/B=new(locate(_x,_y,1));B.x=_x;B.y=_y;B.z=1}noplay=0;designloc.overlays=null;var/design/F;restart:;F=text2path("[pick(typesof(/design))]");if(F==/design){goto restart}D=new F;spawn()drawdesign(D);spawn()gameovercheck()}resetblock(){for(var/obj/block/B in world){del B}var/_x=2;var/_y=6;while(_y!=11&&_x!=8){_x++;if(_x==8){_x=3;_y++;if(_y==11){break}}var/obj/block/B=new(locate(_x,_y,1));B.x=_x;B.y=_y;B.z=1;}}}proc{readfail(){world<<sound('read fail.wav',0,0,1,100)}readpositive(){world<<sound('read positive.wav',0,0,2,100)}read(){world<<sound('read.wav',0,0,3,100)}shoot(){world<<sound('shoot.wav',0,0,4,33.33)}login(){world<<sound('startup.wav',0,0,5,100);}}proc{spin(var/obj/block/A){if(A.x==3){if(A.y==10){A.x=7;A.y=10}else if(A.y==9){A.x=6;A.y=10}else if(A.y==8){A.x=5;A.y=10}else if(A.y==7){A.x=4;A.y=10}else if(A.y==6){A.x=3;A.y=10}}else if(A.y==10){if(A.x==4){A.x=7;A.y=9}else if(A.x==5){A.x=7;A.y=8}else if(A.x==6){A.x=7;A.y=7}else if(A.x==7){A.x=7;A.y=6}}else if(A.y==6){if(A.x==4){A.x=3;A.y=9}else if(A.x==5){A.x=3;A.y=8}else if(A.x==6){A.x=3;A.y=7}else if(A.x==7){A.x=3;A.y=6}}else if(A.x==7){if(A.y==9){A.y=6;A.x=6}else if(A.y==8){A.y=6;A.x=5}else if(A.y==7){A.y=6;A.x=4}}else if(A.y==7){if(A.x==4){A.x=4;A.y=9}else if(A.x==5){A.x=4;A.y=8}else if(A.x==6){A.x=4;A.y=7}}else if(A.x==4){if(A.y==8){A.x=5;A.y=9}else if(A.y==9){A.x=6;A.y=9}}else if(A.y==9){if(A.x==5){A.x=6;A.y=8}else if(A.x==6){A.x=6;A.y=7}}else if(A.x==6&&A.y==8){A.x=5;A.y=7}}}


Edit:I broke the [dm] tag. Sweet

Source code for a project I will be releasing soon.

Needs an artist, apply here-http://www.byond.com/developer/forum/?id=782813

DMSquish-http://www.byond.com/members/ Nickr5?command=view_post&post=111479
I don't see the purpose of that.
"Characters saved: 2268. 18%"

Me either
It's useful for contest that limit how big your dm files can be. http://www.byond.com/members/ LummoxJR?command=view_post&post=100695
& reducing download length.
But that's not even full code compression! look at the source code I had released for my 8k Cartridge Classic II entry: http://www.byond.com/developer/hubdownload/ D4RK354B3R.DarkeNyctoSource?user=D4RK354B3R&hash=a215f295214 f771664194bc571e9d338
Gigimoi wrote:
& reducing download length.

If you're worried about download length, you have some serious problems right there. Download time should never be a concern unless you have an absurdly large file.
We live in 2011, compressing code with a few kilobytes isn't necessary nowadays really. And I doubt that big game companies write all their codes on just one line to compress the size.
Compressing your DM code like that won't necessarily have an impact on the size of the .dmb file it compiles to. If people are downloading the code it'll make the download smaller, but rather useless.
Thanks for stating the obvious, Forum_Account.

The only real point of code compression is for contests, like the Cartridge Classic, where there is a limit on code file size for entries.
I don't know if it's fair to bash Forum_account's comment, D5. I'm sure quite a few people honestly believe that the whitespace makes a gigantic difference, and he's just assisting in clearing up the truth behind the matter.
I only did it for fun :P

I know it's nearly pointless.
Thing is, if you're smart, you'd keep a human-readable copy. Compression's sole purpose, so far, is for when a competition limits your code size.
Ai, I kept a readable copy.

I didn't keep a compressed copy.
http://www.byond.com/developer/ExPixel/CodeCompression

You need to go back in and fiddle with taking out some extra colons, and not use '//' when you put your code in (Just remove and re-add manually)