Salesperson #134

Parent #116Owner #36Flags read, fertileSource RPG Core/rpgcore-patched.db

Aliases: Salesperson, seller

17 verbs · 113 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
take_hitthis none thisrxd#13417
tellthis none thisrxd#13443
listthis none thisrxd#13438
stockthis with/using anyrd#13412
unstockany out of/from inside/from thisrd#13412
sellany at/to thisrd#13429
askthis any anyrxd#13428
collect_cashthis none thisrxd#13411
sell_productthis none thisrxd#13456
find_productthis none thisrxd#13422
index_matchthis none thisrxd#13410
itemsthis none thisrxd#1347
_clean_invthis none thisrxd#13418
check_stocksthis none thisrxd#13415
@menunone none nonerd#1342
init_for_corethis none thisrxd#13420
buy orderany out of/from inside/from thisrxd#1347

Properties

PropertyDefinerFlagsOwnerValue
items#134r#2{}
oldstuff#134r#2{}
outrage_msg#134rc#36"This is an outrage!"
done_deal_msg#134rc#36"Wonderful doing business with you!"
currency#134rc#36"Gold"
listname#134rc#36"catalog"
buyback_rate#134rc#3650
advertise_msg#134rc#36"Sure, I buy and sell. I can show you a catalog, if you ask for it."
trustees#134rc#36{#2}
help_msg#134rc#36
list of 9{"The bot responds to:", "ask <bot> for ---", "buy --- from <bot>", "sell --- to <bot>", "", "The bot also reponds to some spoken cues, like \"sell\", \"buy\", \"for sale\", \"list\", \"prices\", \"money\", \"cash\" when posed as a question.", "Ammunition can be bought in bulk quantities, but other items must be purchased individually. In order to make a profit, the bot will not buy back 'used' ammo, and will always try to sell what he has in stock first, rather than replicating from a generic.", "", "The trustees can \"ask <bot> for money\" and recieve all money on the bot, excluding taxes and overhead."}
my_tell#116rw#36<clear>
watchers#116r#36<clear>
terrain_only#116rc#36<clear>
enemy#116r#36<clear>
hostility#116rc#36<clear>
gestate#116rc#36<clear>
birth_msg#116rc#36<clear>
wander_task#116r#36<clear>
wait_seconds#116rc#36<clear>
controller#116rc#36<clear>
death_msg#91rc#36<clear>
alive#91r#36<clear>
alert#91r#36<clear>
mobile#91r#36<clear>
wielded#91r#36<clear>
last_paged#91r#36<clear>
last_healed#91r#36<clear>
followed_by#91r#36<clear>
following#91r#36<clear>
free_points#91r#361.36249999999999
stats#91r#36<clear>
stats_current#91r#36<clear>
skills#91r#36<clear>
race#91r#36<clear>
org#91r#36<clear>
money#91r#36<clear>
follow_msg#91rc#36<clear>
stopfollow_msg#91rc#36<clear>
searching#91r#36<clear>
languages#91r#36{{#142}, {2.0}}
speaking#91r#36<clear>
remembered_names#91r#36{}
short_desc_msg#91r#36""
_mail_task#40rc#36<clear>
messages_going#40c#36<clear>
mail_lists#40rc#36<clear>
mail_notify#40r#2<clear>
mail_forward#40rc#36<clear>
mail_options#40rc#36{}
message_keep_date#40rc#36<clear>
messages_kept#40rc#36<clear>
current_message#40c#36{0, -1300000000}
messages#40c#36<clear>
ansi_options#95r#36<clear>
replace_codes#95r#36<clear>
features#6r#36<clear>
previous_connection#6#2<clear>
email_address#6#2<clear>
last_disconnect_time#6r#2<clear>
help#6rc#360
more_msg#6rc#36<clear>
linetask#6r#36<clear>
linesleft#6r#36<clear>
linebuffer#6#36<clear>
pagelen#6r#36<clear>
owned_objects#6r#2<clear>
linelen#6r#36<clear>
current_folder#6c#36<clear>
all_connect_places#6#2<clear>
last_connect_place#6#2<clear>
brief#6rc#36<clear>
lines#6c#36<clear>
page_absent_msg#6rc#36<clear>
pq#6rc#36<clear>
pqc#6rc#36<clear>
page_origin_msg#6rc#36<clear>
page_echo_msg#6rc#36<clear>
edit_options#6rc#36<clear>
last_connect_time#6r#2<clear>
ownership_quota#6#36<clear>
gender#6rc#36<clear>
prc#6rc#36<clear>
ppc#6rc#36<clear>
poc#6rc#36<clear>
psc#6rc#36<clear>
pr#6rc#36<clear>
pp#6rc#36<clear>
po#6rc#36<clear>
ps#6rc#36<clear>
home#6rc#36#62
password#6#2<clear>
gaglist#6rc#36<clear>
paranoid#6rc#36<clear>
display_options#6rc#36<clear>
verb_subs#6rc#36<clear>
first_connect_time#6r#2<clear>
size_quota#6#36<clear>
last_password_time#6#2<clear>
last_connect_attempt#6#2<clear>
page_count_start_time#6r#2<clear>
ping_task#6r#36<clear>
value_base#102r#2<clear>
damage_base#102r#2<clear>
x_loc#102r#36<clear>
y_loc#102r#36<clear>
ansi_title#102r#36<clear>
obvious#102r#36<clear>
build_help#102rc#36
list of 11{"PROPS TO SET:", "currency -- string, the type of money the bot will accept.", "listname -- string, a synonym for the bot's item list. \"List\" & \"prices\" are already synonyms.", "buyback_rate -- integer (50% = 50), the percentage of retail price which the bot will pay to repurchase items.", "..", "MESSAGES:", "@short_desc $sales_bot isn't set.", "@birth $sales_bot is \"%N %<unfades> from non-being.\"", "@outrage $sales_bot is \"This is an outrage!\"", "@done_deal $sales_bot is \"Wonderful doing business with you!\"", "@advertise $sales_bot is \"Sure, I buy and sell. I can show you a catalog, if you ask for it.\""}
key#1c#360
aliases#1r#2{"Salesperson", "seller"}
description#1rc#36<clear>
object_size#1r#36{25954, -1090650497}
html#1rc#36<clear>

Ancestry

Ancestors (nearest first): #116 generic puppet#91 generic gamer#40 Generic Mail Receiving Player#95 ANSI PC#6 generic player#102 subthing#1 Root Class

Children: #146 Mr. Fasco

Call graph

calls n134_0 #134:take_hit n116_0 #116:take_hit n134_0->n116_0 n116_9 #116:say n134_0->n116_9 n134_1 #134:tell n134_1->n116_9 n116_7 #116:tell n134_1->n116_7 n1_29 #1:contents n134_1->n1_29 n52_3 #52:has_callable_verb n134_1->n52_3 n116_3 #116:_force n134_1->n116_3 n103_1 #103:_from_to n134_1->n103_1 n91_47 #91:_has_amount n134_1->n91_47 n91_46 #91:_add_money n134_1->n91_46 n35_1 #35:say_action n134_1->n35_1 n91_26 #91:title n134_1->n91_26 n116_5 #116:random_free n134_1->n116_5 n134_2 #134:list n134_1->n134_2 n134_7 #134:collect_cash n134_1->n134_7 n134_2->n116_9 n134_2->n52_3 n134_2->n103_1 n134_2->n91_26 n134_11 #134:items n134_2->n134_11 n6_18 #6:tell n134_2->n6_18 n102_4 #102:title n134_2->n102_4 n20_50 #20:char_list n134_2->n20_50 n6_79 #6:tell_lines n134_2->n6_79 n20_4 #20:columnize n134_2->n20_4 n134_7->n116_9 n134_7->n91_47 n134_7->n91_46 n134_7->n35_1 n134_7->n91_26 n134_11->n1_29 n134_11->n52_3 n55_7 #55:remove_duplicates n134_11->n55_7 n134_3 #134:stock n134_3->n52_3 n134_3->n91_26 n134_3->n6_18 n20_16 #20:literal_object n134_3->n20_16 n134_4 #134:unstock n134_4->n1_29 n134_4->n91_26 n134_4->n6_18 n134_9 #134:find_product n134_4->n134_9 n134_9->n134_11 n134_10 #134:index_match n134_9->n134_10 n20_68 #20:match_suspended n134_9->n20_68 n134_5 #134:sell n134_5->n116_9 n134_5->n134_1 n134_5->n1_29 n134_5->n52_3 n134_5->n103_1 n134_5->n91_47 n134_5->n35_1 n134_5->n91_26 n134_5->n6_18 n20_56 #20:first_word n134_5->n20_56 n1_6 #1:match n134_5->n1_6 n134_6 #134:ask n134_6->n116_9 n134_6->n134_1 n134_6->n35_1 n134_6->n91_26 n134_6->n134_2 n134_6->n134_7 n134_6->n6_18 n116_20 #116:ask n134_6->n116_20 n134_13 #134:check_stocks n134_6->n134_13 n134_8 #134:sell_product n134_6->n134_8 n134_13->n6_18 n52_5 #52:isa n134_13->n52_5 n20_71 #20:redirect_ansi n134_13->n20_71 n134_8->n116_9 n134_8->n1_29 n134_8->n52_3 n134_8->n116_3 n134_8->n103_1 n134_8->n91_46 n134_8->n6_18 n134_8->n134_9 n134_8->n20_56 n52_0 #52:has_property n134_8->n52_0 n91_35 #91:transfer_ammo n134_8->n91_35 n27_1 #27:intersection n134_8->n27_1 n52_6 #52:ancestors n134_8->n52_6 n63_2 #63:_create n134_8->n63_2 n134_10->n134_11 n134_10->n20_50 n134_12 #134:_clean_inv n134_12->n1_29 n134_12->n91_46 n46_2 #46:send_message n134_12->n46_2 n20_59 #20:name_and_number n134_12->n20_59 n134_12->n52_5 n63_1 #63:_recycle n134_12->n63_1 n134_14 #134:@menu n134_14->n134_2

Showing 48 of 51 verbs; 3 not shown.

Source

take_hit

Spec this none thisFlags rxdOwner #2Definer #134

Referenced by

none

Source

1"USAGE: victim:take_hit(damage)";
2"       Sets off silent alarm in case of attack";
3if ((this.location.retail && (!this.location.sanctuary)) && (this.stats_current[2][4] < (this.stats[2][4] * 0.75)))
4loc = this.location;
5loc.dump_loc = (loc.dump_loc == $rpg_room.dump_loc) ? `loc.virtual_exits[random($)][2] ! ANY => loc.dump_loc' | loc.dump_loc;
6fork (6)
7loc:announce_all("A loud and shrill alarm begins to ring!");
8loc.sanctuary = 1;
9endfork
10fork (60)
11loc.sanctuary = 0;
12endfork
13endif
14pass(@args);
15if (random(3) == 1)
16this:say(tostr("-", this.enemy, " ", this.outrage_msg));
17endif

tell

Spec this none thisFlags rxdOwner #2Definer #134

Referenced by

Source

1if ((this.location != this.home) && (this in connected_players()))
2return pass(@args);
3elseif (($string_utils:index_delimited(tostr(@args), "hands you") && (parent(player) == parent(this))) && (!(player in connected_players())))
4"This puppet just bought from another puppet.";
5return pass(@args);
6elseif (`parent(this) == $local.cargo_bot ! ANY => 0')
7"has its own tell verb for this stuff";
8return pass(@args);
9endif
10if ($string_utils:index_delimited(tostr(@args), "hands you"))
11fork (1)
12newstuff = $set_utils:diff(this:contents(), this.oldstuff);
13for x in (newstuff)
14if ((!$object_utils:has_callable_verb(x, "value")) || $object_utils:has_callable_verb(x, "combine"))
15this:say(tostr("-", player, " I can't use this."));
16this:_force("give ", x, " to ", player);
17else
18offer = $money_utils:_from_to("Gold", this.currency, (dobj:value() * tofloat(this.buyback_rate)) / 100.0);
19offer = ((money = tofloat(this:_has_amount(this.currency))) < offer) ? money | offer;
20this.oldstuff = setadd(this.oldstuff, x);
21this:_rem_money(this.currency, offer);
22player:_add_money(this.currency, offer);
23$you:say_action(tostr("%N %<receives> ", floatstr(offer, 2), " ", this.currency, " from ", this:title(), "."));
24this:say(tostr("-", player, " ", this.done_deal_msg));
25endif
26endfor
27endfork
28return pass(@args);
29endif
30if (this.my_tell || ((this.location != this.home) && (this in connected_players())))
31return pass(@args);
32endif
33if ($string_utils:index_delimited(tostr(@args), "asks"))
34this:random_free();
35if (($string_utils:index_delimited(tostr(@args), "list") || $string_utils:index_delimited(tostr(@args), "prices")) || $string_utils:index_delimited(tostr(@args), this.listname))
36this:list();
37elseif (($string_utils:index_delimited(tostr(@args), "cash") || $string_utils:index_delimited(tostr(@args), "money")) || $string_utils:index_delimited(tostr(@args), this.currency))
38this:collect_cash();
39elseif (($string_utils:index_delimited(tostr(@args), "sell") || $string_utils:index_delimited(tostr(@args), "buy")) || $string_utils:index_delimited(tostr(@args), "for sale"))
40this:say(tostr("-", player, " ", this.advertise_msg));
41endif
42endif
43pass(@args);

list

Spec this none thisFlags rxdOwner #2Definer #134

Referenced by

Source

1this.my_tell = 1;
2items = this:items();
3length = length(items);
4if (!length)
5this:say(tostr("-", player, " I don't have any items at the moment, but check back later."));
6return this.my_tell = 0;
7endif
8if (player != this)
9this:say(tostr("-", player, " Here is a ", this.listname, " of items for sale."));
10endif
11this.my_tell = 1;
12player:tell("");
13fork (3)
14this.my_tell = 1;
15this.location:announce_all_but({player}, tostr(this:title(), " pulls out a ", this.listname, " and shows it to ", player:title(), "."));
16player:tell("--------------------------------------------------");
17indices = $string_utils:char_list($string_utils.alphabet)[1..length];
18names = {};
19prices = {};
20for a in [1..length]
21names = {@names, tostr(indices[a], " - ", items[a]:title())};
22credpr = $object_utils:has_callable_verb(items[a], "combine") ? items[a].value_base | items[a]:value();
23prices = {@prices, tostr(floatstr($money_utils:_from_to("Gold", this.currency, credpr), 2), " ", this.currency)};
24endfor
25player:tell_lines($string_utils:columnize({@names, @prices}, 2, 64));
26player:tell("--------------------------------------------------");
27if (player != this)
28this:say(tostr("-", player, " You can ask me for the product by name or alphabetical index. Items followed by numbers in ( ) can be purchased in bulk."));
29fork (3)
30player:tell("");
31player:tell("(Hints: \"ask ", this:title(), " for <item>\"");
32player:tell("        \"buy <item> from ", this:title(), "\"");
33player:tell("        \"ask ", this:title(), " for <amount> <bulk item>\")");
34endfork
35endif
36suspend(6);
37this.my_tell = 0;
38endfork

stock

Spec this with/using anyFlags rdOwner #2Definer #134

Referenced by

none

Source

1iobj = valid(iobj) ? iobj | $string_utils:literal_object(iobjstr);
2if (((!valid(iobj)) || (!`player.victim_port_msg ! E_PROPNF => 0')) || (!$object_utils:has_callable_verb(iobj, "value")))
3return player:tell("The object must be both valid and valuable. You must also be an administrator to perform this out-of-character task.");
4endif
5if (iobj.f)
6this.items = setadd(this.items, iobj);
7player:tell("You have added ", iobj:title(), " to ", this:title(), "'s list of goods.");
8else
9iobj:moveto(this);
10this.oldstuff = setadd(this.oldstuff, iobj);
11player:tell("You have given ", iobj:title(), " to ", this:title(), ".");
12endif

unstock

Spec any out of/from inside/from thisFlags rdOwner #2Definer #134

Referenced by

none

Source

1dobj = this:find_product(dobjstr);
2if ((!valid(dobj)) || (!`player.victim_port_msg ! E_PROPNF => 0'))
3return player:tell("The object must be valid, and you must be an administrator to perform this out-of-character task.");
4endif
5if (dobj in this:contents())
6dobj:moveto(player);
7this.oldstuff = setremove(this.oldstuff, dobj);
8player:tell("You have taken ", dobj:title(), " from ", this:title(), ".");
9else
10this.items = setremove(this.items, dobj);
11player:tell("You have removed ", dobj:title(), " from ", this:title(), "'s list of goods.");
12endif

sell

Spec any at/to thisFlags rdOwner #2Definer #134

Referenced by

none

Source

1if (player == this)
2return this:tell("Don't be silly.");
3endif
4this.my_tell = 1;
5$you:say_action(tostr("%N %<offers> to sell ", dobjstr, " to ", this:title(), "."));
6amountitem = $string_utils:first_word(dobjstr);
7amount = toint(amountitem[1]);
8itemname = amountitem[2];
9if ((valid(dobj) && (dobj in player:contents())) && (!$object_utils:has_callable_verb(dobj, "combine")))
10if ($object_utils:has_callable_verb(dobj, "value"))
11offer = $money_utils:_from_to("Gold", this.currency, (dobj:value() * tofloat(this.buyback_rate)) / 100.0);
12offer = ((money = tofloat(this:_has_amount(this.currency))) < offer) ? money | offer;
13this:say(tostr("-", player, " I can offer you no more than ", floatstr(offer, 2), " ", this.currency, " for that."));
14this:say(tostr("-", player, " Give it to me if you still want to sell it."));
15else
16this:say(tostr("-", player, " That has no value to me."));
17return this.my_tell = 0;
18endif
19elseif ($object_utils:has_callable_verb(dobj, "combine") || amount)
20if (valid(item = player:match(itemname)))
21this:say(tostr("-", player, " I only buy brand new ammunition from authorized dealers."));
22return this.my_tell = 0;
23else
24this:say(tostr("-", player, " I don't buy used ", dobjstr, " in bulk quantities."));
25return this.my_tell = 0;
26endif
27else
28player:tell("You don't seem to have any \"", dobjstr, "\" to sell.");
29endif

ask

Spec this any anyFlags rxdOwner #2Definer #134

Referenced by

none

Source

1if (prepstr == "to")
2pass(@args);
3elseif (prepstr == "for")
4if (player == this)
5if (iobjstr in {"list", this.listname, "prices"})
6return this:tell("Try \"@menu\".");
7endif
8return this:tell("Sorry, that's just too convenient to be fair.");
9endif
10this.my_tell = 1;
11$you:say_action(tostr("%N %<asks> ", this:title(), " for ", iobjstr, "."));
12this.my_tell = 0;
13if (iobjstr in {"stocks", "shelves", "stores", "inventory"})
14return this:check_stocks();
15endif
16if (iobjstr in {"list", this.listname, "prices"})
17return this:list();
18endif
19if (iobjstr in {"money", "cash", this.currency})
20return this:collect_cash();
21endif
22if (iobjstr in {"name", "his name", "her name"})
23return this:say(tostr("-", player, " My name is ", this.name, "."));
24endif
25this:sell_product(iobjstr, player);
26else
27player:tell("Try: \"ask ", this:title(), " to/for <something>\"");
28endif

collect_cash

Spec this none thisFlags rxdOwner #2Definer #134

Referenced by

Source

1if (player in this.trustees)
2this:say(tostr("-", player, " Sure thing, Boss!"));
3cash = tofloat(this:_has_amount(this.currency));
4this:_rem_money(this.currency, cash);
5player:_add_money(this.currency, cash);
6this.my_tell = 1;
7suspend(2);
8$you:say_action(tostr("%N %<receives> ", floatstr(cash, 2), " ", this.currency, " from ", this:title(), "."));
9else
10this:say(tostr("-", player, " Get away, beggar!"));
11endif

sell_product

Spec this none thisFlags rxdOwner #2Definer #134

Referenced by

Source

1"usage: sell_product(item name, buyer object)";
2"this verb needs to be wiz-owned.";
3itemname = args[1];
4iobj = args[2];
5amountitem = $string_utils:first_word(itemname);
6item = (amount = toint(amountitem[1])) ? this:find_product(amountitem[2]) | this:find_product(itemname);
7if (item == $failed_match)
8return this:say(tostr("-", iobj, " Sorry, I don't have any ", itemname, " today."));
9elseif (`player:reached_limit() ! E_VERBNF => "GUEST"')
10return this:say(tostr("-", iobj, " You don't look strong enough to carry more!"));
11endif
12if (amount && (!$object_utils:has_callable_verb(item, "combine")))
13return this:say(tostr("-", iobj, " Sorry, I don't sell ", item:title(), " in bulk quantities."));
14elseif ((!amount) && $object_utils:has_callable_verb(item, "combine"))
15amount = 1;
16endif
17price = amount ? tofloat(amount) * $money_utils:_from_to("Gold", this.currency, item.value_base) | $money_utils:_from_to("Gold", this.currency, item:value());
18if (tofloat(iobj:_has_amount(this.currency)) < price)
19this:say(tostr("-", iobj, " ", this.outrage_msg));
20return this:say(tostr("-", iobj, " I only deal in ", this.currency, ". Clearly you do not have enough!"));
21endif
22if (item.f && (item in this.items))
23if ($object_utils:has_callable_verb(item, "combine"))
24prop = $object_utils:has_property(item, "rounds") ? "rounds" | "units";
25if (amount > item.(prop))
26return this:say(tostr("-", iobj, " Sorry, I don't have that many."));
27elseif (amount == 0)
28return this:say(tostr("-", iobj, " Pardon me, I didn't hear how many you wanted."));
29endif
30this:transfer_ammo(amount, item, iobj);
31elseif ($object_utils:has_callable_verb(item, "replicate"))
32object = item:replicate();
33if (valid(object))
34object:moveto(this);
35this:_force("give ", object, " to ", iobj);
36else
37return this:say(tostr("-", iobj, " Ahh, I only have the display model for that, and it's non-functional. :|"));
38endif
39else
40owner = ($set_utils:intersection($object_utils:ancestors(item), {$note, $container}) != {}) ? iobj | $default_holder;
41object = $recycler:_create(item, owner);
42if (!valid(object))
43return player:tell("You have gone over quota. Delete some mail using @rmm.");
44endif
45object:set_name(item.name);
46object.aliases = item.aliases;
47object:moveto(this);
48this:_force("give ", object, " to ", iobj);
49endif
50elseif (item in this:contents())
51this:_force("give ", item, " to ", iobj);
52this.oldstuff = setremove(this.oldstuff, item);
53endif
54iobj:_rem_money(this.currency, price);
55this:_add_money(this.currency, price * 0.35);
56this:say(tostr("-", iobj, " ", this.done_deal_msg));

find_product

Spec this none thisFlags rxdOwner #2Definer #134

Referenced by

Source

1"usage: find_product(item name) => object or $failed_match";
2"       Returns first item found, never $ambiguous_match, thus";
3"       trys to sell inventory before 'ordering' new products";
4product = args[1];
5if (valid(x = this:index_match(product)))
6return x;
7endif
8if (toobj(product) in this:items())
9return toobj(product);
10endif
11match = $string_utils:match_suspended(product, this:items(), "aliases");
12if (match != $ambiguous_match)
13return match;
14else
15"the first exact match will do";
16for x in (this:items())
17if (product in x.aliases)
18return x;
19endif
20(ticks_left() < 5000) && suspend(0);
21endfor
22endif

index_match

Spec this none thisFlags rxdOwner #2Definer #134

Referenced by

Source

1items = this:items();
2n = length(items);
3if (!n)
4return $failed_match;
5endif
6indices = $string_utils:char_list($string_utils.alphabet)[1..n];
7if (i = args[1] in indices)
8return items[i];
9endif
10return $failed_match;

items

Spec this none thisFlags rxdOwner #2Definer #134

Referenced by

Source

1stuff = this:contents();
2for item in (stuff)
3if (((item == this.wielded) || $object_utils:has_callable_verb(item, "combine")) || `item.wornness ! E_PROPNF => 0')
4stuff = setremove(stuff, item);
5endif
6endfor
7return $list_utils:remove_duplicates({@stuff, @this.items});

_clean_inv

Spec this none thisFlags rxdOwner #2Definer #134

Referenced by

none

Source

1"Factory buys back used goods from retail outlet";
2"Use with the $scheduler";
3stuff = this:contents();
4for item in (stuff)
5if (item.f)
6$mail_agent:send_message(this, $default_holder, "Bot Has Generic", {$string_utils:nn(this), $string_utils:nn(item)});
7elseif ((((item != this.wielded) && (parent(item) in this.items)) || $object_utils:isa(item, $food1)) || $object_utils:isa(item, $food2))
8this:_add_money(this.currency, (item:value() * tofloat(this.buyback_rate)) / 100.0);
9$recycler:_recycle(item);
10endif
11endfor
12suspend(0);
13this.oldstuff = this:contents();
14for item in (this.items)
15if (parent(item) == $garbage)
16this.items = setremove(this.items, item);
17endif
18endfor

check_stocks

Spec this none thisFlags rxdOwner #2Definer #134

Referenced by

Source

1dobj = this;
2if ((!(player in this.trustees)) && (!player.wizard))
3return player:tell(E_PERM);
4endif
5objs = {};
6for x in (dobj.items)
7if ($object_utils:isa(x, $homer))
8objs = {@objs, x};
9endif
10endfor
11player:tell($string_utils:left("[white][bold]Name[normal]", 17), $string_utils:left("[yellow][bold]Manufactured[normal]", 18), $string_utils:left("[green][bold]In Stock[normal]", 10));
12player:tell("[bold]", $string_utils:space(46, "-"), "[normal]");
13for x in (objs)
14player:tell($string_utils:left(tostr("[white][bold]", x.name, "[normal]"), 17), $string_utils:right(tostr("[yellow][bold]", x.child_limit, "[normal]"), 6), $string_utils:right(tostr("[green][bold]", x.child_limit - length(children(x)), "[normal]"), 16));
15endfor

@menu

Spec none none noneFlags rdOwner #2Definer #134

Referenced by

none

Source

1"If the sales bot is a a player, this allows the player to check its own stock.";
2this:list();

init_for_core

Spec this none thisFlags rxdOwner #2Definer #134

Referenced by

none

Source

1if (caller_perms().wizard)
2if (this == $sales_bot)
3this.items = {};
4this.oldstuff = {};
5this.outrage_msg = "This is an outrage!";
6this.done_deal_msg = "Wonderful doing business with you!";
7this.currency = "Gold";
8this.listname = "catalog";
9this.buyback_rate = 50;
10this.advertise_msg = "Sure, I buy and sell. I can show you a catalog, if you ask for it.";
11this.trustees = {#2};
12else
13for p in (properties($sales_bot))
14if ((!p) in {"build_help", "help_msg"})
15clear_property(this, p);
16endif
17endfor
18endif
19return pass(@args);
20endif

buy order

Spec any out of/from inside/from thisFlags rxdOwner #2Definer #134

Referenced by

none

Source

1if ((player == this) || (player.location != this.location))
2return this:tell("Sorry, that's just too convenient to be fair.");
3endif
4this.my_tell = 1;
5$you:say_action(tostr("%N %<requests> to buy ", dobjstr, " from ", this:title(), "."));
6this.my_tell = 0;
7this:sell_product(dobjstr, player);