Plugin Idea: MQ2DaysLeft

HardOne

Rawk On!
Joined
Sep 27, 2008
Messages
344
Reaction score
1
Points
0
I'd make it myself if I knew how.

Create a plugin that will give you a warning that your running out of all access days. This way you don't forget to click a Krono.

Maybe even have a setting that can be toggled to auto click a Krono if you have one.

Thoughts?
 
It shows the number of days left in your inventory window, who doesn't check their inventory window?
 
People with multiple accounts that have characters they never play manually.
 
So how would the addon let you know an account is running out of time, it would have to show up on the screen that you apparently never check, yeah?
 
No reason it couldn't just text or email you its under 5 days. Could probably even have it auto use a krono on last day.
 
So how would the addon let you know an account is running out of time, it would have to show up on the screen that you apparently never check, yeah?

I never said the screen was not checked, just where the Day's Left is listed.

I would have it make a sound, or send a BC message or something at set intervals once you hit the 5 day mark. Then as you approach the final day the frequency of the sound or message will increase.

As mentioned by someone else too, can even have it just use the Krono for you.
 
Is there a TLO for Gold days left? If so, this could be easily done many ways without needing a plugin.
 
Is there a TLO for Gold days left? If so, this could be easily done many ways without needing a plugin.

If there is, I can make something else that will work. I do not know of one though.

I do believe it would be All Access Days Left
 
You can probably still do some of this without a plugin using cfg files if it is displayed as text on the inventory window, and is accessible to MQ2. You just have to find out what that text label is. For example, something like this in the zoned.cfg file:

Code:
/if (${Window[InventoryWnd].Child[INV_GoldDaysLeft].Text} < 6) /bca Attention, The account ${MacroQuest.LoginName} has 5 or less days remaining on gold status.

If the days left label in the inventory window is named INV_GoldDaysLeft.. then that would send a /bca message every time you zoned when you had less than 6 (so 5 or less) days remaining.

Although.. it may require opening the inventory window first to get an accurate reading. If so, just /window InventoryWnd open before the /if in the zoned.cfg file.

Also to note, InventoryWnd might need to be InventoryWindow, I don't recall for sure offhand and don't have any of my files in front of me here at work to check hehe.
 
Last edited:
I think this is the piece you are looking for:

/echo ${Window[InventoryWindow].Child[IW_SubscriptionTime}.Text}

[MQ2] All Access Days Left: 42
[MQ2] All Access Days Left: 0

So would be pretty easy to do same thing I did for getting the FREE SC macro.
 
Last edited:
I think this is the piece you are looking for:

/echo ${Window[InventoryWindow].Child[IW_SubscriptionTime}.Text}

[MQ2] All Access Days Left: 42
[MQ2] All Access Days Left: 0

So would be pretty easy to do same thing I did for getting the FREE SC macro.

Code:
/echo ${Window[InventoryWindow].Child[IW_SubscriptionTime[COLOR="Red"]][/COLOR].Text}

You had that character wrong.. has to be a close bracket to encapsulate the child window name.
 
So if I echo:
Code:
/echo ${Window[InventoryWindow].Child[IW_SubscriptionTime].Text}

It Returns: All Access Days Left: ###

How do you reliably pull out only the ###, then check if it's less than 6?
 
its a string so you can use .Mid[23,5] to pull out days left.

/echo ${Window[InventoryWindow].Child[IW_SubscriptionTime].Text.Mid[23,5]}
 
Now this will only work for the default UI, custom UI's may not have the subscription information in the same spot. Seem's to work for right now for me though.
 
Now this will only work for the default UI, custom UI's may not have the subscription information in the same spot. Seem's to work for right now for me though.

Correct ... if using a custom UI... if they label the element name something other than "IW_SubscriptionTime" for that piece .. then it will not work for you.

Second thing.... if using it in a macro .. I think you would need to define this variable pullback as a int type ... to be able to use it for any mathcalc functions.

So if declaring the variable in the main sub it would be:

Code:
/declare SomeVariableName  int outer ${Window[InventoryWindow].Child[IW_SubscriptionTime].Text.Mid[23,5]}

Even though you are pulling back a text element.. you are defining it for your usage in the macro as an integer .. to be able to use it in a varcalc or mathcalc function.
 
Last edited:
Second thing.... if using it in a macro .. I think you would need to define this variable pullback as a int type ... to be able to use it for any mathcalc functions.

So if declaring the variable in the main sub it would be:

Code:
/declare SomeVariableName  int outer ${Window[InventoryWindow].Child[IW_SubscriptionTime].Text.Mid[23,5]}

Even though you are pulling back a text element.. you are defining it for your usage in the macro as an integer .. to be able to use it in a varcalc or mathcalc function.

In most programming languages, yes you'd have to typecast a string to an int before using it in calculations. In a macro however you do not have to do this. The way the parser works, it parses MQ2 variables inner to outer, so if you have for instance:

Code:
${Math.Calc[${Window[InventoryWindow].Child[IW_SubscriptionTime].Text.Mid[23,5]} - 1]}

And lets say you have 6 days left, the parser is going to first parse the ${Window[]} variable to return 6, and then it's going to look at ${Math.Calc[6-1]}. The same happens with /varcalc. The calc function really doesn't know anything about what types of variables were used to produce the final algorithm.

The types of variables come into play more so when doing /varset or /varcalc on them than when using them as variables. For example if you /varcalc intVariable 1 + 1.5, it's going to automatically convert it to 2 instead of 2.5 because it knows intVariable is supposed to be an integer.
 
well, notwithstanding relying on custom/default UI, the data is available to the client, so a plugin or addon is easily done. What do you guys propose, a plugin, or a TLO, or both?

htw