Kisa Flexible Lists

From Tenebrae
Revision as of 19:08, 14 December 2017 by Kisaiya (talk | contribs)
Jump to navigation Jump to search

This code was designed because I (Kisaiya) am terrible at keeping track of what items I need to buy for my character(s). So, I wrote a code to keep it all organized, including which crafter I plan to go to for making it!

Step One: Copy and Paste

Copy and paste the following:

&C_SHOP %!=|[ljust(%xh%0%xn,30,%xb-)]|[center(%xh%1%xn,14,%xb-)]|[center(%xh%2%xn,14,%xb-)]|%r%xn
&V_ITEM %!=ITEM, PRICE, CRAFTER
&DO_HELPSHOP %!=$^\+(shop|sho|sh)$:@pemit %!=[center([ansi(hw,Shop Help)],70,[ansi(b,-)])]%r[ansi(hc,Usage:)] %r%tThis help File: %t[ansi(hw,+shop)]%r%tView your list: %t[ansi(hw,+shop/view)]%r%tAdds an item: %t%t[ansi(hw,+shop/add \<item\>\, \<cost\>\, \<maker\>)] %r%tRemoves an Item: %t[ansi(hw,+shop/rem \<item\>)] %r[ansi(b,[repeat(-,70)])]
&DO_SHOP %!=$^\+(shop|sho|sh)/(view|vie|vi|v)$:@pemit %!=%r[ansi(hw,%n's Shopping List!)]%r [repeat(_,62)]%r [iter([u(V_ITEM)],[mix(C_SHOP,##,:)],|)] [repeat(-,62)]
&DO_ADDSHOP %!=$^\+(shop|sho|sh)/(add|ad|a) (.+), (.+), (.+)$:&V_ITEM %!=[v(V_ITEM)]|%3\, %4\, %5;@pemit %!=Item "%3" stored.
&DO_REMSHOP %!=$^\+(shop|sho|sh)/(remove|rem|r) (.+)$:&V_ITEM %!=[remove([u(V_ITEM)],[index([u(V_ITEM)],|,[match([u(V_ITEM)],%3*,|)],1)],|)];@pemit %!=Item "%3" removed from list.

Step Two: Copy and Paste part 2

Copy and paste the following so you can enable regular expressions on several of the commands:

@set %!/DO_HELPSHOP=regexp
@set %!/DO_SHOP=regexp
@set %!/DO_ADDSHOP=regexp
@set %!/DO_REMSHOP=regexp

Step Three: ENJOY!

You type: +shop< br/> This will show you the help page, also as a node, you can actually shorten many of the commands down to something as simple as: +sh/r <item>