|
mitbulls Newbie
Joined: 03 Feb 2005 Posts: 4
|
Posted: Thu Feb 03, 2005 1:19 am
Prompt Curing Question |
I use an adapted version of the Achaean Curing Project by Larkin for Lusternia. It's a prompt cure system, but it seems to be trying to cure some afflictions multiple times on some prompts. Here's an example: what the script should do is, when a pipe goes out, add it by number to a variable, then light the pipe from that variable when equilibrium is regained. Here's what actually happens:
Your pipe has gone cold and dark.
Queuing 75515 for lighting
You have recovered equilibrium
1989h, 3472m, 2520e, 10p ex-
1671h, 3472m, 2520e, 10p ex-light 75515
light 75515
light 75515
abjure cosmicfire 2590
You carefully light your treasured pipe until it is smoking nicely.
Pipe 75515 successfully lit
1671h, 3472m, 2520e, 10p ex-
That pipe is already lit and burning nicely.
Pipe already lit
1671h, 3472m, 2520e, 10p ex-
That pipe is already lit and burning nicely.
Pipe already lit
1671h, 3472m, 2520e, 10p ex-
This happens with every type of cure, so it's obviously running through the entire prompt_cure script multiple times. I tried setting a timer on it to only run once within every 400 milliseconds or something, but that freezes the cliet for 400 milliseconds after every prompt, making it too slow to be worthwhile. I also tried using a variable and toggling it between 0 and 1 at each prompt, and only running the prompt_cure script when the variable was = 1, but even then the same problem of multiple cures came up.
Sorry for the long post, but does anybody have any ideas what the problem might be and how to get around it? Thanks! |
|
|
|
Pega Magician
Joined: 08 Jan 2001 Posts: 341 Location: Singapore
|
Posted: Thu Feb 03, 2005 1:32 pm |
I think it is triggering multiple times on your prompts.
Quote: |
You have recovered equilibrium
1989h, 3472m, 2520e, 10p ex-
1671h, 3472m, 2520e, 10p ex-light 75515
light 75515
light 75515 |
The trigger was probably set to trigger on Newline as well as Prompt.
I think it triggered on Newline here, '1989h, 3472m, 2520e, 10p ex-',
and it triggered on both Prompt and Newline here '1671h, 3472m, 2520e, 10p ex-',
and here '1671h, 3472m, 2520e, 10p ex-light 75515' respectively.
One solution could be to give that trigger an ID to turn it on and off, for when it is needed and when it has done its work, ie. #T+ TriggerID and #T- TriggerID. |
|
|
|
mitbulls Newbie
Joined: 03 Feb 2005 Posts: 4
|
Posted: Thu Feb 03, 2005 2:50 pm |
It would probably work to turn the trigger on and off for when it is doing it's job, but I haven't yet figured out when to enable or disable it. If I disable it as soon as the affliction is recognized, it will never cure. If I disable it when it begins the curing process, it's already too late and will be run twice anyway. I also tried disabling it on every run-through until it reaches the cure, but then it shuts off permanently at any prompt when no affliction is found. I also tried adding another alias that runs at the end of the script to re-enable the trigger, but then I'm back to the original problem of it setting off on each new line.
|
|
|
|
Pega Magician
Joined: 08 Jan 2001 Posts: 341 Location: Singapore
|
Posted: Thu Feb 03, 2005 3:19 pm |
You say it still runs twice?
That could be due to the problem with dual triggering Triggers.
They trigger on Prompt and then trigger again on the same line on Newline.
I suggest you duplicate that prompt trigger into two triggers, one for Prompt only and one for Newline only.
Place both of these triggers in the same class and make each trigger disable their class when triggered. Enable that class whenever you regain equilibrium.
Hope that works. |
|
|
|
|
|
|
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
|
|