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
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Sat Aug 26, 2006 5:26 pm   

item pickup
 
i have a trigger,

Code:
^&nnn{@items} ~(*~)~ ~{&inum~}~.


that will match an item that looks like (o)A case (glowing) {2}
i have a list of items in @items that i want to pickup, i do this so i can have just a long variable listing of items instead of 30 triggers, upon this executes

Code:
#if (%numitems( @item) = 1) {#var item %additem( %lower( %word( %param, %eval( %numwords( %param)-1))), @item)} {#var item %lower( %word( %param, %eval( %numwords( %param)-1)))};getitem


the problem is this, it works fine with only one copy of the item, but the number of items is indicated inside {}, so i want to pick it up twice. the alias getitem looks like,

Code:
#alarm +.01 {
  #if ((@playercheck = 0) & (@picker = 1)) {
    get %item( @item, 1)
    #if (@bags = 1) {put %item( @item, 1) in bag @buse}
    #delnitem item 1
    }
  }


this is to prevent stealing items from other players. so what happens if there are two items is it picks up the first properly, but then does a 'get' and 'put in bag 2' because the var is empty, any suggestions on how to fix this?
Reply with quote
edb6377
Magician


Joined: 29 Nov 2005
Posts: 482

PostPosted: Sat Aug 26, 2006 10:21 pm   
 
just add a command on the number of items and replace &inum with something

%repeat(getitem,@NUMITEM)
_________________
Confucious say "Bugs in Programs need Hammer"
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