Item recast timer check

Third party software discussion goes here.
conradd
Posts: 381

Item recast timer check

Post#1 » Tue Apr 16, 2013 5:27 pm

I'm trying to check if a spell can be recast from an item.

For the example, I'm using the item "Valtron's Necklace of Wonder" with the spell buff "Divine Blessing", casting time 0.5s, recast type 2 : 10m

I've tried :
/echo ${FindItem[Valtron's Necklace of Wonder].TimerReady} => always 0

/echo ${FindItem[Valtron's Necklace of Wonder].Timer} => always 0

/echo ${Cast.Ready[Valtron's Necklace of Wonder]} => always TRUE

/echo ${Cast.Ready[Divine Blessing]} => always FALSE

I'm using MQ2Emu UF StormHaven compile.

Anyone's got an idea ?
"Shorties will rule the world !"
[CLR] Conradd <Drachenkinder>

Noren
Posts: 1053

Re: Item recast timer check

Post#2 » Wed Apr 17, 2013 12:56 am

I noticed the same thing for quite a few items. If I had to guess, timer data was set two different ways over a widespread amount of clickies. For one group of clickies you have them:

Successfully greying out and correctly reporting their remaining recast time to the (Underfoot) client. These items include all epic 1.5/2.0s, Tier 8 bps, and a select few donor weapons & random items.

The other group of items does not grey out, does not report the remaining cast time, and will simply report to the client that it's always ready but if you attempt to click and it's not truly ready it will yield a timer not met message.


Gameplay is fine, they all work great, so Conradd I can only recommend that you use /echo ${FindItem[Valtron's Necklace of Wonder].Timer} for the items that report their timer correctly and set up manual timers for the rest. An example of a manual timer, for those that don't know, would be:

Code: Select all

|---Declare the timer---------
/declare DonorWeaponTimer   timer   outer   0

|---Usage Scenario would be--
/if (${Defined[DonorWeapon]} && ${DonorWeaponTimer}==0) /dosomething

|---After a successful cast you can restart the timer with something like
/echo Clicking ${DonorWeapon}
/call cast ${DonorWeapon} item
/if (!${Macro.Return.Equal[CAST_INTERRUPTED]}) {
    /varset DonorWeaponTimer 81
}

|-Timers are in deciseconds for those new to mq2 timers-|

conradd
Posts: 381

Re: Item recast timer check

Post#3 » Wed Apr 17, 2013 12:42 pm

Is it a lack in the item database that you should warn the GM of ?
"Shorties will rule the world !"
[CLR] Conradd <Drachenkinder>

trongstad@gmail.com
Posts: 55

Re: Item recast timer check

Post#4 » Sun Jun 30, 2013 3:14 am

I'm not sure if anyone has tried Noren's post but I was unable to make it work correctly. Anytime I had an interrupt it would automatically change my recast time to 81 which is basically chain cast. I wanted to time my Mage Donor weapon to recast when it was available.

See below for my script

Code: Select all

Sub main

/declare DonorWeaponTimer   timer   outer   300

:loop
 /doevents

/if (${DonorWeaponTimer}==0) {
 /call click
}

/goto :loop
/return


Sub click

/casting 1395|item
/if (!${Macro.Return.Equal[CAST_INTERRUPTED]}) {
    /varset DonorWeaponTimer 81
}

/return
/goto :loop
/endmacro


Any help would be greatly appreciated

User avatar
Nilbus
Posts: 1258

Re: Item recast timer check

Post#5 » Sun Jun 30, 2013 5:03 am

If it's for the version 1 mage donor, can do it as a downs hit with mq2melee.

downflag(X)=1
downshit(X)=/if (${Me.Pet.ID}>0 && ${Me.PetBuff[Elemental Power]}==NULL && !${Me.Moving} && !${Me.Casting.ID}) /casting "Staff of Elements" -targetid|${Me.Pet.ID}
Nodyin-Nilbus-Pockit-Tiah-Rakas- Funeral
Likeatruck-Khaltos-Nilbie-Ziknaf-Prathun-Missus
Elidor
Youme-Yumme-Blazingtide-Sublin-Lissanda-Darmok
Djarik-Ikat-Nerys-Ometi-Tarana-Biln

I know way too much random stuff.

User avatar
Grey
Posts: 1101

Re: Item recast timer check

Post#6 » Sun Jun 30, 2013 6:22 am

For items where you can not obtain the timer info you can just declare a global and varset each time you use it and then incorporate your check against that global.
One thing with globals is you do not need a macro running or can change macros as long as the global variable is a unique name.

I use a .cfg file with a set of very unique global variable names that I want to be able to use outside of macros and also to use on MQ2HUD.

Start up my game and /loadcfg globalvar
In the case where I use a click I just /varset what I need and go from there.
http://www.macroquest2.com/wiki/index.php/CFG_Files

Noren
Posts: 1053

Re: Item recast timer check

Post#7 » Sun Jun 30, 2013 5:14 pm

trongstad@gmail.com wrote:I'm not sure if anyone has tried Noren's post but I was unable to make it work correctly. Anytime I had an interrupt it would automatically change my recast time to 81 which is basically chain cast. I wanted to time my Mage Donor weapon to recast when it was available.

See below for my script

Code: Select all

Sub main

/declare DonorWeaponTimer   timer   outer   300

:loop
 /doevents

/if (${DonorWeaponTimer}==0) {
 /call click
}

/goto :loop
/return


Sub click

/casting 1395|item
/if (!${Macro.Return.Equal[CAST_INTERRUPTED]}) {
    /varset DonorWeaponTimer 81
}

/return
/goto :loop
/endmacro


Any help would be greatly appreciated

${Macro.Return.Equal[CAST_INTERRUPTED]} is a returned value from Spell Routines (if you use that .inc file). If you don't use Spell Routines, then my little snippet of code won't work. Instead you can follow Grey's advice (which is the best advice in this thread so far) or simply change your macro to this:

Sub main

/declare DonorWeaponTimer timer outer 300
^declared a 30 second timer that begins counting down the moment the macro begins^

:loop
/doevents

/if (${DonorWeaponTimer}==0) {
/call click
}
/delay 1
/goto :loop

Sub click
/casting 1395|item -maxtries|3
/if (${Cast.Result.NotEqual[CAST_INTERRUPTED]}) {
^MQ2Cast returns the result of the cast attempt in a variable called ${Cast.Result}, so I've run a string comparison on that to determine if it was interrupted or not. There are many more checks you could do, like oor etc that are valuable. This is just a learning exercise. Also, I don't use MQ2Cast so I can't comment on if this tests working or not.^
/varset DonorWeaponTimer 3000
^I bumped the timer from 8.1 seconds to 300 seconds^
}

/return

/endmacro

User avatar
Shin Noir
Posts: 380

Re: Item recast timer check

Post#8 » Tue Jul 09, 2013 4:09 am

I do this in my mq2melee stuff.

Code: Select all

downshit7=/multiline ; /if (!${Defined[sune]}) /declare sune timer outer 0 ; /if (${sune}==0) /casting "Sune's Vambraces of Eternal Life";  /if (${sune}==0) /varset sune 60s


This creates a timer that goes off every 60 seconds summoning sune.

Adding a timer helps keeps things sane.
ImageImage

Return to “Third party software”

Who is online

Users browsing this forum: No registered users and 2 guests