Properties not resetting

worshiprick

New member
If I try and script multiple gong->feather conversions, it always fails. The root of the problem is that the properties that track birdform uses don't reset if the "Welcome Back!" adventure is consumed in-script.

Here's the basic set-up:

- A CCS that looks for an appropriate feather-creation skill and uses it, if possible. The spleen feather is completely ignored, no other skills are ever used, just the elemental ones.

- The mother script adventures in a 100% combat area. It checks if a feather is assured by calling get_property("birdformSleaze") for example. If it is, it continues adventuring.

- The mother script also checks for bird form and an assured reward. If a reward is assured, but bird form is not active, we have that ugly situation where the next adventure is replaced by "Welcome Back." There doesn't appear to be a simple way to consume that non-adventure by itself, so I just allow that 16th adventure without birdform.

The problem is that the "Welcome Back" adventure doesn't reset the birdformSleaze property as long a the mother script is still running! It will adventure as many times as I let it, LONG after the feather has been received and in my inventory.

Your gut reaction might be that the script is doing something wrong, but if that's the case...why does the property still say 5 if I abort the script? after I restart mafia, or even my computer?. I haven't been in birdform for dozens of adventures, I script an adventure, I use the gCLI to adventure, I click the adventure button, I use the relay browser or the mini-browser for an adventure. Still shows the now-ancient value of 5 for whatever birdform skill uses I had scripted out.

Help?
 

slyz

Developer
Did you try using adv1()?
When you know the Form Of... Bird effect just ended, you can do something like:
PHP:
boolean trap = adv1( $location[ noob cave ],0,"" );
to make sure you get the Welcome Back adventure.

The way you describe things, that won't cut it though.
Why is your mother script checking if the feather is guaranteed in the first place? Why not keep using your CCS (which will not see any birdform skill available and just kill the mob)? Do you change locations once the feather is guaranteed?
 

worshiprick

New member
Did you try using adv1()?

Thanks for the point in the right direction! adv1() did exactly what I wanted =D Everything's working great now! Apparently using adv1() *does* allow the _birdformElement properties to be reset. You're a lifesaver :)

Why is your mother script checking if the feather is guaranteed in the first place? Why not keep using your CCS (which will not see any birdform skill available and just kill the mob)? Do you change locations once the feather is guaranteed?

No. I lied in the original post for the sake of simplification...I assumed nobody would care why I was doing what I was doing ;) But you asked, so here goes:

The truth is that I wrote my own feather ash script a while ago and I want to keep it modular. I can and do use it separate from the mother script and it uses these "_birdformX" properties to know if I wanted a spleen feather...if I bang a gong I'm expected to eat 5 of the correct bugs for the feather I want. Otherwise if there is no skill and there is no skills used, it starts slashing for the spleen feather. I didn't want that to complicate the question so I said I ignored spleen feathers.

Also, I won't be using this always in 100% combat areas so I have to assume that I can tell the difference between these situations:

- 14 turns of birdform left with no skill available (because I used all 5 bugs up last turn)
- 14 turns of birdform left with no skill available (because I want a spleen feather)
 
Top