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


Joined: 24 Jan 2003
Posts: 11
Location: USA

PostPosted: Tue May 26, 2020 10:07 pm   

Trying to create Autoheal Trigger
 
My Syntax is as follows:

Hp: 2000/2000 Gp: 1595/1595

I am trying to create a trigger that will allow me to quickheal when my Hp drops below 600.

Example:

Class: Heal Trig
Pattern: Hp: 485/2000 Gp: 1200/1595
Command: quickheal

Can anyone assist me please?
Reply with quote
shalimar
GURU


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

PostPosted: Tue May 26, 2020 11:36 pm   
 
#TR {Hp: (%d)/%d} {#IF (%1<600) {quickheal}}
_________________
Discord: Shalimarwildcat
Reply with quote
Univarsity
Beginner


Joined: 24 Jan 2003
Posts: 11
Location: USA

PostPosted: Wed May 27, 2020 10:04 am   
 
shalimar wrote:
#TR {Hp: (%d)/%d} {#IF (%1<600) {quickheal}}


Thank you SO much! I wasn't even sure if anyone responded to these anymore.
If I wanted to make an additional trigger to piggyback off that and use Gp once it's more than 1500, could I also use the same trig sequence, but change the variable to 2?

#TR {Gp: (%d)/%d} {#IF (%2>1500) {quickheal}}
Reply with quote
shalimar
GURU


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

PostPosted: Wed May 27, 2020 1:37 pm   
 
If you had extended the pattern so that both are in the same trigger you can, otherwise, it would still be %1 as the first (captured) variable in the trigger

#TR {Hp: (%d)/%d Gp: (%d)/%d} {#IF ((%1<600) AND (%2>1500)) {quickheal}}
_________________
Discord: Shalimarwildcat
Reply with quote
Univarsity
Beginner


Joined: 24 Jan 2003
Posts: 11
Location: USA

PostPosted: Sun Jun 14, 2020 12:33 am   Attempting to create a teaching trigger
 
Thank you Shalimar. I have another question. I'm not sure how complicated this is, but I've seen someone do it before.

I am attempting to create a teaching trigger.

The syntax would be:
(player's name) tells you: teach me other.stamina
teach 40 levels of other.stamina to (player's name)

And if that player does not have enough experience, the game gives you an automatic response that states:
(Player's name) does not have enough experience to learn 40 levels of other.stamina. It would cost 60835396.
You could successfully teach 36 levels.

teach 36 levels of other.stamina to (player's name)
Reply with quote
shalimar
GURU


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

PostPosted: Sun Jun 14, 2020 12:29 pm   
 
#TR {(%w) tells you: teach me (%x)} {teach 40 levels of %2 to %1}
#COND {You could successfully teach (%d) levels.} {teach %t3 levels of %t2 to %t1} {within|param=3}
_________________
Discord: Shalimarwildcat
Reply with quote
Univarsity
Beginner


Joined: 24 Jan 2003
Posts: 11
Location: USA

PostPosted: Sun Jun 14, 2020 3:25 pm   
 
The second part, the conditions did not work. But the main trigger does. I'm wondering if I should alter it somehow. Maybe use:

#TR {(%w) tells you: teach me (%d) levels of (%x)} {teach %3 levels of %2 to %1}

Then make another trigger that would be:

#TR {(%w) does not have enough experience to learn (%d) levels of (%x). It would cost (%x). } {reply You will need %4 experience to train that amount.}

#TR {You could successfully teach (%d) levels.} {teach %1 levels of %2 to %3}



I don't know if that made any sense at all actually. I'm sorry, but I'm an extreme newb at this.
Reply with quote
shalimar
GURU


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

PostPosted: Sun Jun 14, 2020 7:10 pm   
 
I was guessing at the number of lines would be between the first message and the second.
Mainly to ensure the state of the trigger would automatically reset itself and not be waiting forever for a line that isn't coming.
If I underbid you can change the param on the condition accordingly.

I was using a state-based trigger to avoid having to store values in variables, because:

#TR {You could successfully teach (%d) levels.} {teach %1 levels of %2 to %3}

...is only saving one parameter: %1
There is no relevant %2 or %3 in this scenario.

You should be able to do this though:

#TR {(%w) does not have enough experience to learn %d levels of (%x). It would cost %d.$You could successfully teach (%d) levels.} {teach %3 levels of %2 to %1}
_________________
Discord: Shalimarwildcat
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