Macro spell casting problems

Rooster

New member
Joined
Jul 10, 2010
Messages
510
Reaction score
3
Points
0
Its only been the past few days I have been fiddling with using some macros again. Is it a MQ2Cast/Spell_routines that would cause the following...

[06/10/2013 17:40:39] Attempting to cast Call Skeleton Throng Rk. II on a penumbral coldain | 1710
[06/10/2013 17:40:56] Spell cast unsuccessfull: CAST_NOTREADY

[06/10/2013 17:41:36] Attempting to cast Bora's Swift Sickness on a frost giant wolf tamer | 1631
[06/10/2013 17:41:53] Spell cast unsuccessfull: CAST_NOTREADY

This happens quite often, randomly on which spell it is as well as I can sit on the necros screen and watch it fail. The spells are always ready. In my macro I only have 4 spells in the combat set to cast. 1 pet swarm and 3 swift dots. Rarely does it ever get past the swarm/bora.


Just need to work out which tree to bark up to try and fix this, as it is a eq hot key will do better dps :|
 
hard to tell without seeing the macro and whichever include you are using. depends on what is /called and #included and how its checked. MQ2Cast isnt the same as MQ2Cast_routines.inc which isnt the same as spell_routines.inc which isnt the same as other spell_routines.inc
 
Lol, as I suspected... a bit beyond my own personal trouble shooting then :eek:

I am using dev's premium bots/includes.

It is doing the same thing with the other class macro, so will just shoot him a support msg on his site.

Thanks for the quick reply Pete.
 
Did you try rebooting your PC to ensure a clean start on everything? This looks like it might be the MQ2Cast bug where sometimes MQ2Cast just gets hung up and every spell that it tries to cast will take a few seconds and then return the CAST_NOTREADY cast result, even though the spell may actually be ready.

If you tried that and it still isn't working, send me your entire log file and INI file.
 
Will test that later today Dev, I did restart MQ2 and tried to make sure the inc's were up to date etc.

Was going to try a complete clean MQ2 setup though as well, to make sure it wasn't a setting I made somewhere also.
 
Try /plugin mq2cast unload , followed by /plugin mq2cast. That usually fixes it for me if mq2cast hangs up, but this doesn't look like that situation, if it was mq2cast hanging up, you wouldn't be able to cast any spell or get that following error you just did.

Your issue might be because of the recast time of Call Skeleton Throng Rk. II, which is 18 secs. Any spell with over 10 sec recast time, doesn't work well with dev's bots because I think there is some hardcode in MQ2Cast, that times out any spell over 10 sec recast, you will get the pell cast unsuccessfull: CAST_NOTREADY message. You have to either have some filler spells between those 18 secs, or set your recast dly in the ini to over 18 secs (not < or =18 secs).
 
Last edited:
Thanks for the tips!

I did try lots of recast delays, but when the delays are almost double the normal recast. It's a bit beyond the point. Also, adding more spells didn't help much as it still just hangs on the spell it decides it can't cast, long enough for the mob to be dead of <HP min.

I have the same issues with beastlord also, most issues with him actually.

What I can say I notice when using the macro with debug mode, I see lots of the merc casting stuff pop into the mq2 window. Is this normal? It spams out the spells the merc cast as Global Casting blah blah but only after the beastlord has cast a spell/attempted to cast a spell and had a result returned by MQ2Cast

But the main problem for me in all this is that the CAST_NOTREADY delays the macro casting for a good 15 seconds... which is a big chunk of dps.

I have had a dig through the MQ2Cast source and the various spell_routines that are used by the macro. But it is beyond my trouble shooting capacity to actually narrow down the part of the code that handles this specifically or any ability to pin point if there is a value which will change the way it behaves in deciding the spell isn't ready to cast and to move along.

Never had this issue some time ago when I had it all set up originally.
 
Looking at the MQ2Cast source (from macroquest2.com, assuming it's the same here?), it is hard coded to abort after trying to cast for 12 seconds. It will be sitting in a loop (in the MQ2Cast plugin) until that 12 seconds is up however. It loos like however if MQ2CastTimer is working, and you have it loaded, it will auto abort any spell that will take longer than 3 seconds to be ready.

This delay is defined at the top of the file:
Code:
#define       DELAY_CAST    12000

Relevant bits marked in red below:
Code:
void CastHandle() {
 
  // we got the casting request cookies, request immobilize/memorize if needed.
  if(CastF==FLAG_REQUEST) {
    if(DEBUGGING)
      WriteChatf("[%d] MQ2Cast:[Casting]: Request.",(long)GetTickCount());
    CastF=FLAG_PROGRESS1;
    if(StopF==FLAG_COMPLETE) StopF=DONE_SUCCESS;
    if(StopF==FLAG_COMPLETE && CastT>100 && !BardClass()) StopF=FLAG_REQUEST;
    if(MemoF!=FLAG_COMPLETE) MemoHandle();
    else if(StopF!=FLAG_COMPLETE) StopHandle();
  }
 
  // waiting on the casting results to take actions.
  if(CastF==FLAG_PROGRESS3 && CastingE!=DONE_PROGRESS) {
    CastF=FLAG_PROGRESS4;
    if(CastR) CastR--;
    if(CastR) {
      if((CastingE==CAST_SUCCESS && CastW!=RECAST_LAND) || 
         (CastingE==CAST_COLLAPSE) || 
         (CastingE==CAST_FIZZLE) || 
         (CastingE==CAST_INTERRUPTED) || 
         (CastingE==CAST_RECOVER) || 
         (CastingE==CAST_RESIST)) {
        if(DEBUGGING)
          WriteChatf("[%d] MQ2Cast:[Casting]: AutoRecast [%d].",(long)GetTickCount(),CastingE);
        if(CastW!=RECAST_ZERO && !TargC) TargC=(pTarget)?((PSPAWNINFO)pTarget)->SpawnID:0;
        [COLOR="Red"]CastM=(long)GetTickCount()+DELAY_CAST;[/COLOR]
        CastF=FLAG_REQUEST;
      }
    }
  }
 
  // casting is over, grab latest casting results and exit.
  if(CastF==FLAG_PROGRESS4) {
    if(CastE>CastingE) CastingE=CastE;
    CastF=FLAG_COMPLETE;
  } 
 
  // evaluate if we are taking too long, or immobilize/memorize event failed.
  if(CastF!=FLAG_COMPLETE) {
    [COLOR="Red"]if(StopE==DONE_ABORTED || MemoE==DONE_ABORTED || (long)GetTickCount()>CastM) {[/COLOR]
      WriteChatf("[%d] MQ2Cast:[Casting]: Aborting! (%s)",(long)GetTickCount(), StopE==DONE_ABORTED?"StopE":(MemoE==DONE_ABORTED?"MemoE":"CastM")); 
      CastF=FLAG_PROGRESS4; 
      CastE=CAST_NOTREADY; 
    } 
  }
 
  // waiting for opportunity to start casting, end if conditions not favorables.
  if(CastF==FLAG_PROGRESS1) {
    if(pCastingWnd && (PCSIDLWND)pCastingWnd->dShow) return; // casting going on
    CastingC=CastS->ID;

    CastF=FLAG_PROGRESS4;
    if(TargC && (!pTarget || (pTarget && ((PSPAWNINFO)pTarget)->SpawnID!=TargC))) {
      if(CastW==RECAST_DEAD)      CastE=CAST_NOTARGET;
      else if(CastW==RECAST_LAND) CastE=CAST_ABORTED;
    } else if(Invisible && GetCharInfo()->pSpawn->HideMode) { CastE=CAST_INVISIBLE;
    } else if(GetCharInfo()->Stunned)                       { CastE=CAST_STUNNED;
    } else if(StopF!=FLAG_COMPLETE || MemoF!=FLAG_COMPLETE) { CastF=FLAG_PROGRESS1;
    } else {
      [COLOR="Red"]long TimeReady=SpellTimer(CastK,CastI);    // get estimate time before it's ready.
      if(TimeReady>3000)  CastE=CAST_NOTREADY;   // if estimate higher then 3 seconds aborts.[/COLOR]
      else if(!TimeReady) CastF=FLAG_PROGRESS2;  // estimate says it's ready so cast it
      else CastF=FLAG_PROGRESS1;                 // otherwise give it some time to be ready.
    }
  }
 
  // we got the final approbation to cast, so lets do it.
  if(CastF==FLAG_PROGRESS2) {
    if(DEBUGGING)
      WriteChatf("[%d] MQ2Cast:[Casting]: Cast.",(long)GetTickCount());
    Success(CastS);
    ItemHandle(true);
    CastF=FLAG_PROGRESS3;
    CastE=DONE_PROGRESS;
    CastingT=(long)GetTickCount()+CastT+250+(pConnection->Last)*4;
    CastingE=DONE_PROGRESS;
    CastingC=CastS->ID;
    if((long)GetCharInfo()->pSpawn->CastingData.SpellID>0) {
      CastingX=(CastingE<CAST_SUCCESS)?CAST_SUCCESS:CastingE;
      CastingL=CastingC;
      if(CastK==TYPE_SPELL)     Execute("/multiline ; /stopsong ; /cast \"%s\"",CastN);
      else if(CastK==TYPE_ITEM) {
          if(!BardBeta) {
            if (!stricmp(CastN,"Fellowship Registration Insignia")) 
                Execute("/multiline ; /stopsong ; /nomodkey /itemnotify ${FindItem[=%s].InvSlot} rightmouseup",CastN);
            else 
                Execute("/multiline ; /stopsong ; /nomodkey /cast item \"%s\"",CastN);
          }
          else {
            if (!stricmp(CastN,"Fellowship Registration Insignia")) 
                Execute("/nomodkey /itemnotify ${FindItem[=%s].InvSlot} rightmouseup",CastN);
            else 
                Execute("/nomodkey /cast item \"%s\"",CastN);
          }
      }
      else if(CastK==TYPE_ALT) {
          if(!BardBeta)
            Execute("/multiline ; /stopsong ; /alt activate %d",((PALTABILITY)CastI)->ID);
          else
            Execute("/alt activate %d",((PALTABILITY)CastI)->ID);
      }
    } else {
      if(CastK==TYPE_SPELL)     Cast("\"%s\"",CastN);
      else if(CastK==TYPE_ITEM) {
          if (!stricmp(CastN,"Fellowship Registration Insignia")) Execute("/nomodkey /itemnotify ${FindItem[=%s].InvSlot} rightmouseup",CastN);
          else Execute("/nomodkey /cast item \"%s\"",CastN);
      }
      else if(CastK==TYPE_ALT)  Execute("/alt activate %d",((PALTABILITY)CastI)->ID);
    }
  }
}

You can try loading MQ2CastTimer and see if it works and will let it auto recognize if a spell is going to take longer than 3 seconds to be ready. However, if you do not have your INI configured properly that means it will pretty much never cast long recast spells because it will always immediately abort them.

You need to have spells that have a long recast after memming set to their own spell GEM and make sure nothing is configured in that spell GEM to cause them to be unmemed to avoid this problem.
 
Last edited:
No other change but enabling MQ2CastTimer and it worked much better.

Not one single CAST_NOTREADY, thank you for all the help guys.

When I get around to it, I am still going to try change the hard coded values see if it breaks anything. One less plugin to load and UI object is better for me lol