Free SoftCode!

A Handy Dandy Automobile

Copy and paste this into your client window to install it, but take note that &DRIVE will NOT display exits in your game properly unless you really strangely happen to sort exits the same way we do. Scroll toward the bottom and replace #11 (since this is just generally the storage room DB) to whatever your storage room DB is.

@create Car Parent = 10

@fail car =It's far too heavy.

@Idesc car = %tYou are in a [name(me)]. [u(me/car_desc)] %r%tThe doors are [if(eq(1,v(bool_locked)),locked,unlocked)] and the engine is [if(match(on,v(engine)),on,off)]. Type 'carhelp' for help.%r%r[rjust(%ch| [name(loc(me))] |%cn,79,%cr-)]%r[iter(lexits(loc(me)),name(##)%r)]

@Enter car= you open the door and climb inside.

@Oxenter car= opens the door of a [name(me)] and gets in.

@Leave car= you open the door and exit the [name(me)].

@Oxleave car= steps out of the [name(me)]

@lock/enter car = BOOL_LOCKED/0

@Lalias car= leave

@NameFormat car = [center(%ch[name(me)],79)]%r

&CREDITS car = Vilkas@The Rock Bottom -trbmux.wikidot.com
&LOCK car = $doors:@switch/first 1=match(loc(%#),num(me)),{&bool_locked me=[if(eq(1,v(bool_locked)),0,1)];@remit loc(%#)=%N hits the doorlocks from inside%, the car now [if(eq(1,v(bool_locked)),locked,unlocked)].;@remit loc(me)=[name(me)]'s doorlocks rustle with a mechanized click.},match(v(owned_by),num(%#)),{&bool_locked me=[if(eq(1,v(bool_locked)),0,1)];@remit loc(me)=[name(me)]'s doorlocks rustle with a mechanized click.;@pemit %#=Your car is [if(eq(1,v(bool_locked)),locked,unlocked)].}
&ENGINE car= on
&BOOL_LOCKED car = 0
&STARTENGINE car = $engine:@switch/first 1=and(match(%#,v(owned_by)),match(loc(%#),num(me))),{&engine me=[if(match(off,v(engine)),on,off)];@remit loc(%#)=The engine of a [name(me)] [if(match(off,v(engine)),quiets as the car comes to rest.,rumbles to life.)];@remit loc(me)=The engine of a [name(me)] [if(match(off,v(engine)),dies into a quiet,rumbles to life.)]}
DRIVE: $drive *:@switch/first 1=match(off,v(engine)),{@pemit %#=The engine is off. Type "engine" to turn on the engine.},match(local,u(%0/regorloc)),{@pemit %#=As righteous as that would be, the implications of insurance payments and arrest combat your whims into not driving through the wall of the establishment.},match(on,v(engine)),{go %0;@remit/contents me=%chDriving… [name(loc(me))]:%cn%r[u(loc(me)/desc)]%r%r%chExits%cn:%r%b[iter([iter(lexits(loc(me)),[if(match(region,u()])],%r,|)]%ch[ljust(On the Street,25)]%cn%r%b[iter([iter([lcon(loc(me),connect)] [lexits(loc(me))],[if(hasflag()])],%r,|)]},{@pemit %#=Huh?%b%b%(Type "help" for help.%)}
&CAR_DESC car = This is where the car's description goes.
&CARHELP car = $carhelp:@pemit %#=[center(%chCar Commands%cn,79)]%r%rdoors%t%tTo lock or unlock the doors (usable in and outside of the car).%rengine%t%tTyping this will start or stop the engine (if you own the car).%rdrive <exit>%tTo go somewhere.%rhorn%t%tTo honk the horn!%rcarpose <msg>%tPose for the car (like using : or ;)%rcaremit <msg>%tEmit for the car (like using \\).%rleave%t%tTo exit!%r%rIf you would like to request more functionality for the car objects, don't hesitate to post on the Requests and Feedback portion of bulletin boards![if(isstaff(%#),%r%r%chMAKING A CAR%cn Create a new object and parent it to the Car Parent, which you should probably find in your Storage room (there's no reason why this thing would go in the Master room in its current state). Then make it enter_ok (@set here=enter_ok). Store the submitted descriptions in the @desc for the exterior and give it the attribute "car_desc%," which is what the interior description reads from. Then make the attribute called "owned_by" and store in it the DB number of who you want to be able to start the car's engine. Lastly%, type @lock/enterlock <new car> =bool_locked/0. Then you're done.%r%rYou are seeing these instructions because this object believes you are staff. The 'Drive' attribute on this car object is designed with TRB's room parents in mind, so you will have to edit it accordingly. )]
&HORN car= $horn:@switch num(me)=loc(%#),{@remit loc(me)=[name(me)]'s horn %chHONKS!%cn;@pemit/list lcon(me)=%N honks the horn. %chHonk!%cn},{@pemit %#=Huh?%b%b%(Type "help" for help.%)}
&CARPOSE car = $carpose *:@pemit/contents loc(me)=A [name(me)][switch(mid(%0,0,1),:,%b[delete(%0,0,1)],;,[delete(%0,0,1)],%b%0)];@pemit %#=On the street, [name(me)][switch(mid(%0,0,1),:,%b[delete(%0,0,1)],;,[delete(%0,0,1)],%b%0)]
&CAREMIT car = $caremit *:@pemit/contents loc(me)=%0;@pemit %N=%0
@set car = sticky
@link car = #11
@set car = enter_ok
drop car