|
okkita Newbie
Joined: 23 Oct 2002 Posts: 6 Location: Spain
|
Posted: Wed Oct 30, 2002 6:41 pm
Multiline Trigs... again |
Hi!
I want to colour up some items on my inv... but the problem is that those items could happen to be splitted by several different parts of their names... this is how the inventory looks like:
**You are carrying a long sinew, a small green smooth jade stone, a book
**with the title 'dark minor', a compass, a digging-hoe, many gold
**coins, many tiny green smooth jade stones, an ornamented bone dagger,
**a rose, three scrolls, a short ritualstaff, a simple empty clay pot, a
**small leather backpack, some silver coins, three copper coins, two
**long falconfeathers and a waterskin (1l).
I substituted spaces by * for clarity.
What I seek is to have, for example, a blinking yellow "gold coins", or red "book with the title 'dark minor'"
Help appreciated, tx in advance,
Okkita |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Oct 31, 2002 12:15 am |
#CLASS {InvControl}
#ALIAS AddInvCol {#ADDKEY ColorInv {%1} {%2}}
#VAR ColorInv {some silver coins"blue"}
#VAR TempInvLine {}
#TRIGGER {^%sYou are carrying} {TempInvLine="";#T+ InventoryColor}
#CLASS 0
#CLASS {InvControl|InventoryColor} {"disable"}
#TRIGGER {^%s(*)$} {#IF (%ends("%1",".")) {TempInvLine=%remove(".",%replace(%concat(@TempInvLine," ","%1"),", ","|"));#FORALL @TempInvLine { #IF (%db(@ColorInv,%i)!="") { TempInvLine=%replace(@TempInvLine,%i,%concat(%ansi(%db(@ColorInv,%i)),%i,%ansi(default)))}};TempInvLine=%concat(@TempInvLine,".");TempInvLine=%replace(@TempInvLine,"|",", ");#SHOW {@TempInvLine};#T- InventoryColor} {#GAG;TempInvLine=%concat(@TempInvLine," ","%1")}}
#CLASS 0
In case it doesn't copy and paste right, ColorInv is of type data record. I left one example in there for you. In order to use the AddInvCol alias you will have to put braces around the items. For example addinvcol {book with the title 'dark minor'} {red} |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|