@program #7426 1 10000 d i ( Executes MUF from the command line (C) 2003 Alynna Trypnotk Release Terms: GNU GPL v2, http://www.gnu.org/licenses/gpl.html Use anywhere, dont remove credits, return improvements to alynna@animaltracks.net Installation: 1. Upload program 2. Give program LINK_OK bit, give to W4 wiz 3. Execute once. Error message is normal. Will say: "First time setup, MPI macro created." before error, indicating a successful install. Usage: {meval:} Escape all { } and , with \ Permissions req'd [W4]: 1. COMPILE 2. RECYCLE program given to WIZARD 3. NEWPROGRAM, and program editing prims Possible errors: 1. Permission denied. Trigger player or objet is not at least M1. 2. Error in MUF code. The MUF didnt compile ) $author Alynna $version 1.1 $note Executes MUF inside an MPI statement. lvar param $def MPISTR "{muf:#" prog int intostr ",{:1}}" strcat strcat : main var permissions var program var errormsg param ! ( dont even bother if I cant find at least an M1 someplace ) me @ mlevel 2 < trig mlevel 2 < and if "Permission denied." abort then ( make a temporary program ) "muf-temp.muf" newprogram dup program ! 1 { ( Import some functionality if its around, to use in evaluations ) $iflib $lib/alynna ( Do we have $lib/alynna? ) "$include $lib/alynna" $endif $iflib $lib/rp ( Do we have a protected RPsystem library? ) "$include $lib/rp" $endif $iflib $lib/tcpip ( Do we have a simulated internet? ) "$include $lib/tcpip" $endif $iflib $lib/pokedex ( Is this Pokemon X? ) "$include $lib/rps" "$include $lib/rps2" "$include $lib/pokedex" $endif $iflib $muf/rp/registry ( Is this SC ) "$include $lib/lifepath" $endif ( Include me, I export meval ) "$include #" prog int intostr strcat ": main" "0 try" command @ "@qmuf" smatch if "debug_on prog \"X\" set" then param @ command @ "@qmuf" smatch if "debug_off" then "depth not if \"OK\" then" "catch" command @ "@qmuf" smatch if "debug_off" then "#-14002838" "endcatch" "; PUBLIC main" } array_make program_insertlines pop ( For gods sake set this thing N! Something as simple as integer divide by zero can make the MUCK segfault during optimization! ) program @ "NO_COMMAND" set ( Chown to me so I dont run at higher than my permissions ) program @ me @ setown ( Compile the evaluator, it'll include me ) program @ 0 compile pop ( Call the evaluator ) 0 try program @ "main" call catch ( Catch compile error ) program @ recycle "Error compiling MUF code: " param @ strcat abort endcatch dup dbref? if dup #-14002838 dbcmp if pop errormsg ! then then errormsg @ if program @ recycle { command @ " (" param @ "): " errormsg @ }cat abort then ( Destroy the program ) program @ recycle ( Make sure the output is a string for MPI ) { "Result: " rot dup case string? when end int? when { "Integer: " rot intostr }cat end lock? when { "Lock: " rot parselock }cat end float? when { "Float: " rot ftostrc }cat end dbref? when { "DBRef: " rot int "#" swap intostr }cat end array? when { "Array(" rot dup array_count "): " rot "; " array_join }cat end default pop "" end endcase }cat me @ swap ansi_notify ; . c q