Page 1 of 1

Checking Nature's Power

Posted: Tue Nov 13, 2012 11:22 am
by scithen
I was planning on doing some grinding on my druid, and after last night I learned that
I'll drain my NP very quickly with Earth Chain and Summon Sandstorm. I'd like to be able
to check it after leaving combat, but I've not yet figured out how to check it. I know it's
player.Nature, I'm just not sure how to use it. I know one of these files/posts I've read
had an example, I think using Urgent Heal, but I can't find it for the life of me.

Code: Select all

if ( player.Nature < 3 ) then
   player:cast("DRUID_RESTORE_LIFE");
   else
      if (player.Nature = 0 ) then
   player:cast("DRUID_CURING_SEED");
   player:cast("DRUID_RESTORE_LIFE");
   player:cast("DRUID_RESTORE_LIFE");
      end
end
Sorry in advance if I screwed that up horribly, the last time I did something like that was
when I was using making mob programs with ROM OLC for MUDs. Would that work? I've
got a lot of stuff to get done irl, so no time to test it right now.. but it looks like it'd work
in theory, assuming all of the syntaxes are right. Was planning on putting that in the
onLeaveCombat section, to maintain Nature's Power so Sandstorm and Earth Chain do
their full damage.

Re: Checking Nature's Power

Posted: Tue Nov 13, 2012 12:30 pm
by rock5
I don't think it's right. It says "if < 3 then cast 1 restore life else if == 0". It wont equal 0 because then it would be < 3 and it would do that part instead. Maybe it's supposed to be "> 3".

Re: Checking Nature's Power

Posted: Tue Nov 13, 2012 6:23 pm
by lisa

Code: Select all

 if (player.Nature = 0 ) then
needs to be

Code: Select all

 if (player.Nature == 0 ) then
as rock said though if Nature < 3 then it could be 0, so the "else if" check will never be 0

if Nature < 3 -- any number smaller than 3
else -- opposite of the previous if check, so it will be for 3 or greater.

Re: Checking Nature's Power

Posted: Wed Nov 14, 2012 3:49 am
by scithen
Ah, okay.. the basic idea was that if it was below 3, to just cast one spell for the
point, otherwise if I was empty, to cast those 3, since it was taking me 2 Earth Chains
and 1 Sandstorm to kill a group of mobs. I guess I'm better off just checking if it's
below a certain level, then restoring my NP that way.

Thanks.

Re: Checking Nature's Power

Posted: Wed Nov 14, 2012 4:19 am
by rock5
So what you want to do is start with "if nature == 0". So I think what you are saying is you want this

Code: Select all

if (player.Nature == 0 ) then
	player:cast("DRUID_CURING_SEED");
	player:cast("DRUID_RESTORE_LIFE");
	player:cast("DRUID_RESTORE_LIFE");
elseif ( player.Nature < 3 ) then
	player:cast("DRUID_RESTORE_LIFE");
end
I hope you realize, though, that if player.Nature = 1 then it will become only 2 after this which is not enough for your 3 skills. Maybe you could add a "if nature < 2".

Re: Checking Nature's Power

Posted: Wed Nov 14, 2012 9:17 am
by scithen
Yeah, that looks like what I wanted it to do, just had it backwards apparently. Though
your last comment has me curious. Is the onLeaveCombat code executed one time after
leaving comment? That would make sense, but this will be my first time doing anything
with it, aside from using your catchCavy script. Which I totally love, btw, it makes it
so much easier with those little buggers.

This will help with showing me how to use different variables and whatnot in the future,
but I think I'm going to just keep it simple and do a check for < 3. My gear and level
have gotten a little better, so fewer casts are needed.

Re: Checking Nature's Power

Posted: Wed Nov 14, 2012 5:19 pm
by lisa
just a little FYI thingy, it is better to use > as opposed to < because the < is an opener for < >

So you would just reverse their order,

Code: Select all

elseif ( 3 > player.Nature ) then
Code still does the exact same thing but no chance of the bot thinking the < is opening up a <Stuff> thingy