Page 1 of 1

Check skill cooldown in a makro

Posted: Thu Nov 08, 2012 10:31 am
by Ego95
Hi,
in siege wars I use a makro to take all my speed buffs after eachother. Some of them last only a few seconds so I want to get the maximum out of my makro.
This is my makro:

/use Spruchweber-Trank -- Spellweaver Potion
/wait 0.3
/script SetTitleRequest(530460); -- title: First Colonel (Magic Division) ; is used to activate the next skill
/wait 0.7
/script CastSpellByName("Wilder Sturm"); -- Mad Rush; skill of the title above
/wait 0.3
/script SetTitleRequest(530653); -- switch to title: Escape Artist
/wait 0.3
/use Trank: Gute Reise -- Potion: Godspeed
/wait 8
/use Trank: Grenzenloser Enthusiasmus -- Potion: Unbridled Enthusiasm

like you can see I use very short wait times between the actions, but in siege war my game laggs a lot and sometimes the script forgets to use a skill.
Is it possible to add something, that he does every action until it's really done? So he should "click" the skill Mad Rush until you have the buff or something like that. Is this possible??

Re: Check skill cooldown in a makro

Posted: Thu Nov 08, 2012 6:21 pm
by lisa
Yes but it would involve a lot more code which means it would probably end up being more than the 255 characters for a macro, so you might end up with 2 macros.

http://www.theromwiki.com/API:UnitBuff

Code: Select all

for i=1,25 do _,_,_,ID=UnitBuff("player",i)
I just used 1 to 25 as an example, if you find you usually have more than 25 buffs then you could increase the number, this will give you the buff ID and you can use that to check if you have the buff you want.

So basically you want to check if you have the buff before continuing with the code. I would probably use the buffID instead of the name as it will be shorter and use up less characters in the macro.

It will be tricky to implement but it is possible.

Re: Check skill cooldown in a makro

Posted: Fri Nov 09, 2012 5:28 pm
by Ego95

Code: Select all

for i=1,25 do _,_,_,ID=UnitBuff("player",i)
Already thanks. What does the _,_,_, mean? And where do I have to put the ID of the buff? I know less about writing makros as using the rom bot lol :D
so you might end up with 2 macros.
don't know if I'm right but if I would end up with 2 makros it would not work because in rom it's impossible to let a makro activate an other makro.

Re: Check skill cooldown in a makro

Posted: Fri Nov 09, 2012 6:02 pm
by lisa
a macro is basically LUA anyway, the same as rombot, it is just that you need to initiate the code differently, ie /script
AlterEgo95 wrote:don't know if I'm right but if I would end up with 2 makros it would not work because in rom it's impossible to let a makro activate an other makro.
yeah I meant you will need to have 2 macros and press a hotkey for both, if you can manage to get it all in 1 macro you are doing well =)
AlterEgo95 wrote:What does the _,_,_, mean?
I am pretty sure using _ will work but basically there are 4 values returned and you want the forth one, so the _,_,_, is to say that there are 3 values but you don't need them.
Alternatively you could do

Code: Select all

a,b,c,ID=UnitBuff("player",i) 
which would take up the same number of characters in the macro but it means that it will be storing the values of a,b,c which aren't needed.

A few ways to do it, you could add the ID's to a table or just add in each ID to the specific part of code.

Like I said macros are written in the same language as rombot so it is just a matter of doing up the code =)

example
in rombot

Code: Select all

table1 = {"fruit","lollies"} print(table1[1])
that would print to MM fruit

in a macro

Code: Select all

/script table1 = {"fruit","lollies"} sendSystemChat(table1[1])
That would print on rom chat screen fruit

With macros though each character is counted, even spaces so you would take out any unneccessary spaces and it could be like this

Code: Select all

/script table1={"fruit","lollies"} sendSystemChat(table1[1])
Max is 255 characters for each macro

Re: Check skill cooldown in a makro

Posted: Sat Nov 10, 2012 12:35 am
by rock5
You could always try using an addon to hold your own functions. Then just call the functions from the macro. Creating an addon for your functions is easy. Just create a folder in "Runes of Magic/interface/addons", lets call it "myfunctions". Then add a text file in it called "myfunctions.toc". In that file add the line "myfunctions.lua". Lastly, add a text file called "myfunctions.lua". Then in that file you can add all the functions you want. Here, I'll do it for you.
MyFunctions.7z
(460 Bytes) Downloaded 414 times
I also added a couple of functions for printing your buffs and made a function that returns true if you have a buff. Hope that helps.