$include $lib/rp $include $lib/alynna $def PARANOIA prog "?" flag? $def WAKERATE { "System" "Recovery" "Awake" }rpinfo atoi $def SLEEPRATE { "System" "Recovery" "Asleep" }rpinfo atoi $def RESRATE { "System" "Recovery" "Payday" }rpinfo atoi $def XPRATE { "System" "Recovery" "XP" }rpinfo atoi : ap-processor[ d:target -- ] ( Must not be in an OOC location ) target @ location name "[OOC" instr if exit then ( Must be IC ) target @ "~status" getpropstr "{ooc|afk|idl|bzy|dnd}" smatch if exit then ( Must be active ) target @ descrleastidle descridle 900 > if exit then ( 2 or more players must be active ) target @ location numactiveplayers 2 < if exit then ( OK they're getting some AP ) target @ "AP" over over getstat target @ apgen + setstat ( "$Avatar" match { "!wc #Test: " target @ " received " target @ apgen "AP." }cat force ) ( Find out if the target has limit breaked ) target @ "AP" getstat target @ aplimit >= if target @ "DP" over over getstat ++ setstat target @ "AP" over over getstat target @ aplimit - setstat target @ { "You just received 1DP for your " target @ aplimit "AP." }cat "Awesome" pretty ansi_notify then ( Check if some votes should expire ) target @ "/@rp/votes/" array_get_propvals foreach var! time var! item systime time @ 86400 7 * + > if target @ { "votes/" item @ }cat 0 setstat then repeat ; : recover[ d:target -- ] target @ "ta/Fast Healing" getstat if target @ growth 3 + 2 / else 1 then var! rate target @ { target @ physical target @ mphysical < if target @ "physical" over over getstat rate @ + 0 target @ mphysical limit setstat "^RED^Physical +" rate @ ", " then target @ mental target @ mmental < if target @ "mental" over over getstat rate @ + 0 target @ mmental limit setstat "^GREEN^Mental +" rate @ ", " then target @ spiritual target @ mspiritual < if target @ "spiritual" over over getstat rate @ + 0 target @ mspiritual limit setstat "^CYAN^Spiritual +" rate @ ", " then target @ social target @ msocial < if target @ "social" over over getstat rate @ + 0 target @ msocial limit setstat "^YELLOW^Social +" rate @ ", " then target @ "p/Spirit" getstat not if target @ health target @ mhealth < if target @ "health" target @ health rate @ + 0 target @ mhealth limit setstat "^YELLOW^Health +" rate @ ", " then target @ essence target @ messence < if target @ "essence" target @ essence rate @ + 0 target @ messence limit setstat "^PURPLE^Essence +" rate @ ", " then else target @ mana target @ mmana < if target @ "mana" target @ mana rate @ 2 * + 0 target @ mmana limit setstat "^WHITE^Mana +" rate @ ", " then then target @ "divine" getstat if target @ primal target @ mprimal < if target @ "primal" over over getstat { "System" "Recovery" "Primal" }rpinfo atoi + 0 target @ mprimal limit setstat "^BLUE^Primal +" { "System" "Recovery" "Primal" }rpinfo atoi ", " then then "^WHITE^Refresh cycle complete." }cat "Refresh" pretty ansi_notify ; : unicron var clock ( peopleclocks ) #-1 "*" "P" find_array foreach swap pop dup var! target me ! target @ "character_mode" getstat 256 = not if continue then target @ "clock/alive" over over getstat ++ dup clock ! setstat target @ awake? if ( Ops for awake people ) target @ "clock/awake" over over getstat dup clock ! ++ setstat ( Recover at WAKERATE ) clock @ WAKERATE % not if target @ recover then ( Generate AP ) target @ ap-processor else ( Ops for sleeping people ) ( Recover at SLEEPRATE ) target @ "clock/asleep" over over getstat dup clock ! ++ setstat clock @ SLEEPRATE % not if target @ recover then then repeat ; : main background PARANOIA if "$avatar" match { "!wc #Aria begin: unicron.mod: tempo " #1 { "{stimestr:" "cron_interval" sysparm "}" }cat "@Mufcron" 0 parsempi ", beat @ " "%x %X" systime timefmt " (Internet beat time: " systime_precise 86400.0 fmod 86400.0 / 1000.0 * 3 fchop ")" }cat force then systime_precise var! x unicron systime_precise x @ - x ! PARANOIA if "$avatar" match { "!wc #Aria end: unicron.mod: tempo " #1 { "{stimestr:" "cron_interval" sysparm "}" }cat "@Mufcron" 0 parsempi ", finished processing tapestry beat in " x @ 4 fchop " seconds." }cat force then ;