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.

MachineOfHate

Death Metal Holocaust

Posts: 63

Location: TEN-UH-SEE

Occupation: Network Administrator

  • Send private message

521

Monday, May 24th 2010, 2:51pm

One of the things I've wanted to change about my macro is casting Poison Protection if I'm poisoned and Holy Light Protection if I'm slow of rooted.

I tried this but it doesn't work:

Source code

1
  i=i+1; Skill[i] = { ['name'] = "Poison Protection",      ['use'] = (string.find(pbuffs,"poison")) }


What do I need to do to make it work?

Thanks
Started June 24, 2009 on Artemis.
Iamhell - 70/55 - W/wd + Panix - 70/70/70 W/r/s
The Superbad DPS Engine

jsalemi

Trainee

Posts: 133

Location: VA, USA

  • Send private message

522

Monday, May 24th 2010, 3:11pm

One thing I can see is that case matters, so you should have it check for "Poison", not "poison". I don't know if it'll find partial words, though, so you may have to use "Poisoned" for the debuff, rather than "Poison".

523

Monday, May 24th 2010, 5:42pm

Quoted from "Tigsman;277819"

@Six, is there a way to call up the skill table and see the names of the skills in it?


Yes. Add this function to your Lua file:

Source code

1
2
3
4
5
6
7
8
9
10
11
function TableShow(tbl, indent)
    indent = indent or 0
    for key,value in pairs(tbl) do
        if type(value) == "table" then
            Msg(string.rep(" ", indent)..tostring(key).." : (table)")
            TableShow(value, indent+3)
        else
            Msg(string.rep(" ", indent)..tostring(key).." = "..tostring(value))
        end
    end
end
Then use this macro:

Source code

1
/run TableShow(g_skill)

524

Monday, May 24th 2010, 5:53pm

Quoted from "Archime;277086"

Is there a problem with adding set skills to the script? i cant seem to get mine to work and i have no trouble with any of my other stuff. it says that the skill was not available. if anyone has added set skills and had no problems just let me know. thanks in advance. :)


I'm unfamiliar with using set skills. Do you know of a function to activate them via macro?

Edit: Nevermind, I think I found it: UseEquipmentItem(). Can someone test that for me and let me know if it works? It probably requires the slot number of the item as (the only?) parameter. Here are the slot numbers:

[0] = "HeadSlot"
[1] = "HandsSlot"
[2] = "FeetSlot"
[3] = "ChestSlot"
[4] = "LegsSlot"
[5] = "BackSlot"
[6] = "WaistSlot"
[7] = "ShoulderSlot"
[8] = "NecklaceSlot"
[9] = "AmmoSlot"
[10] = "RangedSlot"
[11] = "Ring0Slot"
[12] = "Ring1Slot"
[13] = "Earring0Slot"
[14] = "Earring1Slot"
[15] = "MainHandSlot"
[16] = "SecondaryHandSlot"
[17] = "ShieldSlot"


Let me know if that works and I can add that functionality to the combat engine.

525

Monday, May 24th 2010, 7:14pm

unfortunately that won't work, the item set skills are not used from the gear, you unlock the skill and you don't actually have to wear the gear to use the skill.

the only thing i can think of is that once you get the set skill you can drag it to a hot bar slot, then have the macro call the hot bar slot to use it (which for some reason i don't think is possible?)

until someone figures out the new interface... at the moment you cant even call up the set skill window from a hot key and you cant shift-click to put the set skills into chat links
----------------------------
Artemis - Vexxx [60/50] S/Wd
----------------------------

526

Tuesday, May 25th 2010, 12:11am

Hey Tig,

Regarding your W/K engine,

I think you need to add "Slash" after "Tactical Attack" to get the bleed affect. Also, I added "Survival Instinct" to the rotation for those Oh-No situations.

Tigsman

Trainee

Posts: 126

Location: ATL

Occupation: Fixing Things

  • Send private message

527

Tuesday, May 25th 2010, 12:23am

Quoted from "dharleyman;278208"

Hey Tig,

Regarding your W/K engine,

I think you need to add "Slash" after "Tactical Attack" to get the bleed affect. Also, I added "Survival Instinct" to the rotation for those Oh-No situations.

thanx but I prefer to manage slash seperately. I have slash hotkeyed next to the CE macro. so its easier for me, same for WW too. as for SI, yeah, still gotta put that in there, thanx!


T

Pagn93

Beginner

Posts: 0

Location: Holland, MI USA

Occupation: Contractor

  • Send private message

528

Tuesday, May 25th 2010, 2:23am

I've been working on a Warden/Druid script...liberally plagiarizing some of the work here in the process...so far this is what I have:

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
function WardenDruid(arg1)
      local Skill = {}
      local i = 0
      local mana = UnitMana("player")/UnitMaxMana("player")
      local friendly = (not UnitCanAttack("player","target"))
      local pet = UnitExists("playerpet")
      local pbuffs = BuffList("player")
      local tbuffs = BuffList("target")
      local dbuffs = DebuffList("player")
      local combat = GetPlayerCombatState()
       
--    if pet then
--        if (PctH("playerpet") <= 0.40) and CD("Recover") then
--            if UnitExists("target") then
--                FocusUnit(1,"target")
--                TargetUnit("playerpet")
--                CastSpellByName("Recover")
--                TargetUnit("focus1")
--                FocusUnit(1,"")
--            return
--
--            else
--                TargetUnit("playerpet")
--                CastSpellByName("Recover")
--            return
--
--            end

    i=i+1; Skill[i] = { ['name'] = "Elven Amulet", ['use'] = ((not friendly) and (PctH("player") <=.25) and (not string.find(pbuffs,"Elven Amulet"))) }
    i=i+1; Skill[i] = { ['name'] = "Mother Earth's Protection", ['use'] = ((not friendly) and (PctH("player") <=.20) and (not string.find(pbuffs,"Mother Earth's Protection"))) }
    i=i+1; Skill[i] = { ['name'] = "Mother Earth's Protection", ['use'] = ((friendly) and (PctH("target") <=.20) and (not string.find(tbuffs,"Mother Earth's Protection"))) }
    i=i+1; Skill[i] = { ['name'] = "Damage Transfer", ['use'] = ((not friendly) and (PctH("player") <=.15)) }
    i=i+1; Skill[i] = { ['name'] = "Antidote", ['use'] = (string.find(dbuffs,"Poisoned")) }
    i=i+1; Skill[i] = { ['name'] = "Elven Guidance", ['use'] = ((not friendly) and (PctM("player") <=.40)) }
    i=i+1; Skill[i] = { ['name'] = "Summon Spirit of the Oak", ['use'] = (not pet) and (not string.find(pbuffs,"Heart of the Oak") and (not combat)) }
    i=i+1; Skill[i] = { ['name'] = "Heart of the Oak", ['use'] = (not string.find(pbuffs,"Heart of the Oak")) }
    i=i+1; Skill[i] = { ['name'] = "Earth Spirit Essence", ['use'] = (not string.find(pbuffs,"Earth Spirit Essence") and (not combat)) }
    i=i+1; Skill[i] = { ['name'] = "Briar Shield", ['use'] = (not string.find(pbuffs,"Briar Shield") and (not combat)) }
    i=i+1; Skill[i] = { ['name'] = "Savage Blessing", ['use'] = (not string.find(pbuffs,"Savage Blessing")) }
    i=i+1; Skill[i] = { ['name'] = "Savage Blessing", ['use'] = (friendly and (not string.find(tbuffs,"Savage Blessing"))) }
    i=i+1; Skill[i] = { ['name'] = "Recover", ['use'] = ((not friendly) and (PctH("player") <= .70) and (not string.find(pbuffs,"Recover"))) }
    i=i+1; Skill[i] = { ['name'] = "Recover", ['use'] = (friendly and (PctH("target") <= .70) and (not string.find(tbuffs,"Recover"))) }
    i=i+1; Skill[i] = { ['name'] = "Thorny Vine", ['use'] = ((not friendly) and (not string.find(tbuffs,"Thorny Vine"))) }
    i=i+1; Skill[i] = { ['name'] = "Charged Chop", ['use'] = (not friendly) }
    i=i+1; Skill[i] = { ['name'] = "Power of the Wood Spirit", ['use'] = (not friendly) }

--    Posible use in arg2 for multiple mob situations
--    i=i+1; Skill[i] = { ['name'] = "Cross Chop", ['use'] = (not friendly)}
    
   MyCombat(Skill,arg1)
end


Edit: Had some syntax errors with the first version. Also could not get the pet heal if-then statement to work properly...it seemed to get caught in a loop and would not execute the rest of the script; it require another closing statement that appears to cause a fall-through.

I also had issues with the 'summon oak/heart of the oak' loop...if I could figure out how to check if SotO is already summoned it would be a little easier.

Just tested this version for basic use...the combat part works great, but I haven't had a chance to test all of the healing and "oh sh**!" loops.

mrmarc0001

Beginner

Posts: 3

Location: SF Bay Area

Occupation: Web Producer @ UCSF

  • Send private message

529

Tuesday, May 25th 2010, 6:41pm

Does SotO appear in your list of buffs? I deleted my warden long ago, so I can't recall off the top of my head. If so, then your entry in your function should work. Another thing you can do is to either control it using an arg or with a modifier key. A few posts back, I post how I use the shift key to cast Flame instead of all the other "common" combat spells/skills.

with arg (be sure to add arg2 to your function) it's recommended you reserve arg1 for the verbose switch:

Source code

1
i=i+1; Skill[i] = { "name" = "Power of the Wood Spirit", "use" = ((not friendly) and (arg2=="pet")) }


with modifier key:

Source code

1
2
3
local pressShift = IsShiftKeyDown()

i=i+1; Skill[i] { name = "Summon Spirit of the Oak", use = (pressShift and (not combat)) }


NOTE: Using ALT or CONTROL will only work if you press them and then click on the macro or if you assign a second key binding to that macro's slot on your action bar (e.g. for slot "2", I have it bound to "2" and "ALT+2")

530

Tuesday, May 25th 2010, 11:24pm

Quoted from "redcrux;278052"

unfortunately that won't work, the item set skills are not used from the gear, you unlock the skill and you don't actually have to wear the gear to use the skill.

the only thing i can think of is that once you get the set skill you can drag it to a hot bar slot, then have the macro call the hot bar slot to use it (which for some reason i don't think is possible?)

until someone figures out the new interface... at the moment you cant even call up the set skill window from a hot key and you cant shift-click to put the set skills into chat links


If you can drag the skill to your action bar, then just use an "Action: #" definition in your custom function to execute it.

Can someone test this for me please?

531

Tuesday, May 25th 2010, 11:30pm

Quoted from "Pagn93;278249"

Edit: Had some syntax errors with the first version. Also could not get the pet heal if-then statement to work properly...it seemed to get caught in a loop and would not execute the rest of the script; it require another closing statement that appears to cause a fall-through.


You're missing two closing "end" statements for the pet heal part. It should read like so:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
    if pet then
       if (PctH("playerpet") <= 0.40) and CD("Recover") then
          if UnitExists("target") then
             FocusUnit(1,"target")
             TargetUnit("playerpet")
             CastSpellByName("Recover")
             TargetUnit("focus1")
             FocusUnit(1,"")
             return
         else
            TargetUnit("playerpet")
            CastSpellByName("Recover")
            return
         end
      end
   end

mrmarc0001

Beginner

Posts: 3

Location: SF Bay Area

Occupation: Web Producer @ UCSF

  • Send private message

532

Tuesday, May 25th 2010, 11:36pm

Quoted from "Sixpax;278762"

You're missing two closing "end" statements for the pet heal part.


Easiest way to catch these types of errors is to look by your minimap for a flashing red icon. It will tell you what line it's finding syntax errors or is running into a problem. Helps to use a text editor that displays line numbers. I use and recommend Notepad++. It also makes it easier to keep track of parenthesis/brackets/etc...

Pagn93

Beginner

Posts: 0

Location: Holland, MI USA

Occupation: Contractor

  • Send private message

533

Wednesday, May 26th 2010, 1:27am

yeah, actually I use LuaEdit 3 and it caught those...problem was when I inserted them it caused the fall-through, though I think I had one in the wrong spot; I'll try yours to see if it makes a difference. I had to comment out the Elven Guidance loop and added a not combat clause to the HotO loop, though it still hangs when trying to cast with a different pet out. EG was looping when no pet existed and HotO was looping when any pet existed other than the SotO because the SotO summon loop already had a no combat clause.

I need to figure out RoM's API for identifying no pet, pet exist (pet=SotO/Oak Walker/Nature Crystal). Could make some nice if-then statements with that. One interesting use for that would be to check which pet then use that pet's special ability if whatever conditions are met, e.g. Magic Interference.


Edit: I just realized it from your example, Six, and can't believe I missed it...Three opening if-then statements require three closing statements at the end of the loop :eek: I kept trying to slip it in at the bottom of the lua file.

@Mrmarc0001...

Quoted from "mrmarc0001;278560"

Does SotO appear in your list of buffs? I deleted my warden long ago, so I can't recall off the top of my head. If so, then your entry in your function should work.


The skills book entry is "Summon Spirit of the Oak", etc. for the other pets, and there is no player buff to check for...it has to be in RoM's API to check for pet existence and type, as conjectured above, the problem is finding it and whether or not it's locked. We can already check for no pet but I've been having a hard time trying to figure out any other method.

ReEdit: Te pet heal script works great now but I've had to completely comment out the summon/cast HotO loop. That's okay though, the loop works but has a few issues that I'd rather not deal with while testing the rest of the mod...it's better to not have it in a combat script anyway. Right now I'm just testing the viability of the mod and how far I can take it; eventually I want to make separate ones for single/multi-mob combat, self/party buffs, and so on.

My goal isn't to make a 'spammer's delight' button, just to reduce the number of keybinds I need for different rotations/skill-sets. I already have macros for most of them, though the recent change in the API busted a few, but it's just so much more elegant to have those written into a function instead. Now if I could just figure out how to set up the functions as a separate addon and call them I'd be good to go. I'm also looking into making a GUI for the main script, maybe get it to LOD whenever you it the save button.


534

Wednesday, May 26th 2010, 4:31pm

Quoted from "Pagn93;278807"

I need to figure out RoM's API for identifying no pet, pet exist (pet=SotO/Oak Walker/Nature Crystal). Could make some nice if-then statements with that.


Well the the "no pet" part is easy:

Source code

1
2
3
if (not UnitExists("playerpet")) then
   Msg("I have no pet!!")
end
For the type of pet, when it exists, try this from a macro:

Source code

1
/run local petname = UnitName("playerpet"); Msg("My pet is: "..tostring(petname))

Pagn93

Beginner

Posts: 0

Location: Holland, MI USA

Occupation: Contractor

  • Send private message

535

Wednesday, May 26th 2010, 5:08pm

Quoted from "Sixpax;279052"

Well the the "no pet" part is easy:

Source code

1
2
3
if (not UnitExists("playerpet")) then
   Msg("I have no pet!!")
end
For the type of pet, when it exists, try this from a macro:

Source code

1
/run local petname = UnitName("playerpet"); Msg("My pet is: "..tostring(petname))



So essentially I could write in:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function OakHeart(arg1)
      local Skill = {}
      local i = 0
      local pet = UnitExists("playerpet")
      local pbuffs = BuffList("player")
      local combat = GetPlayerCombatState()
      local petname = UnitName("playerpet")


      i=i+1; Skill[i] = { ['name'] = "Summon Spirit of the Oak", ['use'] = ((not pet) or (not string.find(petname,"Spirit of the Oak")) and (not string.find(pbuffs,"Heart of the Oak")) and (not combat)) }
      i=i+1; Skill[i] = { ['name'] = "Heart of the Oak", ['use'] = ((not combat) and (string.find(petname,"Spirit of the Oak")) and (not string.find(pbuffs,"Heart of the Oak"))) }

      MyCombat(Skill,arg1)
end
Not quite sure if the petname variable is being used correctly, if it is I'm worried about returning a nil value on petname in the HotO line...give it a shot


536

Wednesday, May 26th 2010, 5:42pm

Quoted from "Pagn93;279083"

So essentially, after defining the petname variable, I could write in:

Source code

1
2
i=i+1; Skill[i] = { ['name'] = "Summon Spirit of the Oak", ['use'] = ((not pet) or (not string.find(petname,"Spirit of the Oak") and (not string.find(pbuffs,"Heart of the Oak") and (not combat)) }
i=i+1; Skill[i] = { ['name'] = "Heart of the Oak", ['use'] = ((not combat) and (petname,"Spirit of the Oak") and (not string.find(pbuffs,"Heart of the Oak"))) }
Not quite sure if the petname variable is being used correctly, if it is I'm worried about returning a nil value on petname in the HotO line...give it a shot


Very close (fixed below). I also added a way to make sure you won't have a problem when petname is :nil:.

Source code

1
2
3
4
    local petname = tostring(UnitName("playerpet"))

    i=i+1; Skill[i] = { ['name'] = "Summon Spirit of the Oak", ['use'] = ((petname ~= "Spirit of the Oak") and (not string.find(pbuffs,"Heart of the Oak")) and (not combat)) }
    i=i+1; Skill[i] = { ['name'] = "Heart of the Oak", ['use'] = ((not combat) and (petname == "Spirit of the Oak") and (not string.find(pbuffs,"Heart of the Oak"))) }
That *should* work. You probably don't want the "not combat" check in the "Heart of the Oak" line, but that's up to you.

Pagn93

Beginner

Posts: 0

Location: Holland, MI USA

Occupation: Contractor

  • Send private message

537

Wednesday, May 26th 2010, 6:04pm

I got it fixed, but yours is more elegant...

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function OakHeart(arg1)
      local Skill = {}
      local i = 0
      local pet = UnitExists("playerpet")
      local pbuffs = BuffList("player")
      local combat = GetPlayerCombatState()
      local petname = UnitName("playerpet")


      i=i+1; Skill[i] = { ['name'] = "Summon Spirit of the Oak", ['use'] = ((not pet) and (not string.find(pbuffs,"Heart of the Oak")) and (not combat)) }
      i=i+1; Skill[i] = { ['name'] = "Summon Spirit of the Oak", ['use'] = ((pet) and (not string.find(petname,"Spirit of the Oak")) and (not string.find(pbuffs,"Heart of the Oak")) and (not combat))     } 
      i=i+1; Skill[i] = { ['name'] = "Heart of the Oak", ['use'] = ((not combat) and (pet) and (string.find(petname,"Spirit of the Oak")) and (not string.find(pbuffs,"Heart of the Oak"))) }

      MyCombat(Skill,arg1)
end


Fully checked and working, thinking about adding a modifier to it for summoning the walker and/or crystal as well.


Pagn93

Beginner

Posts: 0

Location: Holland, MI USA

Occupation: Contractor

  • Send private message

538

Wednesday, May 26th 2010, 8:59pm

Here's another piece of code I'm testing now...this came from an old macro Novercalis posted on the forums:

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
26
27
28
function SpiritResummon(arg1)
    local Skill = {}
    local pet = UnitExists("playerpet")
    local combat = GetPlayerCombatState()
    local petname = UnitName("playerpet")
    local pspell,ptime,pelapsed = UnitCastingTime("target")

    if pet then
        if (PctH("playerpet") <= 0.40) and (string.find(petname,"Spirit of the Oak")) then
            if (combat) then
                if (pspell == nil) and (PctM("player") >= 0.15) then CastSpellByName("Summon Spirit of the Oak")
                    else     
                    if (ptime > 3.0) and (ptime - pelapsed <= 3.0) then
                    UsePetAction(7)
                return
                    else
                        if (PctH("playerpet") >0.40) then
                        UsePetAction(7)
                        UsePetAction(6)
                    return
                        end
                    end
                end
            end
        end
    end
    MyCombat(Skill,arg1)
end


539

Thursday, May 27th 2010, 9:17am

there are some functions with "pet" in it

http://www.theromwiki.com/List_of_Functions

but i am not sure wether this is for the warden

540

Thursday, May 27th 2010, 8:50pm

Hi Sixpax,

Can you tell me what line should be added to the S/K function to make sure autoshot is on as much as possible?

Ty much