Kisa Flexible Lists

From Tenebrae
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
This will show you the help page, also as a note, you can actually shorten many of the commands down to something as simple as: +sh/r <item>




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! You can use this though, for lists of any type!

Examples

Use as a Quick Reference

 ______________________________________________________________
 |ITEM--------------------------|----BENEFIT---|---CRAFTER----|
 |Power Attack------------------|--- -1/+4 ----|----Verna-----|
 --------------------------------------------------------------

Use as a Shopping List

 ______________________________________________________________
 |ITEM--------------------------|----PRICE-----|---CRAFTER----|
 |Ring of Protection +2---------|---3600 gp----|----Verna-----|
 |Fullplate +2------------------|---2400 gp----|---Kerbasi----|
 |Natural Armor Amulet +3-------|---10800 gp---|----Sandy-----|
 |Inf. Connections T5-----------|----10 RPP----|-----RPP------|
 --------------------------------------------------------------
 

The Help File

------------------------------Shop Help-------------------------------
Usage:
        This help File:         +shop
        View your list:         +shop/view
        Adds an item:           +shop/add <item>, <cost>, <maker>
        Removes an Item:        +shop/rem <item>
----------------------------------------------------------------------


Installation

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 <br />
&V_ITEM %!=ITEM, PRICE, CRAFTER <br />
&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)])] <br />
&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)]<br />
&DO_ADDSHOP %!=$^\+(shop|sho|sh)/(add|ad|a) (.+), (.+), (.+)$:&V_ITEM %!=[v(V_ITEM)]|%3\, %4\, %5;@pemit %!=Item "%3" stored.<br />
&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.<br />

Step Two: ENJOY!

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


Optional: RegEx!

Like RegEx? 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