You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


This forum will be permanently shut down on Friday 13.07.2018
Please copy or save all important information from old forum before they will be deactivated
We have moved to new board. https://forum.runesofmagic.gameforge.com/Come join us.

karmakarma

Master Procrastinator

  • "karmakarma" started this thread

Posts: 442

Location: Miami

Occupation: Diesel Mechanic (semi-trucks/tractor-trailers)

  • Send private message

1

Thursday, April 18th 2013, 3:54am

buff macro

hoping someone can help me shorten this macro more,

im trying to put all of this into a macro but i just cant seem to make it short enough...


/run TargetNearestFriend() if UnitIsPlayer("target") then break end end
/run for i=1,99 do if UnitBuff("target",i)=="Grace of Life" then break elseif(i==99) then UseSkill(4,10) end end
/wait .8
/run for i=1,99 do if UnitBuff("target",i)=="Amplified Attack" then break elseif(i==99) then UseSkill(4,16) end end


the UseSkill(x,x) is the shortest way i know of to cast the buffs that im checking for, also i can put all the checks and buffs in there but my main issue is that i cant get the target macro in there as well which is what im hoping one of you can help me accomplish this..

the class combo is pretty much all P/X except knight
LifeFire - Eternal - Grimdal
Mage/Priest/Knight
82/82/82

Give a macro, Take a Macro
Lifefire's Collections

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

2

Thursday, April 18th 2013, 5:54am

Look at the DIYCE v2 thread, learn how to make a custom lua file, and then look into the buffparty function I have in diyce. Honestly, that is the only way to shorten (and speed up) what you are trying to do.

I added that into DIYCE to give priests and druids a reason to want DIYCE.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

3

Thursday, April 18th 2013, 6:06am

Though it is possible to shorten it more, you'd be better off converting things to some custom slash commands. Check out my macro guide here for more details.

But basically, create a new "addon". Lets called is commands.

In this addon's folder, create a text file called commands.toc and add this to this file:

Source code

1
commands.lua


Now create the file commands.lua and add the following to this file:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
SLASH_DoIt1 = "/doit"
SlashCmdList['DoIt'] = function(ebox, param)
    if param=="part1" then
        TargetNearestFriend()
        if not UnitIsPlayer("target") then
            for i=1,100 do
                n = UnitBuff("target", i)
                if n=="Grace of Life" then 
                    break
                end
            end
            UseSkill(4,10)
        end        
    elseif param=="part2" then
        if not UnitIsPlayer("target") then
            for i=1,100 do
                n = UnitBuff("target", i)
                if n=="Amplified Attack" then 
                    break
                end
            end
            UseSkill(4,16)            
        end        
    end
end


With all this in place, your macro becomes:

Source code

1
2
3
/doit part1
/wait .8
/doit part2
2013... The year from hell....

karmakarma

Master Procrastinator

  • "karmakarma" started this thread

Posts: 442

Location: Miami

Occupation: Diesel Mechanic (semi-trucks/tractor-trailers)

  • Send private message

4

Thursday, April 18th 2013, 9:57pm

i thank you for your help peryl, the code didnt work as intended at first but after modifying it i got it to work perfectly for what i needed...

i stole the word "ChkBuff" cuz it better describes what i want it to do

also removed the TargetNearestFriend() as well, that way i can use the slash command with either a "self" target macro or a "friend" target macro...

Edited code became this

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
SLASH_ChkBuff1 = "/ChkBuff"
SlashCmdList['ChkBuff'] = function(ebox, param)
    if param=="Grace" then
        if UnitIsPlayer("target") then
	    for i=1,100 do
                if(UnitBuff("target", i)=="Grace of Life") then 
                    break
                elseif(i==100) then
		    UseSkill(4,10)
		end
	    end
        end        
    elseif param=="Amp" then
        if UnitIsPlayer("target") then
            for i=1,100 do
                if(UnitBuff("target", i)=="Amplified Attack") then 
                    break
                elseif(i==100) then
		    UseSkill(4,16)                
	        end
            end           
        end        
    end
end


thank you for getting me on the correct path once again
LifeFire - Eternal - Grimdal
Mage/Priest/Knight
82/82/82

Give a macro, Take a Macro
Lifefire's Collections

5

Thursday, April 18th 2013, 10:11pm

Since length is no longer a concern, you might want to replace the UseSkill(x,x) commands with a CastSpellByName. That would keep you from having to rely on spells having to be in certain places in your skill list.

karmakarma

Master Procrastinator

  • "karmakarma" started this thread

Posts: 442

Location: Miami

Occupation: Diesel Mechanic (semi-trucks/tractor-trailers)

  • Send private message

6

Friday, April 19th 2013, 12:01am

already did, the code is WAAAYYYY bigger than when i started but still working just as great
LifeFire - Eternal - Grimdal
Mage/Priest/Knight
82/82/82

Give a macro, Take a Macro
Lifefire's Collections

karmakarma

Master Procrastinator

  • "karmakarma" started this thread

Posts: 442

Location: Miami

Occupation: Diesel Mechanic (semi-trucks/tractor-trailers)

  • Send private message

7

Friday, April 19th 2013, 2:47pm

Quoted from "ghostwolf82;598384"

Look at the DIYCE v2 thread, learn how to make a custom lua file, and then look into the buffparty function I have in diyce. Honestly, that is the only way to shorten (and speed up) what you are trying to do.

I added that into DIYCE to give priests and druids a reason to want DIYCE.



No offense to diyce users but it really takes all the fun and skill out of playing the game when all you have to do is spam the same button repeatedly and let the script do what's best for you given certain situations in all aspects of any kind of combat. Diyce is one addon I will never bring myself to install. Don't get me wrong I'm sure it has great features in it but its just not for me. Thank you anyways though for your idea I appreciate the time you took to try and help me out.
LifeFire - Eternal - Grimdal
Mage/Priest/Knight
82/82/82

Give a macro, Take a Macro
Lifefire's Collections

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

8

Friday, April 19th 2013, 6:40pm

A perusal of the code in DIYCE is what I was suggesting. By totally ignoring something that could very much help you, you are limiting yourself on the source of ideas that may bring you to exactly what you are trying to do in a much more efficient manner. The peice of code I was referring to was the BuffParty function, which will do what you are looking for AND keep track of how long it has been since you last cast that buff.

Quoted from "karmakarma;598503"

No offense to diyce users but it really takes all the fun and skill out of playing the game when all you have to do is spam the same button repeatedly and let the script do what's best for you

Also, the function you have set up here does exactly this. So, yeah...

karmakarma

Master Procrastinator

  • "karmakarma" started this thread

Posts: 442

Location: Miami

Occupation: Diesel Mechanic (semi-trucks/tractor-trailers)

  • Send private message

9

Friday, April 19th 2013, 9:48pm

yea thats my mistake then, i thought you were suggesting i install and use diyce to use the code i need, it was a reading error on my part, now that you mention it though i tried using bufflefttime and i like how it gives the remaining time on a certain buff in seconds, however is there some way to clean up the time so its not so long

for example...

original time would be..... 1765.80923464432

is it possible to make it rounded to.... 1765 or 1765.8
LifeFire - Eternal - Grimdal
Mage/Priest/Knight
82/82/82

Give a macro, Take a Macro
Lifefire's Collections

ghostwolf82

Professional

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

10

Saturday, April 20th 2013, 8:42pm

What are you wanting to get the time like that for? I always just checked if there was 45 seconds left on the buff, if so recast it.

karmakarma

Master Procrastinator

  • "karmakarma" started this thread

Posts: 442

Location: Miami

Occupation: Diesel Mechanic (semi-trucks/tractor-trailers)

  • Send private message

11

Sunday, April 21st 2013, 12:43am

i was going to have it post time left on buff but i already set it to just auto rebuff by time left like you did, i finished it last night.
LifeFire - Eternal - Grimdal
Mage/Priest/Knight
82/82/82

Give a macro, Take a Macro
Lifefire's Collections

karmakarma

Master Procrastinator

  • "karmakarma" started this thread

Posts: 442

Location: Miami

Occupation: Diesel Mechanic (semi-trucks/tractor-trailers)

  • Send private message

12

Sunday, April 21st 2013, 8:40pm

EDIT: nvm post=nil, figured out what i needed
LifeFire - Eternal - Grimdal
Mage/Priest/Knight
82/82/82

Give a macro, Take a Macro
Lifefire's Collections