@program #60 1 10000 d i $include $lib/alynna $include $muf/cron $def AVATAR "$avatar" match $def }tell }cat "Alts" pretty tellme $def EXCLUDE prog "_exclude" getprop lvar param : alt.scan var target1 var target2 var time1 systime_precise time1 ! ( DEEP SCAN version - Run every 1min to 1 day, depending on preference.. ) ( may not even be needed, time will tell. At least run it on installation. ) ( This routine doesnt take very long (0.009sec on a 6000 object DB) so it ) ( Cant actually hurt to have it in. ) ( First scan - find all currently online and associate their IPs ) { #-1 descr_array foreach swap pop dup ok? not if pop then repeat }array foreach target1 ! pop { #-1 descr_array foreach swap pop dup ok? not if pop then repeat }array foreach target2 ! pop target1 @ descrdbref "G" flag? target2 @ descrdbref "G" flag? or not if target1 @ descrdbref #-1 dbcmp target2 @ descrdbref #-1 dbcmp or not if target1 @ descrdbref "@pc/not" target2 @ descrdbref reflist_find not if target1 @ descripnum target2 @ descripnum stringcmp not if target1 @ descripnum EXCLUDE smatch target2 @ descripnum EXCLUDE smatch or not if target1 @ descrdbref "@pc/aka" target2 @ descrdbref reflist_add then then then then then repeat repeat ( Second scan - Synchronize all players with all known alts not excepted ) #-1 "*" "P!G" find_array foreach target1 ! pop target1 @ "@pc/aka" array_get_reflist foreach target2 ! pop target1 @ ok? target2 @ ok? and if target1 @ "@pc/not" target2 @ reflist_find not if target1 @ "@pc/aka" array_get_reflist target2 @ "@pc/aka" array_get_reflist array_union { swap foreach swap pop dup player? not if pop then repeat }array dup target1 @ "@pc/aka" rot array_put_reflist target2 @ "@pc/aka" rot array_put_reflist then then repeat repeat ( Third scan - remove any exceptions found in the DB ) #-1 "*" "P" find_array "@pc/not" "*" array_filter_prop foreach target1 ! pop target1 @ "@pc/aka" array_get_reflist foreach target2 ! pop target1 @ "@pc/not" target2 @ reflist_find if target1 @ "@pc/aka" target2 @ reflist_del then repeat repeat ( Fourth scan - remove anyone exempt from alt tracking ) #-1 "*" "P" find_array foreach target1 ! pop #-1 "*" "P" find_array "@pc/notrk" "?*" array_filter_prop foreach target2 ! pop target1 @ "@pc/aka" target2 @ reflist_del repeat repeat prog "?" flag? if AVATAR { "wc #Alt scan complete, time to perform deep scan " systime_precise time1 @ - " seconds." }cat force else me @ player? if { "Alt scan complete, time to perform deep scan " systime_precise time1 @ - " seconds." }tell then then ; : alt.qscan ( Quick version that just checks a single player, on login usually. ) descr var! target1 var target2 target1 @ descrdbref player? target1 @ descrdbref "G" flag? not and if { #-1 descr_array foreach swap pop dup ok? not if pop then repeat }array foreach target2 ! pop target2 @ descrdbref "G" flag? not if target2 @ descrdbref #-1 dbcmp not if target1 @ descripnum target2 @ descripnum stringcmp not if target1 @ descrdbref ok? target2 @ descrdbref ok? and if ( Mini first ) target1 @ descrdbref "@pc/aka" target2 @ descrdbref reflist_add ( Mini second ) target1 @ descrdbref "@pc/aka" array_get_reflist target2 @ descrdbref "@pc/aka" array_get_reflist array_union { swap foreach swap pop dup player? not if pop then repeat }array dup target1 @ descrdbref "@pc/aka" rot array_put_reflist target2 @ descrdbref "@pc/aka" rot array_put_reflist then then then then repeat ( Mini third ) target1 @ descrdbref "@pc/aka" array_get_reflist foreach target2 ! pop target1 @ descrdbref "@pc/not" target2 @ reflist_find if target1 @ descrdbref "@pc/aka" target2 @ reflist_del then target2 @ "@pc/not" target1 @ descrdbref reflist_find if target2 @ "@pc/aka" target1 @ descrdbref reflist_del then repeat ( Mini fourth ) ( Fourth scan - remove anyone exempt from alt tracking ) target1 @ descrdbref "@pc/notrk" getprop if #-1 "*" "P" find_array foreach target2 ! pop target1 @ "@pc/aka" target2 @ reflist_del repeat then then ; : alt.view var target me @ mlevel 6 < if "me" param ! then param @ not if "me" param ! then param @ resolve target ! target @ int 0 < if { "Cannot find, or not specific." }tell exit then { "Alts for " target @ ": " { target @ "@pc/aka" array_get_reflist foreach swap pop unparseobj repeat }array ", " array_join }tell ; : w2only me @ mlevel 6 < if "^RED^Permission denied.^NORMAL^" tellme pid kill then ; : alt.help { "Alts manager 1.1 by Alynna" " " " @alt Lists your alts" me @ mlevel 6 >= if " @alt * Lists someone elses alts" " @alt/add = * Add Person2 to Person1's alt list" " @alt/del = * Remove Person2 from Person1's alt list" " @alt/not = * Set/Unset Person2 as an alt of Person1 permanently" " @altlist * Associate all people with their alts and list" " @altscan * Deepscan for alts immediately" " &@pc/notrk =yes W3 only, excludes person from tracking system" " " "* = W2 or higher only" "System scans each player for alts on login and checks the MUCK every 5 minutes." "Program matches IPs against an SMATCH pattern on this program in the exclude prop." "mudconnector.com should be there at the very least." then }array atellme ; : alt.add var target1 var target2 param @ not if { "Syntax @alt/add =" }tell exit then param @ "=" split target2 ! target1 ! target1 @ resolve target1 ! target2 @ resolve target2 ! target1 @ int 0 < target2 @ int 0 < or if { "Couldnt find one of the specified objects/players." }tell exit then target1 @ "@pc/aka" target2 @ reflist_add { "Altlist for " target1 @ ": " { target1 @ "@pc/aka" array_get_reflist foreach swap pop unparseobj repeat }array ", " array_join }tell ; : alt.del var target1 var target2 param @ not if { "Syntax @alt/add =" }tell exit then param @ "=" split target2 ! target1 ! target1 @ resolve target1 ! target2 @ resolve target2 ! target1 @ int 0 < target2 @ int 0 < or if { "Couldnt find one of the specified objects/players." }tell exit then target1 @ "@pc/aka" target2 @ reflist_del { "Altlist for " target1 @ ": " { target1 @ "@pc/aka" array_get_reflist foreach swap pop unparseobj repeat }array ", " array_join }tell ; : alt.not var target1 var target2 var targets var target param @ not if { "Syntax @alt/not =" }tell exit then param @ "=" instr if param @ "=" split target2 ! target1 ! target1 @ resolve target1 ! target2 @ resolve target2 ! target1 @ int 0 < target2 @ int 0 < or if { "Couldnt find one of the specified objects/players." }tell exit then target1 @ "@pc/not" target2 @ reflist_find if target1 @ "@pc/not" target2 @ reflist_del target2 @ "@pc/not" target1 @ reflist_del alt.scan { "AltNotlist for " target1 @ ": " { target1 @ "@pc/not" array_get_reflist foreach swap pop unparseobj repeat }array ", " array_join }tell { "AltNotlist for " target2 @ ": " { target2 @ "@pc/not" array_get_reflist foreach swap pop unparseobj repeat }array ", " array_join }tell else target1 @ "@pc/not" target2 @ reflist_add target2 @ "@pc/not" target1 @ reflist_add alt.scan { "AltNotlist for " target1 @ ": " { target1 @ "@pc/not" array_get_reflist foreach swap pop unparseobj repeat }array ", " array_join }tell { "AltNotlist for " target2 @ ": " { target2 @ "@pc/not" array_get_reflist foreach swap pop unparseobj repeat }array ", " array_join }tell then { "Altlist for " target1 @ ": " { target1 @ "@pc/aka" array_get_reflist foreach swap pop unparseobj repeat }array ", " array_join }tell { "Altlist for " target2 @ ": " { target2 @ "@pc/aka" array_get_reflist foreach swap pop unparseobj repeat }array ", " array_join }tell else param @ target1 ! target1 @ resolve target1 ! target1 @ int 0 < if { "Couldnt find one of the specified objects/players." }tell exit then alt.scan { "AltNotlist for " target1 @ ": " { target1 @ "@pc/not" array_get_reflist foreach swap pop unparseobj repeat }array ", " array_join }tell { "Altlist for " target1 @ ": " { target1 @ "@pc/aka" array_get_reflist foreach swap pop unparseobj repeat }array ", " array_join }tell then ; : alt.list var target var results { "Alt scan for " param @ not if "*" else param @ then }cat header tellme #-1 { param @ "*" }cat "P" find_array dup array_count results ! foreach target ! pop { target @ ": " { target @ "@pc/aka" array_get_reflist foreach swap pop unparseobj repeat }array ", " array_join }tell repeat { results @ " characters displayed." }cat footer tellme ; : main param ! param @ mufcron? if alt.scan exit then command @ tolower case "{@alt|@alts}" smatch when alt.view end "@alt #help" smatch when alt.help end "@alt/add" smatch when w2only alt.add end "@alt/del" smatch when w2only alt.del end "@alt/not" smatch when w2only alt.not end "@altlist" smatch when w2only alt.list end "@altscan" smatch when w2only alt.scan end default alt.qscan end endcase #0 "@connect/alts" getprop not if #0 "@connect/alts" prog setprop { "Installed in connectqueue on #0." }tell then #0 "@mufcron/5/alts" getprop not if #0 "@mufcron/5/alts" prog setprop { "Installed in mufcron on #0." }tell then ; . c q