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
Solaras
Wanderer


Joined: 11 Mar 2002
Posts: 93

PostPosted: Mon Jun 10, 2002 5:59 am   

help with scripting please
 
ok i want to set up a script to pick chests for me.. if I do an inventory I get this
a heavy wood trunk
( 2) a heavy wood strongbox
( 3) a heavy wood coffer
( 2) a sturdy iron strongbox
( 2) a sturdy iron trunk
a rotting wood coinbox
(11) a steak
a sturdy iron coffer
a sturdy brass coinbox
( 2) a sturdy brass trunk
a rusted iron safebox
a heavy brass coffer
a rusted brass coffer
( 4) a rusted iron chest
( 2) a heavy iron strongbox
a heavy brass strongbox
( 2) a heavy iron trunk
( 2) a rusted brass safebox
( 2) a sturdy brass strongbox
( 2) a rotting wood safebox
( 2) a sturdy brass coffer
( 3) a heavy brass coinbox
[Hit Return to continue]
a heavy wood trunk

What I need is for it to count how many strongboxs, coffers, coinbox, etc. I have and keep them in variables. I am pretty sure I can figure out thatpart but not positive.
then When I click the pick all button I want it to start on the first set of items and pick them till it has completed all, then move to the second set, and so on, until all have been done.

these are the following triggers for successfull picking or unsuccessful picking

Trigger You pick the lock on a %1.
Command open %1;get all %1;drop %1;sac %1

Trigger You failed.
Command pick %1

Trigger You attempt to pick the lock on(*), but fail.
Command pick %1

If someone can tell me how to do the loop so it goes through one by one until they are all done I would appreciate it.
Reply with quote
Rowene
Beginner


Joined: 11 Jan 2002
Posts: 27
Location: United Kingdom

PostPosted: Mon Jun 10, 2002 11:36 am   
 
The script below doesn't do exactly what u want, but it may go someway towards it. What it does do is repeatidly picks the locks on a given container type, for example a strongbox, until you receive the message "You don't have that item". The script itself is amodified version of the spellcasting loop posted here recently.

I hope this code may help someone else finish off your request...

#ALIAS Pickloop {
#var Currentpick "%-1" "PickLoop"
#t+ PickLoop
pick "%-1"
}
#CLASS {PickLoop} {disable}
#VAR pickdir {pickloop} {pickloop}
#VAR Currentpick {box} {pickLoop}
#TRIGGER {^You attempt to pick the lock on} {pick @Currentpick}
#TRIGGER {^You pick the lock on} {
open @currentpick
get all @currentpick
drop @currentpick
sac @currentpick
pick @Currentpick
}
#TRIGGER {You don't have that item} {#t- pickloop}
#CLASS 0
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