Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Death
Apprentice


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Mon Apr 28, 2003 12:11 am   

doable? inventory list and actions on color
 
Ok, in my mud there are different type of objects, part of the random equipment thing. That are unidentified or have special slots to add gems and runes to. They appear red for unidentified and white for slotted objects. Is there a way to scroll through the inventory list and put all red an white objects into a container then drop and sacrifice the rest? Here is a sample inventory listing:
(blue will depict white, since there is no white)

You are carrying:
superior Leg Cleaver
black widow greaves
superior plated belt
( 7) ring
Crude Gladius
kicker boots
troll belt
( 2) stock shield
( 5) amulet
sultan gloves
wooden buckler
ancient banded
ranger banded armor

A side note, they should all line up with where the objects with multiple ones are, but the forum doesn't accept it I guess. There is nothing at the bottom to let you know it's the end, except my containers that would normally be at the bottom:

a Green Pouch

If this is doable, I was wondering if someone could help me write a script for it. Thanks to anyone for your time.

-Death

-=Realms of the Forgotten=-
site: www.rotf.net
connect: rotf.net:5000
Reply with quote
racolon
Beginner


Joined: 27 Apr 2003
Posts: 25
Location: USA

PostPosted: Mon Apr 28, 2003 3:20 pm   
 
Well I can say I did it for one of my chars in AE. All I did was
#CO {*armour name*|*weapon name*|etc} blue
All the different parts in your inventory can be colored. If you have multiple characters that have to use the same equipment better if not make different sets of coloring for whatever you use.

For the pouch #CO {green} green or bold,green

I prefer the use of magenta, cyan, bold red, blue and grey.

Hope that helps if not let me know I'll write it for you since Im a color freak myself. If I could post a print screen of my zmud window you'll blink :)


Endora
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Mon Apr 28, 2003 7:15 pm   
 


You are carrying:
superior Leg Cleaver
black widow greaves
superior plated belt
( 7) ring
Crude Gladius
kicker boots
troll belt
( 2) stock shield
( 5) amulet
sultan gloves
wooden buckler
ancient banded
ranger banded armor


Ton Diening
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Mon Apr 28, 2003 7:59 pm   
 
#CLASS {InventoryBagSorter}
#VAR NumberOfItems {0}
#VAR WhiteBag {Whitebag}
#VAR RedBag {redbag}
#VAR GreyBag {Greybag}
#TRIGGER "InventoryGreySorter" {^You are carrying~:$} {#TEMP "InventoryGreySorterEndState" {^$} {#STATE InventoryGreySorter 0}} "" {color}
#COND {^(&4) %e[1;30m(*)$} {#VAR NumberOfItems %int( %eval( %trim( %replace( {%1}, "(", ""), ")", "")));#LOOP %if( @NumberOfItems=0, 1, @NumberOfItems) {put %word( {%2}, %numwords( {%2})) @GreyBag}} {looppat|param=99|notrig|color}
#TRIGGER "InventoryWhiteSorter" {^You are carrying~:$} {#TEMP "InventoryWhiteSorterEndState" {^$} {#STATE InventoryWhiteSorter 0}} "" {color}
#COND {^(&4) %e[57m(*)$} {#VAR NumberOfItems %int( %eval( %trim( %replace( {%1}, "(", ""), ")", "")));#LOOP %if( @NumberOfItems=0, 1, @NumberOfItems) {put %word( {%2}, %numwords( {%2})) @WhiteBag}} {looppat|param=99|notrig|color}
#TRIGGER "InventoryRedSorter" {^You are carrying~:$} {#TEMP "InventoryRedSorterEndState" {^$} {#STATE InventoryRedSorter 0}} "" {color}
#COND {^(&4) %e[31m(*)$} {#VAR NumberOfItems %int( %eval( %trim( %replace( {%1}, "(", ""), ")", "")));#LOOP %if( @NumberOfItems=0, 1, @NumberOfItems) {put %word( {%2}, %numwords( {%2})) u]@RedBag}} {looppat|param=99|notrig|color}
#CLASS 0

Used to test:
#ALIAS ForceInv {#SH Example;#SH You are carrying:;#SH " "%ansi( white)superior Leg Cleaver;#SH " "%ansi( red)black widow greaves;#SH " "%ansi( white)superior plated belt;#SH "( 7) "%ansi( red)ring;#SH " "%ansi( black, bold)Crude Gladius;#SH " "%ansi( black, bold)kicker boots;#SH " "%ansi( red)troll belt;#SH "( 2) "%ansi( black, bold)stock shield;#SH "( 5) "%ansi( red)amulet;#SH " "%ansi( black, bold)sultan gloves;#SH " "%ansi( red)wooden buckler;#SH " "%ansi( black, bold)ancient banded;#SH " "%ansi( black, bold)ranger banded armor}

Assumes that you can manipulate your inventory items first to last.
Assumes your inventory list ends in a blank line (used by the #TEMP triggers to set state 0)
You'll probably have to change the ansi codes to reflect the exact colors your mud uses.

I just chop and pasted the idea so it sorts the three kinds of things into 3 bag.
You can easily change it to drop/sac for the non-white/red ones. Change the variables for the Red/grey/White bags.

Ton Diening
Reply with quote
racolon
Beginner


Joined: 27 Apr 2003
Posts: 25
Location: USA

PostPosted: Mon Apr 28, 2003 8:32 pm   
 
My bad what I posted was not what you were looking for.
But still will work to color some items if you wish.

My apologies

Endora
Reply with quote
Death
Apprentice


Joined: 25 Jun 2002
Posts: 109
Location: USA

PostPosted: Wed Apr 30, 2003 3:28 am   
 
I type inven to display my inventory and nothing happens. I create your alias and it wants to do something based off it, but not my normal inventory. I'm not sure what it's problem is. Thanks for the script posted so far, I'll keep looking it over, check and re-checking it.

-Death

-=Realms of the Forgotten=-
site: www.rotf.net
connect: rotf.net:5000
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Apr 30, 2003 7:52 am   
 
Modified to reflect the mud's exact colors etc:

#CLASS {InventoryBagSorter}
#VAR NumberOfItems {0}
#VAR WhiteBag {White}
#VAR RedBag {red}
#VAR GreyBag {Grey}
#TRIGGER "InventoryGreySorter" {^You are carrying:$} {#TEMP "InventoryGreySorterEndState" {^$} {#STATE InventoryGreySorter 0}} "" {}
#COND {^%e[37m(&4) (*)%e[0m} {#VAR NumberOfItems %int( %eval( %trim( %replace( {%1}, "(", ""), ")", "")));#LOOP %if( @NumberOfItems=0, 1, @NumberOfItems) {put %word( {%2}, %numwords( {%2})) @GreyBag}} {looppat|param=99|color}
#TRIGGER "InventoryWhiteSorter" {^You are carrying:$} {#TEMP "InventoryWhiteSorterEndState" {^$} {#STATE InventoryWhiteSorter 0}} "" {}
#COND {^%e[37m(&4) %e[1;37m(*)%e[0m} {#VAR NumberOfItems %int( %eval( %trim( %replace( {%1}, "(", ""), ")", "")));#LOOP %if( @NumberOfItems=0, 1, @NumberOfItems) {put %word( {%2}, %numwords( {%2})) @WhiteBag}} {looppat|param=99|color}
#TRIGGER "InventoryRedSorter" {^You are carrying:$} {#TEMP "InventoryRedSorterEndState" {^$} {#STATE InventoryRedSorter 0}} "" {}
#COND {^%e[37m(&4) %e[1;31m(*)%e[0m} {#VAR NumberOfItems %int( %eval( %trim( %replace( {%1}, "(", ""), ")", "")));#LOOP %if( @NumberOfItems=0, 1, @NumberOfItems) {put %word( "%2", %numwords( "%2")) @RedBag}} {looppat|param=99|color}
#CLASS 0

Ton Diening
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net