Frame Buffer to MUSHii File Converter

Convert a frame buffer into a MUSHii (.mii) file.

Author: superJoe@8BitMUSH
Category: Other
Compatibility: TinyBit.

Instructions

Copy and paste the below code into a compatible MUSH or MUX.

MUSHCode for Frame Buffer to MUSHii File Converter

@create MUSHii
@set MUSHii=!NO_COMMAND
@lock MUSHii==me
@desc MUSHii=Instructions:%r1. Load a picture into a frame buffer%r2. Type '[ansi(g,mushii <target>/<buffer name>)]'%r3. Copy/paste the result, between the OUTPUT START and OUTPUT STOP, into a new .mii file%r4. Open in MUSHii
&CMD_MUSHII MUSHii=$mushii *:@select [fbexists(setr(0,switch(%0,*/*,%0,%#/%0)))]=0,{@pemit %#=No such frame buffer exists.},{@pemit %#=---------- OUTPUT START [edit(after(%q0,#),/,_)] ----------%rCreated with FrameBuffer 1.1%r[set(%!,vw:[extract(setr(s,fbstats(%q0)),2,1)])]%vw%r[set(%!,vh:[extract(%qs,3,1)])]%vh[set(%!,vd:[div(%vb,mul(15,%vw))])][set(%!,vl:0)]; @dolist lnum(ceil(fdiv(%vh,%vd)))={@pemit %#=u(fn_mushii_set,%q0,%vl,min(dec(%vh),add(%vl,%vd)),%vw)[set(%!,vl:[add(%vl,%vd,1)])]} ; @fo %!={@pemit %#=---------- OUTPUT STOP ----------}}
&FN_MUSHII_SET MUSHii=iter(lnum(%1,%2),iter(lnum(%3),extract(setr(c,fbstats(%0,itext(0),itext(1))),2,1)\,[extract(%qc,3,1)]\,[extract(%qc,1,1)]\,[if(extract(%qc,5,1),1,0)],,%r),,%r)