Author Topic: EV/NF Caster 2.0  (Read 23290 times)

0 Members and 1 Guest are viewing this topic.

Offline Crisis

  • Global Moderator
  • *
  • *
  • Posts: 3084
  • Activity:
    2.6%
  • Reputation Power: 42
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +566
  • Referrals: 2
    • View Profile
Re: EV/NF Caster 1.0
« Reply #15 on: August 30, 2020, 11:40:32 AM »
+1
It looks like your original account was lost in maybe a data wipe or something. I would suggest making a new thread for it and posting a link from this thread to your new one. You could also just edit the post you just made and upload a new version there and keep this thread going. It is only one page so if they don't bother to read down a few posts for the new script, it's their loss.

EDIT: I also found how to give a current member control of a thread created by a guest. I will PM that to Tidus and see if he can work some admin magic so you can update from the original thread.
« Last Edit: August 30, 2020, 11:46:59 AM by Crisis »

Offline Scotch_Tape

  • Jr. Member
  • **
  • Posts: 55
  • Activity:
    0%
  • Reputation Power: 1
  • Scotch_Tape has no influence.
  • Respect: +7
  • Referrals: 0
    • View Profile
Re: EV/NF Caster 2.0
« Reply #16 on: September 04, 2020, 12:50:15 PM »
+1
Thanks Crisis I've updated the script and added some new features.  I only tested on freeshard (Alexandria) .

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 490
  • Activity:
    0%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Respect: +283
  • Referrals: 3
    • View Profile
Re: EV/NF Caster 2.0
« Reply #17 on: September 04, 2020, 07:47:22 PM »
+1
Hey Scotch,
A couple observations:
Chooseskill has a 4 character parameter, so Spellweaving would be 'spel' - I didn't check if it really works as written.
I can't figure out a reason to lock the detect hidden skill, but it forces it to be locked.
Static wait times following casts regardless of your FCR. This makes it much slower casting that it must be.
The logic surrounding %manacost is not at all obvious:
 before casting save your current mana
 cast
 wait 2 seconds after targetting (can be 0 to 1.5 seconds depending on FCR instead!) so some mana regenerates
 set %manacost to how much was used - modified by how much has regenerated
 if you cast naturesfury (mana cost is 24 unmodified by LMC)
  set %manarequired to %manacost + 84% of %manacost
 if you cast EV (mana cost is 50 unmodified by LMC)
  set %manarequired to %manacost + 48% of %manacost

Those percentages would be different for each setup based on skills, stats and equipped items (meditation, focus, JOAT, intelligence, LMC and MR).
So 84% or 48% ... would change based on another setup to be close to being correct.

A more stable calculation would be to calculate suit LMC and apply it to the base mana cost for casting.

If you would like, I can share the routines I use to calculating suits and mana requirements.

Gaderian
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline Scotch_Tape

  • Jr. Member
  • **
  • Posts: 55
  • Activity:
    0%
  • Reputation Power: 1
  • Scotch_Tape has no influence.
  • Respect: +7
  • Referrals: 0
    • View Profile
Re: EV/NF Caster 2.0
« Reply #18 on: September 09, 2020, 06:35:45 AM »
-1
Hey Scotch,
A couple observations:
Chooseskill has a 4 character parameter, so Spellweaving would be 'spel' - I didn't check if it really works as written.
I can't figure out a reason to lock the detect hidden skill, but it forces it to be locked.
Static wait times following casts regardless of your FCR. This makes it much slower casting that it must be.
The logic surrounding %manacost is not at all obvious:
 before casting save your current mana
 cast
 wait 2 seconds after targetting (can be 0 to 1.5 seconds depending on FCR instead!) so some mana regenerates
 set %manacost to how much was used - modified by how much has regenerated
 if you cast naturesfury (mana cost is 24 unmodified by LMC)
  set %manarequired to %manacost + 84% of %manacost
 if you cast EV (mana cost is 50 unmodified by LMC)
  set %manarequired to %manacost + 48% of %manacost

Those percentages would be different for each setup based on skills, stats and equipped items (meditation, focus, JOAT, intelligence, LMC and MR).
So 84% or 48% ... would change based on another setup to be close to being correct.

A more stable calculation would be to calculate suit LMC and apply it to the base mana cost for casting.

If you would like, I can share the routines I use to calculating suits and mana requirements.

Gaderian

Chooseskill spell works the same as spel, but thanks I corrected it. 

I use the detect hidden skill to setup the location to cast, but I am assuming people don't want to train detect hidden so I just lock it if it's not already.  I tried setting #TARGCURS but I couldn't seem to get it to work on the ground even if I set the #TARGETKIND so I gave up.  Seems to be pretty dependable how I have it targeting. 

The Timers were just simple and don't require much thought.  If you've got subs built and I am smart enough to figure them out I'll add that, but the script was always very simple.  I understand your hatred with dumb timers so I'd give it an honest attempt to remove all those. 

As far as the %Mana Required I'll explain.

Code: [Select]
set %ManaCost #Mana
 event macro 15 %Cast
 target 4s
 set #LTARGETX %LTX
 set #LTARGETY %LTY
 set #LTARGETZ %LTZ
 set #lTARGETKIND 2
 event macro 22
  wait 2s
 }
 set %ManaCost %ManaCost - #Mana
  if %Cast = 606
    set %manarequired %manacost +  ( %manacost * 84 / 100 )
  if %Cast = 57
    set %manarequired %manacost +  ( %manacost * 48 / 100 )

This is only in the initial cast, so all it's doing is if you're casting EV it figures out how much that cost you then adds the cost to cast invisibility after cast.  Invisibility is a percentage of either spell, so if the initial cast is EV it calculates that plus a invis as the minimum mana the script will need if you are casting summons over and over. same with Natures Fury.

Not saying it's super accurate, but I thought this would be the easiest way to do it considering it's taking the mana cost directly from you casting the spell.  Even if it's got some crap timer code from my tests it seems to get close using different characters with different suits (one really good suit and one really crappy suit)  any slop only helps with adding buffer on for having to cast a heal or cure in there.

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 490
  • Activity:
    0%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Respect: +283
  • Referrals: 3
    • View Profile
Re: EV/NF Caster 2.0
« Reply #19 on: September 09, 2020, 11:39:26 PM »
-1
Hey Scotch,
I did not mean to come across as critical, just my observations trying to figure out what the code was doing.

I couldn't make sense out of the 48% and 84% mana calculations.
Nature's Fury costs 24 mana and 84% of that is approximately 20 mana.
EV costs 50 mana and 48% of that is 24 mana.

I couldn't figure out what the percentages were because I was assuming it was supposed to be the same mana because it would call the same follow up spell. No biggie.

My way I tend to do mana calculations has some calculations at script startup:
1) calculate LMC for equipped items
2) calculate required mana for each level as a group (for example: all spells that use 11 mana are part of a group)
3) assign the mana value for each spell
Now when I go to cast, I decide if I have enough mana to perform the cast by comparing the variable against current #mana.

You mentioned you were using detect hidden because the cast of the summon wasn't working. It looks like it is missing setting #LTARGETKIND - which would be different after casting either Heal or Cure before that.
Code: easyuo
  1. Sub Cast
  2. While #FOLLOWERS < %MaxFollowers && #MANA > %ManaRequired
  3.  {
  4.  If C in #CHARSTATUS
  5.   gosub Cure
  6.  If #HITS < %MaxHits
  7.   gosub Heal
  8.  event macro 15 %Cast
  9.   target 4s
  10.   If %CastAttempt < 2
  11.   {
  12.    set #LTARGETX %LTX
  13.    set #LTARGETY %LTY
  14.    set #LTARGETZ 2      ; <<<<----- looks like it is missing both setting #LTARGETZ correctly and not setting #LTARGETKIND
  15.   }
  16.   else
  17.   {
  18.    set #LTARGETX %TempLTX
  19.    set #LTARGETY %TempLTY
  20.    set #LTARGETZ %LTZ      ;   <<<<<------ This is much better, but happens after the initial attempt
  21.    set #lTARGETKIND 2       ;   <<<<<------ Something like this logic would be needed when %CastAttempt < 2 above
  22.   }
  23.   event macro 22
  24.   wait 1s
  25.   set %CastAttempt %CastAttempt + 1
  26.  }
  27.  set %CastAttempt 1
  28.  return

Gaderian


« Last Edit: September 10, 2020, 12:44:00 AM by Gaderian »
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline Scotch_Tape

  • Jr. Member
  • **
  • Posts: 55
  • Activity:
    0%
  • Reputation Power: 1
  • Scotch_Tape has no influence.
  • Respect: +7
  • Referrals: 0
    • View Profile
Re: EV/NF Caster 2.0
« Reply #20 on: September 10, 2020, 05:32:50 AM »
+1
Thanks Gaderian I fixed the issues with the Casting not including a findkind.  That was just a bad copy/paste.

I'm often reminded I went to public school to learn math.  I had the percentage wrong for Energy Vortex.  I found a shorter way of doing the math so that's fixed.

Not sure if you're understanding how lazy I am but I didn't plan on adding any other spells to the script so I don't really need to know all the magery spell mana cost and this is just one calculation no matter what suit or anything else you may or may not have.  It casts the spell and based off how much that costs your dude I simply determine the cost of an invisibility spell since it will always be a percentage of the cost of the EV or NF.  Going in and doing all the parsing on suit equipment and adding all that up just isn't the lazy way of doing this.  I can skip all that and use 1 line of code to figure it out.

I capture the first cast mana cost (EV or NF) and based off that multiply out what percentage your invisibility will cost and have that as a minimum required mana to actually cast another summon and an invisibility after.  It's my hope the slop with my dumb timers leaves enough extra mana on the end in the event you have to cast a heal or cure at some point.  That is not the most efficient way with the timers, but I keep casting EV's so I'm happy with it like that.   

Here is my new math for Summon + Invisibility Cost
Code: easyuo
  1. if %Cast = 606 ;Natures Fury
  2.     set %manarequired %manacost * 184 / 100
  3.   if %Cast = 57 ;Energy Vortex
  4.     set %manarequired %manacost * 140 / 100


Here is where I'm using that math for summon + Invisibility cost.
Code: easyuo
  1. Sub Cast
  2. While #FOLLOWERS < %MaxFollowers && #MANA > %ManaRequired ;<---- if I can't cast a summon and Invisibility after I don't cast and stay invis
  3.  {
  4.  If C in #CHARSTATUS
  5.   gosub Cure
  6.  If #HITS < %MaxHits
  7.   gosub Heal
  8.  event macro 15 %Cast
  9.   target 4s
  10.   If %CastAttempt < 2
  11.   {
  12.    set #LTARGETX %LTX
  13.    set #LTARGETY %LTY
  14.    set #LTARGETZ %LTZ
  15.    set #LTARGETKIND 2
  16.   }
  17.   else
  18.   {
  19.    set #LTARGETX %TempLTX
  20.    set #LTARGETY %TempLTY
  21.    set #LTARGETZ %LTZ
  22.    set #lTARGETKIND 2
  23.   }
  24.   event macro 22
  25.   wait 1s
  26.   set %CastAttempt %CastAttempt + 1
  27.  }
  28.  set %CastAttempt 1
  29.  return

Tags: