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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
chrissythepoet
Newbie


Joined: 19 Oct 2014
Posts: 2

PostPosted: Thu Oct 23, 2014 8:40 pm   

auto pickup item and move room trigger
 
I'm very new to scripting. I'm trying to write a script that does the following.

Not sure how to do this part but maybe the command LOOK and see if the item is in the room.
I was thinking maybe I could write a script to move on a timer if possible but then again what if there are three boxes in the room that I need to pick up and balance is 2 seconds. How would I get the time through when there are multiple boxes?

Next command is GET BOX

when the above command is executed, it will take balance.

(how do I write a script that would allow me to get box on balance and not execute this command at other times that I use balance?)

After balance comes back, I need the script to move rooms




The way the map is laid out is like a square

5 east 5 south 5 west 5 north

Then you come around to the same room you started at.

If you have any questions please let me know. I tried to include every step.

Thanks
Chrissy
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Oct 24, 2014 3:41 am   
 
Use the #PATH code to move around, #PAUSE when you see items to retrieve or lose balance and #RESUME when done.

Paths are either used directly, or assigned a name with the #PATH command, in this example it would translate to: .5e5s5w5n

Uses #TRIGGER for the balance messages to set a variable to 1 or 0, for other settings to know what your balance currently is. (1 is good to go)

Then your script for recognizing items would use something like this:

$item=your item here
#IF (@balance) {get $item}

As for recognizing the items and therefore when to stop.. make another variable with a list of everything you want to grab for pattern matching.

#TR {({@loot})} {#PAUSE;$item=%1;#IF (@balance) {get $item}}

#TR {balance restored message} {balance=1;#RESUME}
_________________
Discord: Shalimarwildcat
Reply with quote
chrissythepoet
Newbie


Joined: 19 Oct 2014
Posts: 2

PostPosted: Fri Oct 24, 2014 8:37 pm   
 
sorry I don't understand any of that....ugh this is so frustrating
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Sat Oct 25, 2014 4:39 am   
 
Well I don't mind helping, but we just need to take things one step at a time.
Have you gotten around to mapping your mud with the mapper yet?
Or turning your health or other vitals into a guage?

You are effectively wanting to make a bot of sorts.
That is advanced scripting and you need to work your way there.
It can be done.

I would suggest tackling a smaller problem for now and revisit this one when you feel more comfortable with the code.
Assuming you do want to understand the scripts you run.
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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