DM Class #10
22 verbs · 73 properties · 2 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
addp*rop | any any any | rwd | #10 | 70 |
create | any out of/from inside/from any | rwd | #10 | 32 |
#* | any any any | rwd | #10 | 50 |
dm | any any any | rwd | #10 | 15 |
che*ckpoint | none none none | rwd | #10 | 4 |
showlog | any none none | rwd | #10 | 12 |
shutdown | any none none | rwd | #10 | 28 |
taillog | any any any | rwd | #10 | 18 |
for*ked | any none none | rwd | #10 | 13 |
time | none none none | rwd | #10 | 2 |
allobj*ects | none none none | rwd | #10 | 13 |
msg_all | this none this | rwxd | #10 | 21 |
force_channel | this none this | rwxd | #10 | 31 |
home | any none none | rwd | #10 | 12 |
mkcore | none none none | rwd | #10 | 49 |
who_string | this none this | rwxd | #10 | 29 |
reset | any none none | rwd | #10 | 18 |
missing | none none none | rwd | #10 | 30 |
audit | any none none | rwd | #10 | 32 |
chown | any none none | rwd | #10 | 18 |
trunclog | any any any | rwd | #10 | 19 |
match | this none this | rwxd | #10 | 58 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
show_obj_nums | #10 | rw | #10 | 1 |
owned_objects | #8 | rw | #10 | list of 78{#3, #16, #18, #26, #27, #28, #29, #30, #31, #32, #33, #34, #35, #36, #37, #38, #39, #40, #41, #42, #43, #44, #45, #46, #47, #48, #49, #50, #51, #52, #53, #54, #55, #56, #58, #61, #64, #65, #66, #67, #68, #69, #70, #71, #73, #74, #76, #77, #78, #79, #80, #81, #82, #84, #85, #86, #87, #89, #90, #91, #0, #1, #2, #4, #5, #6, #7, #8, #9, #10, #11, #12, #13, #14, #15, #19, #20, #21} |
editing_prop | #8 | rw | #10 | <clear> |
editing_obj | #8 | rw | #10 | <clear> |
editing_loc | #8 | rw | #10 | <clear> |
insert_point | #8 | rw | #10 | <clear> |
prompt_on | #6 | rw | #10 | <clear> |
color | #3 | rw | #10 | <clear> |
base_hear | #3 | rw | #10 | <clear> |
base_see | #3 | rw | #10 | <clear> |
base_smell | #3 | rw | #10 | <clear> |
prompt_string | #3 | rw | #10 | <clear> |
base_hp | #3 | rw | #10 | <clear> |
cur_hp | #3 | rw | #10 | <clear> |
password | #3 | rw | #10 | <clear> |
messages | #3 | rw | #10 | <clear> |
base_feel | #3 | rw | #10 | <clear> |
base_taste | #3 | rw | #10 | <clear> |
known_languages | #3 | rw | #10 | <clear> |
current_language | #3 | rw | #10 | <clear> |
gender | #3 | rw | #10 | <clear> |
afk | #3 | rw | #10 | <clear> |
base_str | #3 | rw | #10 | <clear> |
base_int | #3 | rw | #10 | <clear> |
base_hea | #3 | rw | #10 | <clear> |
base_spd | #3 | rw | #10 | <clear> |
base_cnc | #3 | rw | #10 | <clear> |
held | #3 | rw | #10 | <clear> |
help_db | #3 | rw | #10 | #31 |
wielded | #3 | rw | #10 | <clear> |
worn | #3 | rw | #10 | <clear> |
species | #3 | rw | #10 | <clear> |
height | #3 | rw | #10 | <clear> |
current_channels | #3 | rw | #10 | {"admin", "design", "dm"} |
position | #3 | rw | #10 | <clear> |
consciousness | #3 | rw | #10 | <clear> |
base_ac | #3 | rw | #10 | <clear> |
skills | #3 | rw | #10 | <clear> |
base_dex | #3 | rw | #10 | <clear> |
base_con | #3 | rw | #10 | <clear> |
combat_stance | #3 | rw | #10 | <clear> |
known_players | #3 | rw | #10 | <clear> |
targets | #3 | rw | #10 | <clear> |
last_connected | #3 | rw | #10 | <clear> |
combat_init | #3 | rw | #10 | <clear> |
combat_weapon | #3 | rw | #10 | <clear> |
base_endurance | #3 | rw | #10 | <clear> |
cur_endurance | #3 | rw | #10 | <clear> |
base_focus | #3 | rw | #10 | <clear> |
cur_focus | #3 | rw | #10 | <clear> |
current_spell | #3 | rw | #10 | <clear> |
paths | #3 | rw | #10 | <clear> |
prompt_colors | #3 | rw | #10 | <clear> |
finished | #3 | rw | #10 | <clear> |
full_name | #3 | rw | #10 | <clear> |
total_points | #3 | rw | #10 | <clear> |
form_members | #3 | rw | #10 | <clear> |
leader | #3 | rw | #10 | <clear> |
start_location | #3 | rw | #10 | <clear> |
description | #1 | rw | #10 | <clear> |
aliases | #1 | rw | #10 | <clear> |
home | #1 | rw | #10 | <clear> |
short_desc | #1 | rw | #10 | <clear> |
core | #1 | rw | #10 | 1 |
handedness | #1 | rw | #10 | <clear> |
base_enc | #1 | rw | #10 | <clear> |
base_weight | #1 | rw | #10 | <clear> |
capacity | #1 | rw | #10 | <clear> |
max_fit | #1 | rw | #10 | <clear> |
pprep | #1 | rw | #10 | <clear> |
gprep | #1 | rw | #10 | <clear> |
generic_name | #1 | rw | #10 | <clear> |
age | #1 | rw | #10 | <clear> |
Ancestry
Ancestors (nearest first): #9 Coder Class → #8 Architect Class → #6 Player Class → #3 Animate Class → #11 Game Class → #1 Root Class
Children: #4 admintoo, #5 Admin
Call graph
Source
addp*rop
Referenced by
none
Source
1{?init_string, ?value_one = $nothing, ?value_two = $nothing} = args; 2person = player; 3target = property = ""; 4""; 5syntax = "SYNTAX: <object_name/object_number>.<new_prop_name> [[=] <value>]"; 6example1 = "For example: addprop #556.rank = 35"; 7example2 = "For example: addprop here.rank"; 8""; 9" The following :tell() is for formatting purposes only. "; 10person:tell(); 11if (!args) 12person:tell(syntax); 13person:tell(example1); 14" Add this back in once string matching has been coded. "; 15"person:tell(example2);"; 16return 0; 17else 18" Ok, going to call $utils:parse_prop_ref here... If the object "; 19" string it returns can't be changed to an OBJ, just return SYNTAX. "; 20" String matching has not been coded yet. "; 21if (!(obj_and_prop = $utils:parse_prop_ref(init_string))) 22person:tell(syntax); 23person:tell(example1); 24else 25target = obj_and_prop[1]; 26property = obj_and_prop[2]; 27if (target[1] != "#") 28" No string matching yet. "; 29person:tell(); 30person:tell("String matching has not been coded yet. Please use an object number."); 31person:tell(example1); 32return 0; 33else 34object = toobj(target); 35if (!valid(object)) 36" The object is not a valid object number. "; 37person:tell("That is not a valid object."); 38else 39" Make sure the property does not already exist. "; 40if (object:has_prop(property)) 41person:tell("That property already exists: ", object, ".", property, " = ", toliteral(object.(property))); 42return 0; 43else 44" All syntax checks ok. Determine if an initial value was given. "; 45" Actually, no. I'm tired of coding this function. Let them eat cake. "; 46if (value_one) 47person:tell("Default values not enabled yet. Sorry!"); 48person:tell(); 49endif 50value = 0; 51perms = "rw"; 52owner = $dm; 53" The following code is taken from LambdaMOO $programmer:@property with minor adjustments. "; 54try 55add_property(object, property, value, {owner, perms}); 56person:tell(tostr("Property added: ", object, "(", object.name, ").", property, " = ", toliteral(object.(property)))); 57except (E_INVARG) 58" Property exists on a descendant. "; 59person:tell("Property is already defined on one or more descendants."); 60person:tell("Someday in the technologically-advanced future there will be a utility to check for this."); 61except e (ANY) 62" Parse the error and return it. "; 63person:tell("The built-in function add_property returned the following error: "); 64person:tell(e[2]); 65endtry 66endif 67endif 68endif 69endif 70endif
create
Referenced by
none
Source
1"#10:create (str objName, from, str parent)"; 2"creates new object with name objName and parent parent."; 3"if iobj is not valid will match iobjstr to a valid object."; 4"will reference a form on the form object for that parent"; 5"and prompt the player to set default property values. if"; 6"no template is available, no questions are asked. objects"; 7"that wizards create will prompt for fertility; architects"; 8"(programmer/builders) will not be able to create fertile"; 9"objects. new classes can only be implemented by wizards."; 10if ((dobjstr == "") || (iobjstr == "")) 11player:tell("Not enough arguments."); 12player:tell("Syntax: create <newname> from <class>"); 13return 0; 14elseif (!valid(iobj)) 15player:tell("Class must be a valid object."); 16player:tell("Syntax: create <newname> from <class>"); 17return 0; 18elseif (iobj.f == 0) 19player:tell(("Class object '" + iobj.name) + "' is not fertile. Change its 'f' bit to 1 and try again."); 20return 0; 21endif 22new_object_num = iobj:_create(player); 23if (!valid(new_object_num)) 24player:tell("Object number returned from call to :create is invalid. Check your code. It is fucked up."); 25return 0; 26endif 27new_object_num.name = dobjstr; 28new_object_num.f = 0; 29new_object_num.r = 1; 30new_object_num.w = 1; 31player:tell(new_object_num:move_to(player)[2]); 32player:tell(((((((("You have just created object " + tostr(new_object_num)) + " named ") + new_object_num.name) + " as a child of ") + iobj.name) + "(") + tostr(iobj)) + ").");
#*
Referenced by
none
Source
1" #10:#*(STR) none none none "; 2""; 3" *: The object whose name you are looking for. "; 4" At this time it must be a number (no string matching). "; 5""; 6" Returns: STR "; 7" STR: The name of the OBJ. "; 8""; 9" Modifies: none "; 10" Owner: $dm "; 11" Perms: owner "; 12" Called by: DMs "; 13""; 14" Description: Temporary functionality because I'm tired of having "; 15" to type ;#4.name when all I really want to do is type "; 16" #4 and get the object's name. I may get rid of this "; 17" function later, replace it or give it more functionality. "; 18""; 19" NOTE: When string matching has been completed I will allow for such "; 20" matching within this function as well. "; 21""; 22" Example: #4 => \"Finder\" "; 23" Example: #me => \"Finder\" "; 24""; 25syntax = "SYNTAX: #<number of the object you are referencing>"; 26example1 = "For example: #4"; 27example2 = "For example: #me"; 28""; 29person = player; 30what = tostr(verb); 31" The following :tell() is for formatting purposes only. "; 32person:tell(); 33if (what == "#") 34person:tell(syntax); 35person:tell(example1); 36else 37" NOTE: I won't have to use this awkward if-statement once string matching "; 38" has been completed. "; 39""; 40if (!(what[2] in {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"})) 41person:tell("String matching has not been completed yet. Please use a number instead."); 42else 43what = toobj(what); 44try 45person:tell(toliteral(what.name)); 46except (E_INVIND) 47person:tell("That object does not exist."); 48endtry 49endif 50endif
dm
Referenced by
none
Source
1"$dm:dm any any any"; 2if (player in $dm:descendants()) 3if (!("dm" in player.current_channels)) 4player:tell("%WYour channel has been turned on.%w"); 5player.current_channels = setadd(player.current_channels, "dm"); 6endif 7for dm in ($channels.dm_channel) 8if ("dm" in dm.current_channels) 9dm:tell(); 10dm:tell((((($channels.dm_prefix + " ") + player.name) + ": ") + argstr) + "%w"); 11endif 12endfor 13else 14player:tell($bad_command); 15endif
che*ckpoint
Referenced by
none
Source
1"$dm:checkpoint none none none"; 2msg = player.name + ": checkpoint..."; 3$log:add_entry("system", "[INFO]", msg); 4dump_database();
showlog
Referenced by
none
Source
1"#10:showlog any any any"; 2{?logname = ""} = args; 3if (logname == "") 4player:tell("Specify a log to show:%W"); 5player:tell($log.logs); 6elseif (!(logname in $log.logs)) 7player:tell("No such log exists."); 8else 9for each in ($log.(logname)) 10player:tell("%W", ctime(each[1]), " ", $log.level_colors[is_member(each[2], $log.log_levels)], each[2], " %w", each[3]); 11endfor 12endif
shutdown
Referenced by
none
Source
1"$dm:shutdown any none none"; 2if (argstr == "") 3player:tell("Specify when to shut down."); 4elseif (argstr == "cancel") 5if ($shutdown_pid != 0) 6player:tell("System Shutdown cancelled."); 7kill_task($shutdown_pid); 8$shutdown_pid = 0; 9else 10player:tell("No shutdown task queued."); 11endif 12else 13when = args[1]; 14why = $utils:triml($utils:trimr(argstr[length(args[1]) + 1..length(argstr)])); 15if (tonum(when) == 0) 16player:tell("Specify a valid time to shutdown."); 17else 18if ($shutdown_pid != 0) 19kill_task($shutdown_pid); 20$shutdown_pid = 0; 21endif 22if ((when == "now") || (when == "0")) 23$shutdown(0, why); 24else 25$shutdown(tonum(when), why); 26endif 27endif 28endif
taillog
Referenced by
none
Source
1"#10:taillog any any any"; 2{?logname = "", ?numlines = 0} = args; 3numlines = tonum(numlines); 4numlines = numlines ? numlines | 25; 5if (logname == "") 6player:tell("Specify a log to tail:%W"); 7player:tell($log.logs); 8elseif (!(logname in $log.logs)) 9player:tell("No such log exists."); 10else 11loglength = length($log.(logname)); 12numlines = (numlines < loglength) ? numlines | loglength; 13start = (loglength - numlines) + 1; 14messages = {@$log.(logname)[start..$]}; 15for each in (messages) 16player:tell("%W", ctime(each[1]), " ", $log.level_colors[is_member(each[2], $log.log_levels)], each[2], " %w", each[3]); 17endfor 18endif
for*ked
Referenced by
none
Source
1"$dm:for*ked any none none"; 2qtasks = queued_tasks(); 3player:tell("%WTasks queued for execution:%w"); 4for task in (qtasks) 5taskid = task[1]; 6exectime = task[2]; 7owner = task[5]; 8verbloc = task[6]; 9verbname = task[7]; 10linenum = task[8]; 11thisobj = task[9]; 12player:tell("%W ", taskid, "%w with owner ", owner, " ", ctime(exectime), "%Y ", thisobj, ":", verbname, " at line ", linenum, ".%w Defined on ", verbloc, "."); 13endfor
time
Referenced by
none
Source
1"$dm:time none none none"; 2player:tell("%W", $utils:ftime(ctime()), "%w");
allobj*ects
Referenced by
none
Source
1"$dm:allobj*ects none none none"; 2for each in [1..tonum(max_object())] 3targ = toobj(each); 4if (valid(targ)) 5if (targ.core == 1) 6player:tell(((("%Y" + tostr(targ)) + " %w[ ") + targ.name) + " ]"); 7else 8player:tell((("%W" + tostr(targ)) + " %w") + targ.name); 9endif 10else 11player:tell(("%R" + tostr(targ)) + " < Invalid Object Number >%w"); 12endif 13endfor
msg_all
Referenced by
none
Source
1"$DM:msg_all this none this. Called by $animate:msg."; 2"Global messaging function only usable by Dungeon Masters."; 3"To be used SPARINGLY since the message is sent to ALL connected players."; 4message_raw = argstr; 5if (message_raw in {"all", "global"}) 6"no message was sent with the command"; 7player:tell("%BSend what message to all connected players?%w"); 8else 9if (message_raw[1] == "a") 10"message all"; 11message = message_raw[5..$]; 12else 13"message global"; 14message = message_raw[8..$]; 15endif 16players = connected_players(); 17for each in (players) 18each:tell(); 19each:tell("%W<< Global Message from ", player.name, " >> ", message, "%w"); 20endfor 21endif
force_channel
Referenced by
none
Source
1"$dm:force_channel this none this"; 2chan = args[1]; 3if (chan in {"admin", "design", "dm"}) 4full_list = $channels.(chan + "_channel"); 5listeners = {}; 6for x in (full_list) 7if (x in connected_players()) 8listeners = {@listeners, x}; 9x.current_channels = setadd(x.current_channels, chan); 10endif 11endfor 12others = setremove(listeners, player); 13names = {}; 14for y in (others) 15names = {@names, y.name}; 16endfor 17for z in (others) 18z:tell(""); 19z:tell((($channels.(chan + "_prefix") + " %R") + player.name) + " would like your attention.%w"); 20z:tell("%WYour channel has been turned on.%w"); 21endfor 22player:tell(""); 23player:tell($channels.(chan + "_prefix") + " %RYou now have the attention of everyone on this channel.%w"); 24if (names) 25player:tell(("%cListeners:%C " + $utils:list_to_string(names, ", ")) + "%w"); 26else 27player:tell("%cUnfortunately, you are the only one logged in who can listen to this channel...%w"); 28endif 29else 30player:tell("%WThere is no such channel.%w"); 31endif
home
Referenced by
none
Source
1"$dm:home any none none"; 2"send either yourself (default) or named object home"; 3{?targ = ""} = args; 4if (targ == "") 5if (valid(this.home)) 6this:move_to(this.home); 7else 8this:tell("%wYou do not have a valid %Whome%w set."); 9endif 10else 11this:tell("Cannot send items home just yet..."); 12endif
mkcore
Referenced by
none
Source
1"$dm:mkcore() none none none"; 2"deletes all non-core objects, resets passwords, logs"; 3if ($safety_lock == 1) 4player:tell("You cannot make this db a core!"); 5$log:add_entry("system", "[WARNING]", "Failed mkcore attempt by " + player.name); 6else 7player:tell("Do you want to convert this database into a core? WARNING: this will delete all items except core items!"); 8answer = read(player, 0); 9if (answer != "YES") 10player:tell("Ok, aborting."); 11$log:add_entry("system", "[WARNING]", "Aborted mkcore attempt by " + player.name); 12else 13player:tell("Enter your password for confirmation:"); 14typedpass = read(player, 0); 15auth = crypt(typedpass, player.password[1..2]) == player.password; 16if (auth == 0) 17player:tell("Wrong password. Aborting."); 18$log:add_entry("system", "[WARNING]", "Incorrect password on mkcore attempt by " + player.name); 19else 20"set $recycler.recycle_time_limit to 10"; 21current_recycle_time_limit = $recycler.recycle_time_limit; 22$recycler.recycle_time_limit = 10; 23"recycle all non-core objects"; 24for x in [0..tonum(max_object())] 25xobj = toobj(x); 26if (valid(xobj) && (xobj.core == 0)) 27if (is_player(xobj)) 28set_player_flag(xobj, 0); 29endif 30xobj:recycle(); 31endif 32endfor 33"rename ixion to admin"; 34#5.name = "Admin"; 35"set password to admin"; 36#5.password = crypt("admin"); 37"finders password change"; 38#4.password = crypt("admin"); 39"reset recycle_time_limit"; 40$recycler.recycle_time_limit = current_recycle_time_limit; 41"zero out logs"; 42for each in ($log.logs) 43$log.(each) = {}; 44endfor 45$safety_lock = 1; 46player:tell("corified."); 47endif 48endif 49endif
who_string
Referenced by
none
Source
1"$dm:who_string() this none this"; 2viewer = args[1]; 3gender = {"N", "B", "F", "M"}[this.gender in {"neither", "both", "female", "male"}]; 4"afk"; 5if (this.afk) 6afk = $who.afk + " "; 7else 8afk = " "; 9endif 10"editing"; 11if (this.location:is_a($editor)) 12edit = $who.editing + " "; 13else 14edit = " "; 15endif 16"idle"; 17idle = idle_seconds(this); 18if (idle > 3600) 19idle = $who.dormant + " "; 20elseif (idle > 1800) 21idle = $who.vegetating + " "; 22elseif (idle >= 600) 23idle = $who.idle + " "; 24else 25idle = " "; 26endif 27name_string = $utils:padr(this.name, 16, " "); 28who_string = (((((((("%Y[" + "%yDM ") + gender) + "%Y] ") + name_string) + afk) + edit) + idle) + $who.admin) + "%w"; 29return who_string;
reset
Referenced by
none
Source
1"$dm:reset any none none"; 2"resets shit so I don't have to manually change props during testing"; 3if (argstr == "here") 4player.location.combatants = {}; 5for each in (player.location.contents) 6if (each:is_a($animate)) 7each.targets = {}; 8each.position = "standing"; 9each.consciousness = "awake"; 10each.cur_hp = each:max_hp(); 11each:set_combat_stance("attack"); 12each.current_spell = 0; 13each.cur_endurance = each:max_endurance(); 14each.cur_focus = each:max_focus(); 15endif 16endfor 17player.location.combat_pid = 0; 18endif
missing
Referenced by
none
Source
1"$dm:missing() none none none"; 2"shows verbs with no associated help files"; 3"create list of verbs"; 4verblist = {}; 5verbnames = {}; 6allobjs = #1:descendants(); 7for each in (allobjs) 8verblist = {@verblist, @verbs(each)}; 9endfor 10"get rid of asterisks"; 11for each in (verblist) 12verbnames = {@verbnames, strsub(each, "*", "")}; 13endfor 14verbnames = $utils:sort(verbnames); 15"create list of help topics"; 16index = {}; 17topics = {}; 18helpobjs = #15:descendants(); 19for each in (helpobjs) 20index = {@index, @each.index}; 21endfor 22for each in (index) 23topics = {@topics, each[1]}; 24endfor 25"find verbnames that aren't in the topic list"; 26for each in (verbnames) 27if (!(each in topics)) 28player:tell(each); 29endif 30endfor
audit
Referenced by
none
Source
1"$dm:audit any none none"; 2"various options to get info on objects in database"; 3"audit owners - shows ownership of all objs, verbs, props that arent owned by #10"; 4arg1 = args[1]; 5maxobj = tonum(max_object()); 6if (arg1 == "owners") 7for x in [0..maxobj] 8xobj = toobj(x); 9if (!valid(xobj)) 10player:tell(("#" + tostr(x)) + " --> invalid object"); 11else 12obj_owner = xobj.owner; 13if (obj_owner != #10) 14player:tell((("#" + tostr(x)) + " --> ") + tostr(obj_owner)); 15endif 16props = properties(xobj); 17for prop in (props) 18prop_owner = property_info(xobj, prop)[1]; 19if (prop_owner != #10) 20player:tell(((((" " + tostr(xobj)) + ".") + prop) + " -> ") + tostr(prop_owner)); 21endif 22endfor 23verblist = verbs(xobj); 24for xverb in (verblist) 25verb_owner = verb_info(xobj, is_member(xverb, verbs(xobj)))[1]; 26if (verb_owner != #10) 27player:tell(((((" " + tostr(xobj)) + ":") + xverb) + " -> ") + tostr(verb_owner)); 28endif 29endfor 30endif 31endfor 32endif
chown
Referenced by
none
Source
1"$dm:chown any none none"; 2"change ownership of an object, prop, or verb, or do mass changes"; 3"chown allobjs -- mass change all objects to be owned by #10"; 4arg1 = args[1]; 5maxobj = tonum(max_object()); 6if (arg1 == "allobjs") 7for x in [0..maxobj] 8xobj = toobj(x); 9if (!valid(xobj)) 10player:tell(("#" + tostr(x)) + " --> invalid object"); 11else 12if (xobj.owner != #10) 13newowner = xobj:chown(#10); 14player:tell((("#" + tostr(x)) + " --> ") + tostr(newowner)); 15endif 16endif 17endfor 18endif
trunclog
Referenced by
none
Source
1"#10:trunclog any any any"; 2{?logname = "", ?lines = "0"} = args; 3if (logname == "") 4player:tell("Specify a log to truncate:%W"); 5player:tell($log.logs); 6elseif (!(logname in $log.logs)) 7player:tell("No such log exists."); 8else 9loglen = length($log.(logname)); 10if (lines == "0") 11$log.(logname) = {}; 12player:tell(((logname + " truncated to ") + tostr(lines)) + " lines."); 13elseif (loglen < tonum(lines)) 14player:tell(("Log is only " + tostr(loglen)) + " lines long."); 15else 16$log.(logname) = {@$log.(logname)[(loglen - tonum(lines)) + 1..$]}; 17player:tell(((logname + " truncated to ") + tostr(lines)) + " lines."); 18endif 19endif
match
Referenced by
none
Source
1"#10:match(str, objlist) - returns a list of objs from args[2] that"; 2"are known to this or aliased to args[1]. if no match, returns empty list."; 3"of no args[2], uses all objects. yes, scary. note special case with $objref"; 4"objnums are matched exactly. no need for partials with them."; 5"also note special cases: here, me, any others?"; 6{token, ?objlist = 0} = args; 7"here and me"; 8if (token == "here") 9return {this.location}; 10elseif (token == "me") 11return {this}; 12else 13"check for dollar sign ref"; 14if (token[1] == "$") 15dollar_obj = $utils:match_dollar_ref(token); 16"if dollar sign ref is valid"; 17if (dollar_obj != 0) 18"set token to the objnum (in string form) to do normal matching below."; 19token = tostr(dollar_obj); 20endif 21endif 22if (objlist == 0) 23objlist = {#1, @#1:descendants()}; 24endif 25count = 0; 26count_and_item = $utils:parse_dot_ref(token); 27if (count_and_item) 28{count, item} = count_and_item; 29endif 30if (count > 0) 31token = item; 32endif 33matchlist = {}; 34for each in (objlist) 35if (!(each in matchlist)) 36doesmatch = 0; 37names = {each:known_to(this)[2], @each.aliases, tostr(each)}; 38for name in (names) 39"exact match the objnums"; 40if (token[1] == "#") 41doesmatch = doesmatch || (token == name); 42else 43doesmatch = doesmatch || (index(name, token) == 1); 44endif 45endfor 46if (doesmatch) 47matchlist = {@matchlist, each}; 48endif 49endif 50endfor 51if (count == 0) 52return matchlist; 53elseif (count <= length(matchlist)) 54return {matchlist[count]}; 55else 56return {}; 57endif 58endif