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.

621

Monday, June 7th 2010, 6:58pm

Awesome dude, you da man! Works like a charm.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function RogueKnight(arg1)
   local Skill = {}
   local i = 0
   local enermy = UnitCanAttack("player", "target")
   local energy = UnitMana("player")
   local mana = UnitSkill("player")
   local tbuffs = BuffList("target")

   i=i+1;Skill[i]={name="Action:24(Dis)",use=((enermy) and (BuffTimeLeft("target", "Disarmament") < 6) and (not string.find(tbuffs,"Disarmament IV"))) }
   i=i+1;Skill[i]={name="Action:23(WA)", use=((enermy) and (string.find(tbuffs,"Grievous Wound"))) }
   i=i+1;Skill[i]={name="Action:22(LB)", use=((enermy) and (string.find(tbuffs,"Bleed"))) }
   i=i+1;Skill[i]={name="Action:21(SS)", use=((enermy) and (energy > 85)) }
   i=i+1;Skill[i]={name="Action:30(Atk)",use=((enermy)) }

   MyCombat(Skill,arg1)
end


Tanks will want to look at this for Holy Strike as it means they can splice it in rather than spam, works really well.

622

Monday, June 7th 2010, 8:42pm

adding msg to party chat when engaging blood arrow

Again thanks Six, tiggs and everyone who has contributed to this post. I was wanting to see if there was a way to add a message to party chat when I used blood arrow so the healers didn't freak out. I guess it could be party chat or /s but could it be incorporated into my lua file instead of a macro on the action bar? ANy help would be appreciated

thx :)

623

Tuesday, June 8th 2010, 6:18pm

This is my offering back from what Ive read above.
My Rogue is only level 11 atm but I plan to save my macro every 15 levels so they are relevant if I level another char.
Eg. Ill end up with RogueMage15 RogueMage30 RogueMage45 RogueMage55 (This will prob vary on the amount of skill changes as I level)

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
function RogueMage15(arg1)
   local Skill = {}
   local i = 0
   local energy = UnitMana("player")
   local mana = UnitSkill("player")
   local friendly = (not UnitCanAttack("player","target"))
   local pbuffs = BuffList("player")
   local tbuffs = BuffList("target")
   local combat = GetPlayerCombatState()
   local level = UnitLevel("target") - UnitLevel("player")
--Change the 9 to whatever number you have Shadowstab on the action bar
   local melee = GetActionUsable(9)
   local tdead = UnitIsDeadOrGhost("target")

--Autoloot
    i=i+1; Skill[i] = { ['name'] = "Attack",                ['use'] = (tdead) }

--Buff if +1 levels
    i=i+1; Skill[i] = { ['name'] = "Assassins Rage",        ['use'] = ((not string.find(pbuffs,"Assassins Rage")) and (level >=1)) }

--Use pots if needed
    i=i+1; Skill[i] = { ['name'] = "Action: 21(HP Pot)",    ['use'] = ((PctH("player") < .3) and combat) }
    i=i+1; Skill[i] = { ['name'] = "Action: 22(MP Pot)",    ['use'] = ((PctM("player") < .2) and (PctH("player") > .6)) }
    i=i+1; Skill[i] = { ['name'] = "Action: 22(MP Pot)",    ['use'] = ((PctM("player") < .5) and (not combat)) }

--Opener
    i=i+1; Skill[i] = { ['name'] = "Fireball",              ['use'] = ((not friendly) and (mana >=60)) }
    i=i+1; Skill[i] = { ['name'] = "Lightning",             ['use'] = ((not friendly) and (not melee) and (not string.find(tbuffs,"Lightning"))) }

--Check range (Stops running to target and allows time for 2nd fireball)
    if melee then
--This may cause a problem if your behind them (Suggestion? Without passing arg2.)
        i=i+1; Skill[i] = { ['name'] = "Blind Stab",        ['use'] = ((not friendly) and (energy >=20)) }

--Melee combat sequence (Backwards for logic)
        i=i+1; Skill[i] = { ['name'] = "Wound Attack",      ['use'] = ((not friendly) and (energy >=35) and (string.find(tbuffs,"Bleed") and (string.find(tbuffs,"Grievous Wound")))) }
        i=i+1; Skill[i] = { ['name'] = "Low Blow",          ['use'] = ((not friendly) and (energy >=30) and (string.find(tbuffs,"Bleed")) and (not string.find(tbuffs,"Grievous Wound"))) }
        i=i+1; Skill[i] = { ['name'] = "Shadowstab",        ['use'] = ((not friendly) and (energy >=20) and (not string.find(tbuffs,"Bleed"))) }
    end
   
    MyCombat(Skill,arg1)
end
Hope this helps any new users... Keep posting your custom builds back we need new ideas/classes to help everyone :)

I would love feedback on the above if you can see any improvements... (Oh I should add I play with a druid so you might need to tweak the HP pot usage, so your HP stays a bit higher on its own)

nemecis

Trainee

Posts: 115

Location: Canada

  • Send private message

624

Wednesday, June 9th 2010, 12:51am

thanks for trying, but I keep getting "Skill not available: Power"

tried adding % before the -, tried adding the scrip Vael offered, tried just "Power", just "Power Build" ... nadda :P


nvm ... added % to the buff check only and it worked. tnks again!

625

Wednesday, June 9th 2010, 8:19am

Hmm...I'm having a bit of an issue. It seems that UnitHealth is returning health as a percentage, not as raw HP. I tried the little script on the wiki page just to see what I got, and it returned 100 (as I was at max health.)

The function is

Source code

1
SendChatMessage("My health is " .. UnitHealth("player"),"SAY")
When I took damage, it returned numbers that were equivalent to the % of my HP remaining.

Anyone know if there's a function that returns actual raw HP numbers? I wanted to make my mage only cast Fireball when the enemy was below a certain HP number (basically just to finish mobs off.)

Any thoughts?

626

Wednesday, June 9th 2010, 5:03pm

Quoted from "Vaeliorin;286110"

Anyone know if there's a function that returns actual raw HP numbers? I wanted to make my mage only cast Fireball when the enemy was below a certain HP number (basically just to finish mobs off.)


For whatever reason they keep changing the output of that function and one other (see below). It used to be that UnitHealth() would return the actual health number. Then they added UnitChangeHealth() and modified UnitHealth() to return a whole % value, but it only applied to mobs, not players. So you still used UnitHealth() for actual player health and UnitChangeHealth() for actual mob health. Now I noticed that theromwiki.com has been updated and describes UnitChangeHealth() as a health change since the last "tick" (2 sec interval).

So basically, I have no idea anymore. Try using UnitChangeHealth("target") and see what value you get back.

627

Wednesday, June 9th 2010, 5:07pm

Quoted from "nemecis;285931"

nvm ... added % to the buff check only and it worked. tnks again!


My bad, I should have clarified that I meant in the string.find() operation. You still need the exact name of the skill in the "name" definition because that uses a RoM API function (CastSpellByName) to cast it, not a Lua function.

628

Wednesday, June 9th 2010, 6:33pm

I was wondering if there is a way of incorporating the Rogue/Warrior weapon switch into a macro?

I saw Sixpax posted a macro in another thread, but I'm not sure how that would work in the DIYCE...

mrmarc0001

Beginner

Posts: 3

Location: SF Bay Area

Occupation: Web Producer @ UCSF

  • Send private message

629

Wednesday, June 9th 2010, 7:05pm

Quoted from "Provoke;286290"

I was wondering if there is a way of incorporating the Rogue/Warrior weapon switch into a macro?

I saw Sixpax posted a macro in another thread, but I'm not sure how that would work in the DIYCE...


You would have those macros on your skillbar and call them like you would a Potion or Food Item...or something like this (untested and unsure how to return something true)...this is off the dome right now, so could be mistaken

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
local enemy = UnitCanAttack("player", "target")
local energy = UnitMana("player")
local mainhandname = GetInventoryItemDurable("player", 15)

local useDagger
if mainhandname ~= "DAGGERNAMEHERE" then
	PickupEquipmentItem(16)
	PickupEquipmentItem(15)
else
	useDagger = true
end

i=i+1; Skill[i] = { name = "Shadowstab", use = (enemy and (useDagger) and (energy >= 20) and (not string.find(tbuffs, "Bleed"))) }


If you keep it separate from your DIYCE function, you can try something like

Source code

1
i=i+1; Skill[i] = { name = "Action: 9 (Switch to Dagger)",	use =	(enemy) }

630

Wednesday, June 9th 2010, 7:20pm

Quoted from "Provoke;286290"

I was wondering if there is a way of incorporating the Rogue/Warrior weapon switch into a macro?

I saw Sixpax posted a macro in another thread, but I'm not sure how that would work in the DIYCE...


That code has always been scary to me because it has to move the weapon to your pointer to do the swap, and what happens if there's an error or you get disconnected right when the weapon swap is happening? Is there a chance you'll lose your weapon?

I can't really incorporate that into the engine because I believe there needs to be a slight delay between the weapon swap and the Shadowstab cast, and then another when swapping back. The only way to do delays is with the /wait command in a macro.

631

Wednesday, June 9th 2010, 7:22pm

Quoted from "mrmarc0001;286320"

You would have those macros on your skillbar and call them like you would a Potion or Food Item...


Unfortunately that won't work because the function I'm using with "Action:" definitions (UseAction) can't call a macro.

lokanu

Beginner

Posts: 14

Location: Classified.

  • Send private message

632

Thursday, June 10th 2010, 9:23am

Quoted from "Sixpax;286336"

That code has always been scary to me because it has to move the weapon to your pointer to do the swap, and what happens if there's an error or you get disconnected right when the weapon swap is happening? Is there a chance you'll lose your weapon?

I can't really incorporate that into the engine because I believe there needs to be a slight delay between the weapon swap and the Shadowstab cast, and then another when swapping back. The only way to do delays is with the /wait command in a macro.


You don't actually lose an item in that case. When you click an item, it remains in place but gets grayed out indicating it's locked until you're done with it. I've had many items remain gray (not "unlock") on odd occasions and restarting actually fixes them.

--

I'm actually curious if there is any method of checking the new Item-Set Skills similar to your normal skills for getting the cooldown and/or other info. The only way I can find atm is by placing the Item-Set Skill on your action bar and GetActionUsable or GetActionInfo. But that's not very user-friendly if I decide to change the location of the icon later. Has anyone found anything yet?

633

Thursday, June 10th 2010, 10:12am

Quoted from "Sixpax;286222"

For whatever reason they keep changing the output of that function and one other (see below). It used to be that UnitHealth() would return the actual health number. Then they added UnitChangeHealth() and modified UnitHealth() to return a whole % value, but it only applied to mobs, not players. So you still used UnitHealth() for actual player health and UnitChangeHealth() for actual mob health. Now I noticed that theromwiki.com has been updated and describes UnitChangeHealth() as a health change since the last "tick" (2 sec interval).

So basically, I have no idea anymore. Try using UnitChangeHealth("target") and see what value you get back.

I tried it. It seems to work as intended (giving you the change since the last time it ran, apparently), although when I did UnitChangeHealth("player") it first returned 5, then my max health, even though I'd been at max health both times I tried it.

I just decided to set it a < 10% at the moment, and I'll just have to update it as monsters get more health.

634

Thursday, June 10th 2010, 1:20pm

Quoted from "Vaeliorin;286724"

I tried it. It seems to work as intended (giving you the change since the last time it ran, apparently), although when I did UnitChangeHealth("player") it first returned 5, then my max health, even though I'd been at max health both times I tried it.

I just decided to set it a < 10% at the moment, and I'll just have to update it as monsters get more health.


Do addons like PBinfo still return the actual health numbers for monsters?

Tigsman

Trainee

Posts: 126

Location: ATL

Occupation: Fixing Things

  • Send private message

635

Thursday, June 10th 2010, 1:22pm

Quoted from "Sixpax;286780"

Do addons like PBinfo still return the actual health numbers for monsters?

yes, if you were able to view the mob before fight starts so it knows what its starting health was.


T

636

Thursday, June 10th 2010, 1:28pm

Quoted from "Tigsman;286781"

yes, if you were able to view the mob before fight starts so it knows what its starting health was.


T


So somehow when the mob is full health they are able to get the actual number but not once its hurt. I wonder if that coincides with what Vaeliorin saw where it returned a health difference one time and actual health another time.

Tigsman

Trainee

Posts: 126

Location: ATL

Occupation: Fixing Things

  • Send private message

637

Thursday, June 10th 2010, 1:35pm

i know if i have not targeted a mob that a group is attacking BEFORE they start, i get % health. But if I do target before they start attacking (when mob is at full health) then I get a #. my guess is some comparison done to current health vs. max health is being done. at least that's where the logic leads me.


T

638

Thursday, June 10th 2010, 2:19pm

Add warning message via /s or /p

Again thanks Six, tiggs and everyone who has contributed to this post. I was wanting to see if there was a way to add a message to party chat when I used blood arrow so the healers didn't freak out. I guess it could be party chat or /s but could it be incorporated into my lua file instead of a macro on the action bar? ANy help would be appreciated

thx

639

Thursday, June 10th 2010, 3:18pm

Quoted from "stayfrosty02;286813"

Again thanks Six, tiggs and everyone who has contributed to this post. I was wanting to see if there was a way to add a message to party chat when I used blood arrow so the healers didn't freak out. I guess it could be party chat or /s but could it be incorporated into my lua file instead of a macro on the action bar? ANy help would be appreciated

thx


I'm not sure this will work, so you'll have to test it...

At the bottom of your custom function, after the "MyCombat(Skill, arg1)" line, add this:

Source code

1
2
3
if (UnitCastingTime("player") == "Blood Arrow") and (GetNumPartyMembers() > 1) then
    SendChatMessage("Using Blood Arrow", "PARTY")
end

mrmarc0001

Beginner

Posts: 3

Location: SF Bay Area

Occupation: Web Producer @ UCSF

  • Send private message

640

Thursday, June 10th 2010, 6:43pm

Quoted from "Sixpax;286339"

Unfortunately that won't work because the function I'm using with "Action:" definitions (UseAction) can't call a macro.


Ah, that's unfortunate indeed. Perhaps something that can be added in the next version of DIYCE? :D

Regarding BuffTimeLeft(), is there a reason to use the "Action" definition instead of the skillname, or is it interchangeable?