|
wolfpad Newbie
Joined: 02 May 2012 Posts: 4
|
Posted: 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. |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: 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.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: 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.
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4692 Location: Pensacola, FL, USA
|
Posted: 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 |
|
|
|
wolfpad Newbie
Joined: 02 May 2012 Posts: 4
|
Posted: 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)
|
|
|
|
|
|