@Decompiler
Allows you to decompile the code of an object, as TinyTIM has no hardcoded @decompile command.
Commands:
@alias,
@create,
@describe,
@dig,
@dolist,
@emit,
@functions,
@if,
@open,
@set,
@switch,
@trigger,
@va,
@vb,
@vc,
@vd,
@ve,
@vf,
@vg,
@vm,
@vn,
@vo,
@vp,
@vw,
@vy,
@vz,
@wait,
@while,
@xa,
@xb,
@xc,
@xd.
Functions:
add(),
edit(),
eq(),
extract(),
flags(),
get(),
get2(),
instr(),
mid(),
name(),
not(),
num(),
or(),
owner(),
strlen(),
sub(),
v().
Features:
@wait done,
attribute aliases.
Compatibility:
TinyTIM.
Instructions
Copy and paste the below code into a compatible MUSH or MUX.
MUSHCode for @Decompiler
@create @decompiler
@desc @decompiler=This strange machine is covered in lenses and probes. It is a prototype @decompiler (Version 0.1 beta test). Type "DECOMPILE #db-num" or "DECOMPILE name" to decompile an object. (1) Make sure the object is xamine_ok, otherwise the decompiler won't see much! (2) It only works on objects you own. (3) Please report any bugs/suggestions to Martin.W (4) Enjoy!
@functions @decompiler=#69
@XA @decompiler=#34672
@XB @decompiler=Martin.W
@XD @decompiler=I
@VA @decompiler=@emit; @emit Decompiling %vm(%vn)...; @emit; @trigger me/vc; @wait DONE={@emit; @emit End of decompile.}
@VB @decompiler=$decompile *:@vn me=num(%0); @vm me=name(%0); @switch v(vn)={#-1},{@emit I can't see %0 here, or anywhere!},{@if OR(EQ(%#,owner(me)),EQ(owner(v(vn)), %#))={@trigger me/va},{@emit Sorry, you can only decompile things you own!}}
@VC @decompiler=@if ADD(1,INSTR(flags(%vn),R))={@emit @dig %vm},{@if ADD(1,INSTR(flags(%vn),E))={@emit @open %vm},{@emit @create %vm}}; @wait DONE={@emit {@desc %vm=\[get2(%vn,desc)\]}; @trigger me/vd; @wait DONE={@trigger me/ve; @wait DONE={@trigger me/vf=}}}
@VD @decompiler=@xc me=flags(%vn); @while not(eq(v(xc),))={@xd me=MID(v(xc),0,1); @xc me=MID(v(xc),1,sub(strlen(v(xc)),1)); @emit CAT({@set %vm=}, FNAME(v(xd))}
@VE @decompiler=@dolist v(vy)={@SWITCH get2(%vn,##)={NO MATCH},{},{},{},{@trigger me/vg={##}}
@VF @decompiler=@dolist v(vz)={@SWITCH get2(%vn,##)={NO MATCH},{},{},{},{@trigger me/vg={##}}
@VG @decompiler=@emit CAT({@%0 %vm=}, EDIT(get(%vn/%0),\%,\%\%\%\%,\\,\\\\\\\\,\[,\\\\\\\[))
@VM @decompiler=Generic Thing and Wizard Lock
@VN @decompiler=#10
@VO @decompiler=EXTRACT([v(0)] ABODE CHOWN_OK CONNECTED DARK DESTROY_OK ENTER_OK EXIT FLOATING GOING HALTED INDESTRUCTABLE INSOMNIAC KEY LIGHT LINK_OK MARKED NEARSIGHTED NO_EMIT OPAQUE OPEN PLAYER PUPPET QUIET ROOM SEE_SLEEPERS SILENT SLAVE STICKY TEMPLE TRANSPARENT WIZARD XAMINE_OK, ADD(2,INSTR(ACcDdeEFGHIzKlLMnNOoPpqRZQsSTtWX,v(0))),1)
@alias @decompiler/VO=FNAME
@VP @decompiler=#51362
@VW @decompiler=touch taste sound
@VY @decompiler=sex alias touch otouch atouch taste otaste ataste scent sound startup quit oquit aquit boot oboot aboot functions pay opay apay cost doer link home enter oenter aenter drop odrop adrop succ osucc asucc fail ofail afail kill okill akill contents hcontents wcontents hspeech use ouse ause charges runout aclone
@VZ @decompiler=va vb vc vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz listen ahear amhear aahear listen2 ahear2 amhear2 aahear2 listen3 ahear3 amhear3 aahear3 listen4 ahear4 amhear4 aahear4 listen5 ahear5 amhear5 aahear5
@desc @decompiler=This strange machine is covered in lenses and probes. It is a prototype @decompiler (Version 0.1 beta test). Type "DECOMPILE #db-num" or "DECOMPILE name" to decompile an object. (1) Make sure the object is xamine_ok, otherwise the decompiler won't see much! (2) It only works on objects you own. (3) Please report any bugs/suggestions to Martin.W (4) Enjoy!
@functions @decompiler=#69
@XA @decompiler=#34672
@XB @decompiler=Martin.W
@XD @decompiler=I
@VA @decompiler=@emit; @emit Decompiling %vm(%vn)...; @emit; @trigger me/vc; @wait DONE={@emit; @emit End of decompile.}
@VB @decompiler=$decompile *:@vn me=num(%0); @vm me=name(%0); @switch v(vn)={#-1},{@emit I can't see %0 here, or anywhere!},{@if OR(EQ(%#,owner(me)),EQ(owner(v(vn)), %#))={@trigger me/va},{@emit Sorry, you can only decompile things you own!}}
@VC @decompiler=@if ADD(1,INSTR(flags(%vn),R))={@emit @dig %vm},{@if ADD(1,INSTR(flags(%vn),E))={@emit @open %vm},{@emit @create %vm}}; @wait DONE={@emit {@desc %vm=\[get2(%vn,desc)\]}; @trigger me/vd; @wait DONE={@trigger me/ve; @wait DONE={@trigger me/vf=}}}
@VD @decompiler=@xc me=flags(%vn); @while not(eq(v(xc),))={@xd me=MID(v(xc),0,1); @xc me=MID(v(xc),1,sub(strlen(v(xc)),1)); @emit CAT({@set %vm=}, FNAME(v(xd))}
@VE @decompiler=@dolist v(vy)={@SWITCH get2(%vn,##)={NO MATCH},{},{},{},{@trigger me/vg={##}}
@VF @decompiler=@dolist v(vz)={@SWITCH get2(%vn,##)={NO MATCH},{},{},{},{@trigger me/vg={##}}
@VG @decompiler=@emit CAT({@%0 %vm=}, EDIT(get(%vn/%0),\%,\%\%\%\%,\\,\\\\\\\\,\[,\\\\\\\[))
@VM @decompiler=Generic Thing and Wizard Lock
@VN @decompiler=#10
@VO @decompiler=EXTRACT([v(0)] ABODE CHOWN_OK CONNECTED DARK DESTROY_OK ENTER_OK EXIT FLOATING GOING HALTED INDESTRUCTABLE INSOMNIAC KEY LIGHT LINK_OK MARKED NEARSIGHTED NO_EMIT OPAQUE OPEN PLAYER PUPPET QUIET ROOM SEE_SLEEPERS SILENT SLAVE STICKY TEMPLE TRANSPARENT WIZARD XAMINE_OK, ADD(2,INSTR(ACcDdeEFGHIzKlLMnNOoPpqRZQsSTtWX,v(0))),1)
@alias @decompiler/VO=FNAME
@VP @decompiler=#51362
@VW @decompiler=touch taste sound
@VY @decompiler=sex alias touch otouch atouch taste otaste ataste scent sound startup quit oquit aquit boot oboot aboot functions pay opay apay cost doer link home enter oenter aenter drop odrop adrop succ osucc asucc fail ofail afail kill okill akill contents hcontents wcontents hspeech use ouse ause charges runout aclone
@VZ @decompiler=va vb vc vd ve vf vg vh vi vj vk vl vm vn vo vp vq vr vs vt vu vv vw vx vy vz xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu xv xw xx xy xz listen ahear amhear aahear listen2 ahear2 amhear2 aahear2 listen3 ahear3 amhear3 aahear3 listen4 ahear4 amhear4 aahear4 listen5 ahear5 amhear5 aahear5