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
aliensurfer
Beginner


Joined: 11 Apr 2005
Posts: 17

PostPosted: Tue May 17, 2005 4:01 pm   

Targets in an Array
 
I currently have a VAR of @p for a player target.

I have an alias of b = bash @p

That works fine.

I would like to be able to add a list of names to an array (or list), display that in the status window and then have an alias to fill @p with the players name.

Example:

I join a Rampage with 5 people in it. Instead of typing "t longplayersname" to populate @p (which works fine BTW) everytime I want to target, I would like to put the names into a list, from the command line, and have Aliases assigned to them

The people in the Rampage are:

George
Ringo
John
Paul
Me

I would like to show this in the status bar with a number next to each and have that number be an alias to the target.

George | Paul | John | Ringo

Ie, pressing 1 would populate @p with George, quickly pressing 2 would populate @p with Paul and so on. I would like it to be displayed as there can be sometimes 10 or more in a Rampage, which would get confusing.

Ideally, just typing somthing like "list=George,Paul,John,Ringo" would be fine for populating the Array

I don't even know where to start with this, any ideas?

Cheers,

Matt



PS:
What would be nice is when you type EVENT you get a list of who's in the Rampage, maybe we can use that to fill the array?

Example output of that would be

Name Stats Location
George 100/100 Some Room Somwhere
Ringo 119/190 Some Room Somwhere Else
John 300/400 Here
Paul 500/900 There
Me 400/400 Everywhere

The Name will not always appear first on the line, sometimes if the room name is long, it will scroll onto the next line.

Example

Ringo 119/190 Some Room Somwhere Else Far Far
away


Thanks.
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Tue May 17, 2005 4:34 pm   
 
; start with a fresh players list and show it in the status bar
#VAR player {}
#STATUS {Rampage: @player}

; get the players that are in the rampage
#TRIGGER {^(%w) %d/%d} {#ADDITEM player {%1}}

; alias to target a player
; takes a second argument from 1 to N [IE t 1, t 2, t #]
#ALIAS t {#ALIAS b {bash %item(@player,%1)}}
Reply with quote
aliensurfer
Beginner


Joined: 11 Apr 2005
Posts: 17

PostPosted: Wed May 18, 2005 1:00 pm   
 
Thank you Maelstrom, thats great, I'll give it a go
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