A bit help...

by Unknown

Back to Mechanic's Corner.

Unknown2006-07-20 17:17:58
Here's the VB script

Sub DEMESNE (eff)
setvariable "demesne_" & eff & "", "1"
if (getvariable("demesne_healspring") = 1 AND getvariable("demesne_deluge") = 0) Then
setvariable "demesne_deluge", "1"
send "aquacast deluge demesne"
elseif (getvariable("demesne_healspring") = 1 AND getvariable("demesne_needlerain") = 0) Then
setvariable "demesne_needlerain", "1"
send "aquacast needlerain demesne"
elseif (getvariable("demesne_healspring") = 1 AND getvariable("demesne_currents") = 0) Then
setvariable "demesne_currents", "1"
send "aquacast currents demesne"
elseif (getvariable("demesne_healspring") = 1 AND getvariable("demesne_whirlpool") = 0) Then
setvariable "demesne_whirlpool", "1"
send "aquacast whirlpool"
elseif (getvariable("demesne_healspring") = 1 AND getvariable("demesne_tsunami") = 0) Then
setvariable "demesne_tsunami", "1"
send "aquacast tsunami demesne"
elseif (getvariable("demesne_healspring") = 1 AND getvariable("demesne_typhoon") = 0) Then
setvariable "demesne_typhoon", "1"
send "aquacast typhoon demesne"
elseif (getvariable("demesne_healspring") = 1 AND getvariable("demesne_jellies") = 0) Then
setvariable "demesne_jellies", "1"
send "aquacast jellies demesne"
elseif (getvariable("demesne_healspring") = 1 AND getvariable("demesne_icefloe") = 0) Then
setvariable "demesne_icefloe", "1"
send "aquacast icefloe demesne"
end if
end sub

And this is what happens:

aquacast meld
You bend down and trace trails in the water with your fingers. The waters
sparkle with flecks of azure light and you feel this location meld into part of
your spirit.
3828h, 5690m, 5358e, 10p sSix-

/=========================\\
{ Equilibrium Recovered }
\\=========================/
3828h, 5690m, 5358e, 10p esSix-
aquacast healspring demesne
You reach out to your melded water and your hands glide in a sinuous dance
through the air.
The water here sparkles with a soft, scintillating glow.
3828h, 5490m, 5358e, 10p sSix-

/=========================\\
{ Equilibrium Recovered }
\\=========================/
3828h, 5740m, 5358e, 10p esSix-

Sparkling water splashes up over your body, healing your wounds.
aquacast deluge demesne
3828h, 5740m, 5358e, 10p esSix-
You reach out to your melded water and dramatically raise your hands above your
head, clawing at the sky.
Violent thunderclouds form above and release a tremendous deluge of rain,
causing a spectacular rise in the waters here.
3828h, 5340m, 5358e, 10p sSix-

/=========================\\
{ Equilibrium Recovered }
\\=========================/
3828h, 5340m, 5358e, 10p esSix-

Sparkling water splashes up over your body, healing your wounds.
aquacast needlerain demesne
3828h, 5627m, 5358e, 10p esSix-
You reach out to your melded water, then slowly raise your hands in the air and
then dramatically lower them.
Dark clouds rumble overhead, suddenly releasing a hard downpour of large, hot
raindrops.
3828h, 5327m, 5358e, 10p sSix-

/=========================\\
{ Equilibrium Recovered }
\\=========================/
3828h, 5327m, 5358e, 10p esSix-

Sparkling water splashes up over your body, healing your wounds.
aquacast currents demesne
3828h, 5614m, 5358e, 10p esSix-
You reach out to your melded water and make beckoning gestures with your hands.
Strong currents begin to tug at you.
aquacast whirlpool
3828h, 5314m, 5358e, 10p sSix-
You must regain equilibrium first.
concentrate
3828h, 5314m, 5358e, 10p sSix-
3828h, 5314m, 5358e, 10p sSix-

/=========================\\
{ Equilibrium Recovered }
\\=========================/
3828h, 5314m, 5358e, 10p esSix-

Sparkling water splashes up over your body, healing your wounds.
aquacast tsunami demesne
3828h, 5601m, 5358e, 10p esSix-
You reach out to your melded water with outstretched hands and create the motion
of severe waves in the air.
The sky darkens as high waves swell and begin to form crests.
aquacast typhoon demesne
3828h, 5101m, 5358e, 10p sSix-
You must regain equilibrium first.
concentrate
3828h, 5101m, 5358e, 10p sSix-
3828h, 5101m, 5358e, 10p sSix-

/=========================\\
{ Equilibrium Recovered }
\\=========================/
3828h, 5101m, 5358e, 10p esSix-

Sparkling water splashes up over your body, healing your wounds.
aquacast jellies demesne
3828h, 5388m, 5358e, 10p esSix-
You reach out to your melded water and crouch down, splashing in the water and
clucking your tongue against the roof of your mouth.
Tiny jellyfish form in the water, swimming around you like tiny underwater
aquacast icefloe demesne
flies.
3828h, 5238m, 5358e, 10p sSix-
You must regain equilibrium first.
concentrate
3828h, 5238m, 5358e, 10p sSix-
3828h, 5238m, 5358e, 10p sSix-

/=========================\\
{ Equilibrium Recovered }
\\=========================/

Now I don't know why that's happening, I mean, it's suppose to activate once the requirements are met yet along the way, it does two triggers. Anyone be able to help me? I'm trying to make the perfect AUTO DEMESNE EFFECTS for this Client and I don't know what went wrong sad.gif
Unknown2006-07-20 19:24:58
Umm... I'm either on completely thw wrong track, or I'm stating the obvious, but the code hasn't been told to wait for you to recover equilibrium, so it activates the commands before you have eq. It just goes once the one before it has been sent, regardless of wether you are ready or not.

Does MUSHclient have timestamps? It would be easier to diagnose that way.
Ceren2006-08-03 09:52:23
Trigger the casting message to set that effect's variable to 1, instead of setting it when you attempt the spell. It looks like what's going on is you try to cast more than one effect at the same time (due to triggering more than one effect message) and trick your system into thinking it cast both, and you end up skipping effects. If I were you I'd run this script on a timer to cut down on lag anyway. 10 seconds for demesne effects, right?

Also, it doesn't hurt, but I'm not sure why you check for healspring so many times in that script. Just elseif should be enough.
Unknown2006-08-03 13:42:00
As Ceren mentioned, you can easily make just one check for healspring:
QUOTE

if getvariable("demesne_healspring") = 1 Then
if getvariable("demesne_deluge") = 0 Then
setvariable "demesne_deluge", "1"
send "aquacast deluge demesne"
elseif getvariable("demesne_needlerain") = 0 Then
setvariable "demesne_needlerain", "1"
send "aquacast needlerain demesne"
elseif getvariable("demesne_currents") = 0 Then
setvariable "demesne_currents", "1"
send "aquacast currents demesne"
etc...


Second, that's very odd, because it works fine up until currents. Like Ceren said, set the variables for each effect on the successful casting message: that'll eliminate the problem of skipping effects. But as for why you're casting two at once... what triggers are calling the script? Make sure something isn't calling it twice. (Though... it looks from that log like you're triggering on this: "Sparkling water splashes up over your body, healing your wounds."? That's a neat way of timing it.)