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
wolfpad
Newbie


Joined: 02 May 2012
Posts: 4

PostPosted: Wed May 02, 2012 3:42 pm   

Requesting help to make a simple "target until..." script
 
Hi all,

I have a trigger when <playername> enters from
it targets player
casts spell
waits 3 seconds
targets player
casts spell
waits 3 seconds......about 20 times

My request for help is to try get it so that when "player is not hurt" or "monster has died" is displayed from the mud, get it to stop.

Also, is their a simple way to repeat the above 3 commands until that criteria is met?

Thanks.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Wed May 02, 2012 4:31 pm   
 
There's lots of ways. The simplest is probably to use an alarm that fires every 3 seconds - pattern *3 - and enable and disable it as required.
Reply with quote
shalimar
GURU


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

PostPosted: Wed May 02, 2012 4:41 pm   
 
This should do it, you will have to fill in one blank.
Code:
#TR {(%w) enters from} {
  target=%1
  Cast spell @target
}

#TR {message from spell} {
  #WAIT 3000
  cast spell @target
}

#TR {{player is not hurt|monster has died}} {target=""}
_________________
Discord: Shalimarwildcat
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed May 02, 2012 8:18 pm   
 
The third trigger should probably also turn off the second trigger, and the first trigger turn it on. Otherwise the second trigger will try to cast without a target.
Reply with quote
shalimar
GURU


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

PostPosted: Wed May 02, 2012 8:49 pm   
 
perhaps, but i dont see how the second trigger is ever going to misfire, so long as the spell is only ever cast by script. but to error proof it

Code:
#TR {message from spell} {
  #WAIT 3000
  #IF (@target) {cast spell @target }
}
_________________
Discord: Shalimarwildcat
Reply with quote
wolfpad
Newbie


Joined: 02 May 2012
Posts: 4

PostPosted: Mon May 07, 2012 9:44 am   
 
Thank you very much for your help. This has helped me create the script i was hoping for and also got the elements of error detection for when spells "fizzle" (small failure chance)
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