General My /bcaa //if statement check my checks only...
Reply
My /bcaa //if statement check my checks only...
So I am playing a no-mana class and I have a /bcaa hot key to cast an item to "gather mana". The problem is, every character executes the /if command just fine but it always says their mana is 0 -- even when it is not. So they seem to be checking the mana of the person issuing the command and not their own mana.

Seems like the experts here would know the fix...

Thanks again.
_________________
for fun
Wed Feb 12, 2014 5:01 am
If you use melee, a holy or downshit would be easy.

shit0= /if ( ${Me.PctMana}<=18 && !${Me.Casting.ID} && !${Melee.Aggro} ) /casting "Orb of Spirits"|item

that should do the job.
Wed Feb 12, 2014 6:23 am
In front of the entire bcaa use /noparse
_________________
Sorvani
Wed Feb 12, 2014 7:04 am
Senior Project Member
If you use melee, a holy or downshit would be easy.

shit0= /if ( ${Me.PctMana}<=18 && !${Me.Casting.ID} && !${Melee.Aggro} ) /casting "Orb of Spirits"|item

that should do the job.


I like this, i wanted to do this. But i never figured out how i can prevent this from going off when the PC has died -- because then they would waste the item since they will get a rez shortly afterwards and then need to click it, but refresh timers would prevent it.
_________________
for fun
Wed Feb 12, 2014 12:19 pm
[syntax=mac]${FindItem[Orb of Spirits].Timer}==0
Macro
More +


that will check the timer on the item before use.
Wed Feb 12, 2014 1:24 pm
I heard that on many servers that timers dont work right. Last time i tried it on a unique, server specific item it never saw an accurate timer and it would recast over and over. I dont believe the code looked like yours though...
_________________
for fun
Wed Feb 12, 2014 1:31 pm
From the posts I take it your on THF and no, 99% of the timers on that server do not work.
So your options are slightly limited because of that.
If you use a macro then just declare a timer and varset after you use the item.
Wed Feb 12, 2014 6:15 pm
Listen to This Guy
Wouldn't surprise me. The health and mana orbs on THF usually return ready even if I just used it, according to the client.

I can test on a per item basis though.
Wed Feb 12, 2014 6:34 pm
Yes I am on THF.

I currently use modbot and mq2melee down/holy flags for pretty much all my automation.
_________________
for fun
Wed Feb 12, 2014 7:00 pm
Yeah I've been working on some stuff for THF recently and basically its not worth trusting if item timers are going to return correctly. Macro wise I pass everything through a custom sub that clicks once, sets a timer and I just check that for all future use.
Wed Feb 12, 2014 8:18 pm
Listen to This Guy
The 1.5 epic appear to have a valid timer

the health and mama orbs do not. I didn't have any other items to test right now.
Thu Feb 13, 2014 10:21 am
I have something like 200 clickies across all of my characters. Only a handful work as I would expect. I'm slowly working on a plugin and on a macro that targets just that server. Wouldn't hold my breath on me finishing it as I'm in no hurry to finish the macro and I am just learning C++ so the plugin is a 'work/learn/fail in progress.'
Thu Feb 13, 2014 1:11 pm
Listen to This Guy
Can you tell me about that custom sub to cast? Id love to automate/use some of these valuable clickies -- ifthey can be used with modbot that is.
_________________
for fun
Fri Feb 14, 2014 1:36 pm
I'm slowly working on a plugin and on a macro that targets just that server. Wouldn't hold my breath on me finishing it as I'm in no hurry to finish the macro and I am just learning C++ so the plugin is a 'work/learn/fail in progress.'

It might be easier to fix the code server side. Do the items with non-working timers have the same visual UI cooldown as items with working timers?


Can you tell me about that custom sub to cast? Id love to automate/use some of these valuable clickies -- ifthey can be used with modbot that is.


quickie example
Macro
More +
Sub ClickItemX
   /if (!Defined[Timer_ItemX]) /declare Timer_ItemX timer outer

   |this line clicks the item - use any suitable method (itemnotify, MQ2Cast, etc)

   | optional: detect if the item was actually used/cast to prevent false timer resets
   |    this may not be possible for all items

   /varset Timer_ItemX timer 60s
   | replace 60s with the actual recast time

/reutrn


The sub does two things:
click the item
reset the timer

Optional third thing:
detect an item cast - if an item with a 3min recast fails to cast, you don't really want to wait another 3min after a failed cast. Failed casts happen.

I included the /declare here but it's better to have it defined at the beginning of the main macro, with all the other declares.

Don't put other logic in the sub. You want all the stuff like range checks, line of sight checks, mana checks and HP checks to be checked before you decide to click an item.
Fri Feb 14, 2014 6:40 pm
Senior Project Member
It might be easier to fix the code server side. Do the items with non-working timers have the same visual UI cooldown as items with working timers?

Considering its not an issue on any other server I play on or my own server.
I do not think it is a EQEMU Source or MQ2 source issue but rather a THF server specific custom source issue.
Could be wrong there but I would assume I would have encountered this issue on EZ or PEQ or Akka's Funhouse or Loot Fest or Storm Haven.


As for the subs, first one is run on start up of the macro and uses /if (!${Defined[varname]}) /declare varname type scope default_value

Macro
More +
/if (!${Defined[RingfortheWild]}) /declare RingfortheWild timer global 0

Until I get other methods in place I am using global values for all timers and when I need to clear them I just hit the hotkey: /deletevar * global

use it in my macro something like:
/call Clickies "item name" "target type" "variable name" "timer value"
Target type info hasn't actually been tested so I'm excluding it from the example below.

Macro
More +

/call Clickies "Ring for the wild" "RingfortheWild" "3600"

Sub Clickies(string iName, string vName, int tValue)
| if statement here to check if the sub was called improper and exit
| Cant recall syntax but I do a finditem search and on a fail to find it just exits sub
| real sub also checks if vName and tValue are passed in and only tries to varset if both are present
        /casting "${iName}"|item
        /delay ${Int[${Math.Calc[(${FindItem[${iName}].CastTime}+.5)*10]}]}
        /varset ${vName} ${tValue}
/return


Wrote this from memory and its pysdo code due to my other machine running a program and I can't access the computer until it is done.
It should be enough for you to get an idea of how to write your own. If not I can post a full example late tomorrow.
The delay takes item cast time, even a value of 0, and adds 1/2 a second to it then converts it to MS.
I do all delay in MS and all timers in S
Fri Feb 14, 2014 11:02 pm
Listen to This Guy
General My /bcaa //if statement check my checks only...
Reply