This GMCP Item Tracker takes care of all the item tracking. In order to not get messed up with other functions modifying GMCP.Item information, this tracker uses all of its own tables as well as a manual deep-copy of the gmcp tables into its own tables.
This was programmed for Achaea, and follows the GMCP standards as implemented there. If another MUD has something modified slightly from the standards, or interprets the standards differently, it should only require minor modification. Please feel free to re-post 'realm specific' mods of this here.
Variables:
room_items : A table of all the items in the room, updated with every item entered into the room
inv_items : A table of all the items in your inventory, updated with every item acquired. NOTE: In Achaea, the 'secret' ability hides the acquisition message, even in GMCP - these items will not show until this table is updated, which should happen any time the inventory is checked.
wield_items : A table of the left and right wielded items. If an item is a two-hand wield, it will be in both left -and- right portions of this table. For instance, wield_items.left.id would be the ID of the item wielded in your left hand. This updates on the inventory list message, update messages, and remove messages.
phoenix.items["1234_items"] : A table of the contents of container 1234, automatically generated.
*NEW!*
Events:
Wield Event - this event fires after the wield table is fully updated.
phoenix done with wield - passes an argument of what happened during wield updating. This argument is an explanatory argument, in case you need to trigger off 'unwield', for instance.
Tracking Event - These events fire only after the scripts are done running, and room_item and inv_items have been fully updated.
phoenix items add - passes an argument of 'location', for where the item was added to.
phoenix items remove - passes an argument of 'location', for where the item was removed from.
phoenix items list - passes an argument of 'location', for which location we received a list of.
phoenix items update - passes an argument of 'location', for where the item updated was located.
GMCP Item Tracker
GMCP Item Tracker
- Attachments
-
- Phoenix GMCP Items.zip
- Updated 07/04/2014 for Achaea's current GMCP implementation. Minor mods may be required for other MUDs.
- (1.87 KiB) Downloaded 1389 times
Re: GMCP Item Tracker
Hello!
First off, I want to say that your script works wonderfully well.
I only have one issue, and that's because it seems to send five "ql" commands on login, and it's very spammy.
I think it's caused by not catching info, and retrying until gmcp becomes responsive.
Is it possible? Or would anything else cause it?
First off, I want to say that your script works wonderfully well.
I only have one issue, and that's because it seems to send five "ql" commands on login, and it's very spammy.
I think it's caused by not catching info, and retrying until gmcp becomes responsive.
Is it possible? Or would anything else cause it?
-
- Posts: 27
- Joined: Fri Jun 26, 2015 8:52 am
Re: GMCP Item Tracker
I was dreading going through and fixing all the spaghetti code I wrote when I was figuring out how GMCP works. This saved me a lot of work. Here's a few convenience functions (for Achaea) I've been using with it in case they are helpful to anyone else.
The last one relies the wundersys function wsys.doadd() function to work. It can be replaced by longer timers, balance triggers, or any other function that sends commands when the character has balance/eq. It gives all of the things in your inventory with the string stuff in their name to npc. It's good for single items as well as multiples, especially when you need to give a denizen a specific book, note, etc. and you have other items of that type in your inventory.