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.

841

Tuesday, July 13th 2010, 12:05am

Quoted from "lokanu;304882"

Range is too difficult to test accurately; you're better off not attempting it. The only method is to put a dummy skill on your hotbar and check if it's available or not (Icon is red or not). However, the icon can be red for other reasons then simply being out of range, thus not a good method.


Only problem is that I don't want it to use those skills first if I am < 49 to my target and since you can use those skills at any range, it will fire them off first regardless unless there's a check that says if target is > 50 or something, it will attempt to use them first, thus negating my sneak attack and putting me in combat.

lokanu

Beginner

Posts: 14

Location: Classified.

  • Send private message

842

Tuesday, July 13th 2010, 12:18am

Quoted from "shawnis;304911"

Only problem is that I don't want it to use those skills first if I am < 49 to my target and since you can use those skills at any range, it will fire them off first regardless unless there's a check that says if target is > 50 or something, it will attempt to use them first, thus negating my sneak attack and putting me in combat.


You're better off making another DIYCE function and putting it on another hotkey just for the sake of using when you know you're close enough. There just isn't any method to guarantee range checking atm.

843

Tuesday, July 13th 2010, 12:27am

Quoted from "lokanu;304917"

You're better off making another DIYCE function and putting it on another hotkey just for the sake of using when you know you're close enough. There just isn't any method to guarantee range checking atm.


Ah ok, you're probably right. Thanks for the help.

844

Tuesday, July 13th 2010, 12:42am

Quoted from "lokanu;304917"

You're better off making another DIYCE function and putting it on another hotkey just for the sake of using when you know you're close enough. There just isn't any method to guarantee range checking atm.


Hey one more question, I'm pretty new to LUA, so; Will I need a function to check if the spell is usable? Since it has a CD (Shadow Prison), I am thinking logically it may just keep trying to cast it even though it's on CD and not move down the line unless I tell it to move on if it's not usable (few other spells that have CD's I want to add to this as well if conditions are met. Is there a function to check to make sure the spell is off of it's cooldown?

lokanu

Beginner

Posts: 14

Location: Classified.

  • Send private message

845

Tuesday, July 13th 2010, 12:53am

Quoted from "shawnis;304938"

Hey one more question, I'm pretty new to LUA, so; Will I need a function to check if the spell is usable? Since it has a CD (Shadow Prison), I am thinking logically it may just keep trying to cast it even though it's on CD and not move down the line unless I tell it to move on if it's not usable (few other spells that have CD's I want to add to this as well if conditions are met. Is there a function to check to make sure the spell is off of it's cooldown?


GetSkillCooldown(skillpage,skillnumber) will do it for ya. However, Sixpax has done one better for ya by making a function to check it for you w/o having to know the page/number in your skill window.

CD("Shadow Prison") will be true if it's available. Here's how I'd use it:

Source code

1
i=i+1; Skill[i] = { ['name'] = "Shadow Prison",            ['use'] = ((not friendly) and (CD("Shadow Prison")) and (not string.find(tbuffs, "Shadow Prison")))


Provided the debuff is called "Shadow Prison" as I'm not ingame to test it, but I think it is. This also requires you to set "tbuffs" prior.

jsalemi

Trainee

Posts: 133

Location: VA, USA

  • Send private message

846

Tuesday, July 13th 2010, 12:54am

The check for CD is built into the DIYCE, so you don't need to add any additional functions for it.

mrmarc0001

Beginner

Posts: 3

Location: SF Bay Area

Occupation: Web Producer @ UCSF

  • Send private message

847

Tuesday, July 13th 2010, 1:06am

Quoted from "shawnis;304938"

Hey one more question, I'm pretty new to LUA, so; Will I need a function to check if the spell is usable? Since it has a CD (Shadow Prison), I am thinking logically it may just keep trying to cast it even though it's on CD and not move down the line unless I tell it to move on if it's not usable (few other spells that have CD's I want to add to this as well if conditions are met. Is there a function to check to make sure the spell is off of it's cooldown?


The DIYCE does this for you. Read the original post for more information.

848

Tuesday, July 13th 2010, 1:14am

Quoted from "lokanu;304947"

This also requires you to set "tbuffs" prior.


Not sure what you mean here.

Here's what I have, please take a look and tell me if I've made any noobie errors, then I'll test this in a 1v1.

Source code

1
  i=i+1; Skill[i] = { name = "Shadow Prison",  use = ((not friendly) and (CD("Shadow Prison")) and (UnitIsPlayer("target") and UnitCanAttack("player","target") and (energy >=50)) and (not string.find(tbuffs, "Shadow Prison")))


Thanks

mrmarc0001

Beginner

Posts: 3

Location: SF Bay Area

Occupation: Web Producer @ UCSF

  • Send private message

849

Tuesday, July 13th 2010, 1:41am

Quoted from "shawnis;304957"

Not sure what you mean


Read the original post and parts of this thread and/or refer to my guide.

850

Tuesday, July 13th 2010, 3:25am

Quoted from "mrmarc0001;304967"

Read the original post and parts of this thread and/or refer to my guide.


I've been reading through this bible for hours and trying to figure stuff out, there's quite a lot of information and sometimes it helps to just answer a question here and there for us beginners. I searched and didn't find answers for the stuff I am looking for.

In this case however, I was just asking one of the pro's to give my code a once over and tell if me if I had made any obvious errors in the code, that's all. Being new, I can easily mistype some syntax and screw up the line of code and not realize what I had done, where as a pro could easily take one glance and say, "oh you need to put this here for that to work correctly", and make life easy. :)

Thanks.

allanx

Beginner

Posts: 0

Location: Capitan, NM USA

  • Send private message

851

Tuesday, July 13th 2010, 4:49am

You know, someone needs to manage this thread. It is WAY too long to just tell someone to "read the thread".

I am sure there is a wealth of information here but it has reached a scale that is just unmangeable for the average player.

The page count alone is enough to discourage most!

852

Tuesday, July 13th 2010, 5:16am

Well, here is what I created, bad part is that when I try to use it in game, nothing happens at all. Anyone mind giving me a few pointers on what I did wrong, maybe helping me correct it?

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
function RogueScout(arg1, arg2)
    local Skill = {}
    local i = 0
    local energy = UnitMana("player")
    local focus = UnitSkill("player")
    local friendly = (not UnitCanAttack("player", "target"))
    local combat = GetPlayerCombatState()
    local tspell,ttime,telapsed = UnitCastingTime("target")
    local pbuffs = BuffList("player")
    local tbuffs = BuffList("target")

    i=i+1; Skill[i] = { name = "Throat Attack",  use = ((not friendly) and (tspell ~= nil) and (ttime >= 0.8) and ((ttime - telapsed) > 0.3) and (focus >= 15)) }
    i=i+1; Skill[i] = { name = "Combat Master",  use = ((not string.find(pbuffs, "Combat Master")) and (not string.find(pbuffs, "Informer"))) }
    i=i+1; Skill[i] = { name = "Sneak Attack",   use = ((not friendly) and (energy >= 30) and (arg2 == "behind") and (not combat)) }
    i=i+1; Skill[i] = { name = "Blind Spot",     use = ((not friendly) and (energy >= 25) and (arg2 == "behind")) }
    i=i+1; Skill[i] = { name = "Shadow Prison",  use = ((not friendly) and (CD("Shadow Prison")) and (not string.find(tbuffs, "Shadow Prison")))
    i=i+1; Skill[i] = { name = "Shot",           use = (not friendly) }
    i=i+1; Skill[i] = { name = "Energy Thief",   use = (energy <= 30)) }
    i=i+1; Skill[i] = { name = "Wound Attack",   use = ((not friendly) and (energy >= 38) and string.find(tbuffs, "Bleed") and string.find(tbuffs, "Grievous Wound")) }
    i=i+1; Skill[i] = { name = "Low Blow",       use = ((not friendly) and (energy >= 35) and string.find(tbuffs, "Bleed")) }
    i=i+1; Skill[i] = { name = "Shadowstab",     use = ((not friendly) and (energy >= 35)) }
    i=i+1; Skill[i] = { name = "Vampire Arrows", use = (not friendly) }


    MyCombat(Skill,arg1)
end


Thanks!

mrmarc0001

Beginner

Posts: 3

Location: SF Bay Area

Occupation: Web Producer @ UCSF

  • Send private message

853

Tuesday, July 13th 2010, 10:00am

My reply was in response to post #848...but here goes anyway...

tbuffs needs to be defined if you are going to run a find() on it. If you're looking to examine target's debuffs, declare it in your function like this

Source code

1
tbuffs = BuffList("target")
As for reading the whole thread, I never implied reading the whole thing, but a lot of people just skim thru this copying n pasting without knowing at least the basics of what's happening. There's a ton of info on DIYCE in the original post alone. The DIYCE is meant to make it easy for anyone to write a custom combat function, but you still need to know how to use it to use it properly. It's like driving an automatic. It's easy as hell, and you don't need to worry about a clutch and stuff, but you still need to know how to operate the rest of the car.

What most people seem to be doing when they "read the thread" is looking for a pre-written function for their class combo, and when they do, they find it doesn't work the way they want because 2 pages down, the function was modified to work better, but that wasn't the one copied and the user isn't able to do some common troubleshooting that has been repeated several times over (hence the length of the thread).

I even wrote a guide for those who don't want to read through the entire thread, summarizing key points in the entire thread and passing on that knowledge to anyone who can spare 15 minutes to read it. Note the word "read" and not the use of "skim".

Just my two cents on the matter. I'll just stop posting those replies that seem to trigger this sort of response.

854

Tuesday, July 13th 2010, 1:40pm

Quoted from "shawnis;305091"

Well, here is what I created, bad part is that when I try to use it in game, nothing happens at all. Anyone mind giving me a few pointers on what I did wrong, maybe helping me correct it?


Looks like you have some unbalanced parentheses/brackets on the Shadow Prison line and the Energy Thief line... that'll get ya every time :)

In response to your previous questions:

1) You don't need to do the CD() check as that is built in to the code, so you can take that off of the Shadow Prison line.

2) A "cheap" way to do the range check you're looking for is evaluating whether GetActionUsable() is true or not for a melee range skill. Although that will return false for other reason (like insufficient energy), but in your case that should do the trick.

Give this one a try. I think I covered all of your requirements (including the PvP check), plus some extras that you might like. Be sure to replace the #-sign with your Shadowstab action bar slot number.

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
function RogueScout(arg1, arg2)
    local Skill = {}
    local i = 0
    local energy = UnitMana("player")
    local focus = UnitSkill("player")
    local friendly = (not UnitCanAttack("player", "target"))
    local combat = GetPlayerCombatState()
    local tspell,ttime,telapsed = UnitCastingTime("target")
    local pbuffs = BuffList("player")
    local tbuffs = BuffList("target")
    local melee = GetActionUsable(#) -- # is your Shadowstab action bar slot number

    i=i+1; Skill[i] = { name = "Throat Attack",  use = ((not friendly) and (tspell ~= nil) and (ttime >= 0.8) and ((ttime - telapsed) >= 0.4) and (focus >= 15)) }
    i=i+1; Skill[i] = { name = "Combat Master",  use = ((not string.find(pbuffs, "Combat Master")) and (not string.find(pbuffs, "Informer"))) }
    i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and (not melee)) }
    i=i+1; Skill[i] = { name = "Shot",           use = ((not friendly) and (not melee)) }
    i=i+1; Skill[i] = { name = "Sneak Attack",   use = ((not friendly) and melee and (energy >= 30) and (arg2 == "behind") and (not combat)) }
    i=i+1; Skill[i] = { name = "Blind Spot",     use = ((not friendly) and melee and (energy >= 25) and (arg2 == "behind") and (not string.find(tbuffs, "Bleed"))) }
    i=i+1; Skill[i] = { name = "Shadowstab",     use = ((not friendly) and melee and (energy >= 35) and (not string.find(tbuffs, "Bleed"))) }
    i=i+1; Skill[i] = { name = "Shadow Prison",  use = ((not friendly) and (energy >= 50) and UnitIsPlayer("target") and (not string.find(tbuffs, "Shadow Prison"))) }
    i=i+1; Skill[i] = { name = "Shot",           use = (not friendly) }
    i=i+1; Skill[i] = { name = "Energy Thief",   use = (energy <= 30) }
    i=i+1; Skill[i] = { name = "Wound Attack",   use = ((not friendly) and melee 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 melee and (energy >= 35) and string.find(tbuffs, "Bleed")) }
    i=i+1; Skill[i] = { name = "Blind Spot",     use = ((not friendly) and melee and (energy >= 25) and (arg2 == "behind")) }
    i=i+1; Skill[i] = { name = "Shadowstab",     use = ((not friendly) and melee and (energy >= 35)) }
    i=i+1; Skill[i] = { name = "Vampire Arrows", use = (not friendly) }


    MyCombat(Skill,arg1)
end

jgill33

Beginner

Posts: 0

Location: Falls Church, VA

  • Send private message

855

Tuesday, July 13th 2010, 1:44pm

Nevermind, Sixpax beat me to it

856

Tuesday, July 13th 2010, 4:20pm

Quoted from "Sixpax;305184"

Looks like you have some unbalanced parentheses/brackets on the Shadow Prison line and the Energy Thief line... that'll get ya every time :)

In response to your previous questions:

1) You don't need to do the CD() check as that is built in to the code, so you can take that off of the Shadow Prison line.

2) A "cheap" way to do the range check you're looking for is evaluating whether GetActionUsable() is true or not for a melee range skill. Although that will return false for other reason (like insufficient energy), but in your case that should do the trick.

Give this one a try. I think I covered all of your requirements (including the PvP check), plus some extras that you might like. Be sure to replace the #-sign with your Shadowstab action bar slot number.

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
function RogueScout(arg1, arg2)
    local Skill = {}
    local i = 0
    local energy = UnitMana("player")
    local focus = UnitSkill("player")
    local friendly = (not UnitCanAttack("player", "target"))
    local combat = GetPlayerCombatState()
    local tspell,ttime,telapsed = UnitCastingTime("target")
    local pbuffs = BuffList("player")
    local tbuffs = BuffList("target")
    local melee = GetActionUsable(#) -- # is your Shadowstab action bar slot number

    i=i+1; Skill[i] = { name = "Throat Attack",  use = ((not friendly) and (tspell ~= nil) and (ttime >= 0.8) and ((ttime - telapsed) >= 0.4) and (focus >= 15)) }
    i=i+1; Skill[i] = { name = "Combat Master",  use = ((not string.find(pbuffs, "Combat Master")) and (not string.find(pbuffs, "Informer"))) }
    i=i+1; Skill[i] = { name = "Vampire Arrows", use = ((not friendly) and (not melee)) }
    i=i+1; Skill[i] = { name = "Shot",           use = ((not friendly) and (not melee)) }
    i=i+1; Skill[i] = { name = "Sneak Attack",   use = ((not friendly) and melee and (energy >= 30) and (arg2 == "behind") and (not combat)) }
    i=i+1; Skill[i] = { name = "Blind Spot",     use = ((not friendly) and melee and (energy >= 25) and (arg2 == "behind") and (not string.find(tbuffs, "Bleed"))) }
    i=i+1; Skill[i] = { name = "Shadowstab",     use = ((not friendly) and melee and (energy >= 35) and (not string.find(tbuffs, "Bleed"))) }
    i=i+1; Skill[i] = { name = "Shadow Prison",  use = ((not friendly) and (energy >= 50) and UnitIsPlayer("target") and (not string.find(tbuffs, "Shadow Prison"))) }
    i=i+1; Skill[i] = { name = "Shot",           use = (not friendly) }
    i=i+1; Skill[i] = { name = "Energy Thief",   use = (energy <= 30) }
    i=i+1; Skill[i] = { name = "Wound Attack",   use = ((not friendly) and melee 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 melee and (energy >= 35) and string.find(tbuffs, "Bleed")) }
    i=i+1; Skill[i] = { name = "Blind Spot",     use = ((not friendly) and melee and (energy >= 25) and (arg2 == "behind")) }
    i=i+1; Skill[i] = { name = "Shadowstab",     use = ((not friendly) and melee and (energy >= 35)) }
    i=i+1; Skill[i] = { name = "Vampire Arrows", use = (not friendly) }


    MyCombat(Skill,arg1)
end


Just tried this, seems to work like a charm, you are my hereo!!

Thanks a bunch man, this macro absolutely rocks for a R/S...

857

Tuesday, July 13th 2010, 6:09pm

could a warrior/scout with a good working macro, post the macro/macro's they use? i went though all 80+ pages here, and there is only one macro posted, and it doesnt work to well.

i just switched to w/r from w/s, so i dont have my 40 elites, but i can delete it from the macro. thanks for any replies.

858

Tuesday, July 13th 2010, 7:29pm

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function WarriorScout(arg1)
	local i=0
	local Skill={}
	local rage = UnitMana("player")
	local focus = UnitSkill("player")
	local bleed = BuffTimeLeft("target","Bleed")
	local skull = BuffTimeLeft("target","Skull Broken")
	local vamp = BuffTimeLeft("target","Vampire Arrows")
	if ((UnitCanAttack("player","target")) and (PctH("target")>0)) then
		i=i+1;Skill[i]={name="Action:22",use=((focus>30) and (skull < 1))}--Skull Bash
		i=i+1;Skill[i]={name="Action:21",use=true}--Shot
		i=i+1;Skill[i]={name="Action:23",use=((rage < 25) and (bleed > 0))}--Tactical Strike
		i=i+1;Skill[i]={name="Action:24",use=((rage>50) and (bleed < 8))}--Slash
		i=i+1;Skill[i]={name="Action:25",use=((focus < 50) and (vamp < 1))}--Vampire Arrows
		i=i+1;Skill[i]={name="Action:30",use=true}--Attack
	end
	MyCombat(Skill,arg1)
end

jgill33

Beginner

Posts: 0

Location: Falls Church, VA

  • Send private message

859

Tuesday, July 13th 2010, 9:05pm

Quoted from "venomous42;305357"

could a warrior/scout with a good working macro, post the macro/macro's they use? i went though all 80+ pages here, and there is only one macro posted, and it doesnt work to well.

i just switched to w/r from w/s, so i dont have my 40 elites, but i can delete it from the macro. thanks for any replies.


You can go with the one above, or go here http://forum.us.runesofmagic.com/showthread.php?t=43764 (there you can find the one that i use, plus someone else's)

lokanu

Beginner

Posts: 14

Location: Classified.

  • Send private message

860

Wednesday, July 14th 2010, 12:41pm

Quoted from "blurterblurter;305420"

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function WarriorScout(arg1)
	local i=0
	local Skill={}
	local rage = UnitMana("player")
	local focus = UnitSkill("player")
	local bleed = BuffTimeLeft("target","Bleed")
	local skull = BuffTimeLeft("target","Skull Broken")
	local vamp = BuffTimeLeft("target","Vampire Arrows")
	if ((UnitCanAttack("player","target")) and (PctH("target")>0)) then
		i=i+1;Skill[i]={name="Action:22",use=((focus>30) and (skull < 1))}--Skull Bash
		i=i+1;Skill[i]={name="Action:21",use=true}--Shot
		i=i+1;Skill[i]={name="Action:23",use=((rage < 25) and (bleed > 0))}--Tactical Strike
		i=i+1;Skill[i]={name="Action:24",use=((rage>50) and (bleed < 8))}--Slash
		i=i+1;Skill[i]={name="Action:25",use=((focus < 50) and (vamp < 1))}--Vampire Arrows
		i=i+1;Skill[i]={name="Action:30",use=true}--Attack
	end
	MyCombat(Skill,arg1)
end


I would change:

Source code

1
if ((UnitCanAttack("player","target")) and (PctH("target")>0)) then

to this:

Source code

1
if (UnitCanAttack("player","target") and (not UnitIsDeadOrGhost("target"))) then


I've seen code register almost dead as 0%. To err on the safe side you can check whether your target is dead or alive.