@program #2782 1 99999 d i ( Executes MUF inside of an MPI statement. (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 ! ( Attempt to set myself up ) #0 "/_msgmacs/meval" getprop not if #0 "/_msgmacs/meval" MPISTR setprop me @ "First time setup, MPI macro created." notify then ( dont even bother if I cant find at least an M1 someplace ) ( me @ mlevel 2 < trig mlevel 2 < and if "Permission denied." abort then ) ( Jam anything on the stack into the catalyst ) prog "_defs/meval" param @ setprop ( make a temporary program ) "mpi-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 ( Include me, I export meval ) "$include #" prog int intostr strcat ": main" "0 try" "meval" "catch" "#-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 ( decide what permissions it will get.. by default, run at my permissions.. BUT if the trigger object, which the MPI is running on, has higher permissions than the person running it, then the owner of the trigger object gets it to run at their level. This allows the owner to set a minimum permission level while not compromising it above their own level. ) program @ #4280 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 "{meval:" param @ "}: " errormsg @ strcat strcat strcat abort then ( Destroy the program ) program @ recycle ( Make sure the output is a string for MPI ) dup case string? when end int? when intostr end lock? when parselock end float? when ftostr end dbref? when int "#" swap intostr strcat end array? when "\r" array_join end default pop "" end endcase ; . c q