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.

krssrb

Beginner

Posts: 20

Location: Serbia

  • Send private message

41

Tuesday, May 20th 2014, 2:58pm

I updated FuzzyDIYCE to v0.5, game dont crash not, but there is error message
"...Addons/FuzzyDYICE/BaseCommands/Commands.lua:208: attempt to compare number with nil"
And again when i enable HUD, addon is workig with no errors.
Warrior80/Mage80/Warlock80

42

Tuesday, May 20th 2014, 4:10pm

0.5 works very good:thumbup:
I am very happy, probably time to give up diyce 2.0

[question]
Cut cooldown short in FD option what is this?
How to apply ignoretimer? Like here

Source code

1
{ name = "Savage Whirlwind",		use = (pctEB2 >= .05) and (boss), timer = "Wild Howl", ignoretimer = (thealth <= .30)},

This post has been edited 1 times, last edit by "Notor" (May 20th 2014, 4:17pm)


43

Tuesday, May 20th 2014, 10:12pm

@Notor:
The equivalent would be:

Source code

1
2
3
local myTimer = api.CreateFDTimer("Wild Howl", 0, 0.5)

trySkill("Savage Whirlwind",  (PlayerManaPct >= 5) and IsTargetBoss, myTimer(10), (PlayerHealthPct <= 30))


The "cut cooldown short" is the time it should cast a skill before the cooldown is ready, ex a skill with 10s cooldown would, if we have CutCD = 0.5, be cast again at 9.5s. This increases/optimizes dps and is possible due to lag between your client and the server. I plan to use this in the timers as well, just havent gotten to it yet.

@krssrb:
Good, then I have an Idea why you had crashes and why it fails now, I'll dig a little into it and get back to u. It seems FD hasn't initialized your CutCD config variable which results in a numeric comparison with a nil value.

.frafall

This post has been edited 4 times, last edit by "frafall" (May 20th 2014, 10:21pm)


Marvengus

Beginner

Posts: 14

Location: Netherlands

Occupation: Mathematician, Scientist

Mood: Smile

  • Send private message

44

Tuesday, May 20th 2014, 10:46pm

Really nice work frafall :)

I have rewritten my old DIYCE rogue-scout script for FD. Most of it seems top work very well (still testing), however, I cannot get Wound Attack to be executed.
Sometimes, I see the two lines
!! wantWoundAttack !!
!!!! wantWoundAttack !!!!
show up in the general chat, but often they don't show up and Low Blow is selected although I certainly see Bleed and Grievous Wound on the target, and I have more than 35 energy... Any ideas?

I have more scripts that I plan to rewrite and then post here, but I want to have this one 100% satisfactory before I move on to the next one :)


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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
--[[
	$Id: RogueScout.lua 42 2014-05-18 07:57:41Z frafall $
	
    Rogue/Scout combat script
--]]
local fd     = FuzzyDIYCE
local fdvars = fd.FDVars
local api    = fd.API

-- Set the environment for the scripts to run in
api.SetDefaultScriptApartment()

--[[
	Rogue/Scout bleeds
	------------------
	
	Bleed               : 620313 - 10s (old value 500654?)
	Blind Spot Bleed	: 620297 - 6s 
	Sneak Attack Bleed	: 500726 - 20s
--]]
local bleeds = {620313, 620297, 500726}
local dangerous = {"boss", "elite"}

function RogueScout(mode)

	local hpPotAction = 39			-- action bar slot of HP pot
	local foodAction = 40			-- action bar slot of house maid food
	local unknownChoiceAction = 63  -- action bar slot of "Unknown Choice Rogue" ISS skill
	
	local wantWoundAttack = false

	local ranged = (mode == "ranged")	-- If true, we prefer ranged skills
	local strongBoss = (mode == "boss")	-- We are up against a strong boss that needs "all we have"
	
	if ranged then 
		api.FDMsg("ranged")
	end
	if strongBoss then 
		api.FDMsg("strongBoss")
	end
	
	-- heal / stay alive		
	trySkill(  "Substitute",	PlayerHealthPct < 30 and not PlayerHasBuff("Substitute") ) --	let substitute catch the next hit
	tryAction( hpPotAction,		PlayerHealthPct < 30 and not IsSiege )

	-- buffs
	trySkill( "Combat Master",	not PlayerHasBuff("Combat Master") )
	
	--	Food van housemaid cook. 
	tryAction( foodAction, 		not PlayerHasBuff("Unimaginable Salad")
								and not PlayerHasBuff("Roast Leg of Lamb")
								and not PlayerHasBuff("Fried Salted Fish")
								and not PlayerHasBuff("Fried Rib") )

	-- We have a target?
    if GotTarget and IsEnemy and not TargetIsDead then
	
		wantWoundAttack = (TargetHasBuff("Grievous Wound") and TargetHasBuff("Bleed") and CD("Wound Attack") )
		-- if true, and we don't have energy for Wound Attack, then do not waste energy on LB or SS, but use filler skill to regen energy

		if wantWoundAttack then 
			api.FDMsg("!!   wantWoundAttack   !!")
		end
		
		-- Silence / interrupt spell casting
		trySkill( "Throat Attack",	(PlayerEnergy >= 50) and SilenceThis and (IsSiege or IsTargetType(dangerous)) )
		
		-- In SW, use low blow by default
		-- trySkill( "Low Blow", (PlayerEnergy >= 25) and IsSiege )
		
		-- Item-set skill that randomly creates one of three possible buffs.  (cost 20 energy, CD=3min)
		tryAction( 63, (not wantWoundAttack) and not PlayerHasBuff("Excite") and not PlayerHasBuff("Blood Boil") and not PlayerHasBuff("Immortality") )

		-- Crit
		trySkill( "Premeditation",	(not PlayerInCombat) and (not PlayerHasBuff("Premeditation")) and (IsSiege or IsTargetType(dangerous)) ) -- next attack is crit with +40% dmg

		trySkill( "Vampire Arrows",	ranged and (PlayerFocus >= 20) )
		trySkill( "Shot",			ranged )
	
		-- Strong Boss with HP < 30%
		trySkill( "Fervent Attack",	strongBoss and (TargetHealthPct <= 30) and (not PlayerHasBuff("Fervent Attack")) )	-- D 0:30, +PATT speed, -DEF
		trySkill( "Assassins Rage",	strongBoss and (TargetHealthPct <= 30) and (not PlayerHasBuff("Assassins Rage")) )	-- D 0:15, CD 5:00, +crit rate+dmg
		trySkill( "Energy Thief",	strongBoss and (TargetHealthPct <= 30) and (not PlayerHasBuff("Energy Thief")) )	-- D 0:15, CD 2:00, normal att +20 energy
		
		-- Survival
		trySkill("Evasion", PlayerInCombat and (PlayerHealthPct < 40))	-- D 0:20, CD 2:00, +40% dodge

		if wantWoundAttack then 
			api.FDMsg("!!!! wantWoundAttack !!!!")
		end
		
		-- MAIN ROTATION
		trySkill("Wound Attack",  	(PlayerEnergy >= 35) and (wantWoundAttack) )										-- I, CD 0:06 
		trySkill("Low Blow",      	(PlayerEnergy >= 25) and (not wantWoundAttack) and TargetHasBuff("Bleed"))			-- causes 10 sec Grievous Wound
		trySkill("Shadowstab",    	(PlayerEnergy >= 20) and (not wantWoundAttack) and (not TargetHasBuff("Bleed")) )	-- causes 10 sec Bleed

		-- FILLERS: Rogue skills
		trySkill( "Low Blow", 		(PlayerEnergy >= 25) and PlayerHasBuff("Energy Thief") )							-- energy restores fast, and LB better than scout skills

		-- FILLERS: Scout skills
		trySkill( "Vampire Arrows",	PlayerFocus >= 20 )																	-- out of energy or wait for WA, keep DPS up
		trySkill( "Shot",			true )																				-- out of energy or wait for WA, keep DPS up
		trySkill( "Joint Blow",		true )
	
		--	If all else unavailable
		trySkill( "Attack",			true )
	
    end

    if (TargetIsDead or not GotTarget) then
        target("select", "next", "enemy")
    end
end
Marvengo R/S/K (90/90/65)
Marvengus M/D/Wd (85/80/68 )
Playing on Isilitir (EU)
Guild Traumfaenger

45

Wednesday, May 21st 2014, 11:12am

@Marvengus

You have specified:

Source code

1
wantWoundAttack = (TargetHasBuff("Grievous Wound") and TargetHasBuff("Bleed") and CD("Wound Attack") )

which would result in wantWoundAttack to never be true as CD(...) would return false unless you used the skill manually.

I suspect whet you want is :

Source code

1
wantWoundAttack = (TargetHasBuff("Grievous Wound") and TargetHasBuff("Bleed") and not CD("Wound Attack") )


CD returns true if the specified skill is in cooldown, false if it is NOT on cooldown.

.frafall

Marvengus

Beginner

Posts: 14

Location: Netherlands

Occupation: Mathematician, Scientist

Mood: Smile

  • Send private message

46

Wednesday, May 21st 2014, 1:05pm

Hmm, I had this in my old DIYCE code and that worked correctly:

Source code

1
  wantWoundAttack = (tbuffs[620314] and tbuffs[500654] and CD("Wound Attack") )


In old DIYCE's MyCombat method, I found the following:

Source code

1
2
3
4
            elseif CD(Skill[x].name) then
                if talktome then Msg("- "..Skill[x].name) end
                CastSpellByName(Skill[x].name)
                return true


This suggests that CD(skill)==true implies that the skill is available, hence out of cool down.

I assumed FD's CD method would mean the same :)
But, indeed the inversed meaning actually makes more sense from a naming point of view... Perhaps make it even clearer by calling it IsInCooldown(skill) ?

(I am at work now, so cannot now test if your suggestion indeed fixes the issue.)
Marvengo R/S/K (90/90/65)
Marvengus M/D/Wd (85/80/68 )
Playing on Isilitir (EU)
Guild Traumfaenger

47

Wednesday, May 21st 2014, 3:44pm

@Notor:
The equivalent would be:

Source code

1
2
3
local myTimer = api.CreateFDTimer("Wild Howl", 0, 0.5)

trySkill("Savage Whirlwind",  (PlayerManaPct >= 5) and IsTargetBoss, myTimer(10), (PlayerHealthPct <= 30))


The "cut cooldown short" is the time it should cast a skill before the cooldown is ready, ex a skill with 10s cooldown would, if we have CutCD = 0.5, be cast again at 9.5s. This increases/optimizes dps and is possible due to lag between your client and the server. I plan to use this in the timers as well, just havent gotten to it yet.

@krssrb:
Good, then I have an Idea why you had crashes and why it fails now, I'll dig a little into it and get back to u. It seems FD hasn't initialized your CutCD config variable which results in a numeric comparison with a nil value.

.frafall
All works great :thumbsup:
Another question. How to call a mode such as "AoE" in the game?

Source code

1
elseif mode == "aoe" then

Is it correct?

Source code

1
/fdiyce Attack(aoe)
and in script

Source code

1
function WarriorWarden(mode)
??

Marvengus

Beginner

Posts: 14

Location: Netherlands

Occupation: Mathematician, Scientist

Mood: Smile

  • Send private message

48

Wednesday, May 21st 2014, 4:36pm

@Notor

No you should create this macro, so without brackets. Also don't put quotes around string parameters. Don't know why, but that did not work for me.

Source code

1
/fdiyce Attack aoe
Marvengo R/S/K (90/90/65)
Marvengus M/D/Wd (85/80/68 )
Playing on Isilitir (EU)
Guild Traumfaenger

49

Thursday, May 22nd 2014, 11:43am

@Marvengus

I agree, better rename it to avoid confusion with DIYCE2, so IsInCooldown it is from next release

The arguments are all text arguments, I avoided quotations to keep argument parsing as low overhead as possible but I see that can be an issue if we want to give arguments containing spaces.

.frafall

krssrb

Beginner

Posts: 20

Location: Serbia

  • Send private message

50

Thursday, May 22nd 2014, 12:10pm

I see that can be an issue if we want to give arguments containing spaces.

We can always use underscore, e.g.

Source code

1
/fdiyce Attack melee_fight 
Warrior80/Mage80/Warlock80

Marvengus

Beginner

Posts: 14

Location: Netherlands

Occupation: Mathematician, Scientist

Mood: Smile

  • Send private message

51

Thursday, May 22nd 2014, 1:08pm

Agreed on the underscore remark. No need to complicate this for strings with spaces, certainly if that would negatively impact speed.

@frafall: are you planning to write a guide for script developers? Probably not right now, since things are still changing (improving). But at some point in the future?
Marvengo R/S/K (90/90/65)
Marvengus M/D/Wd (85/80/68 )
Playing on Isilitir (EU)
Guild Traumfaenger

Marvengus

Beginner

Posts: 14

Location: Netherlands

Occupation: Mathematician, Scientist

Mood: Smile

  • Send private message

52

Friday, May 23rd 2014, 11:08am

The provided scripts target as follows:

Source code

1
2
3
    if (TargetIsDead or not GotTarget) and (IsSiege or ShiftHeld) then
        target("select", "next", "enemy")
    end


Question: Does the target(..) method skip lvl 1 mobs and player pets in Siege?
Question: Can you elaborate on the three arguments in the target(..) method?

Personally, I don't want to use shift, and I want FD to always target when I activate the macro, so I changed it to this

Source code

1
2
3
    if (TargetIsDead or not GotTarget) then
        target("select", "next", "enemy")
    end


I noticed that targeting works slightly different then in old DIYCE. If I have myself in target, which happens frequently in between fights, then the FD scripts do not re-target. So I have to first escape (untarget) or select the target manually. Is there a way to prevent this?
Marvengo R/S/K (90/90/65)
Marvengus M/D/Wd (85/80/68 )
Playing on Isilitir (EU)
Guild Traumfaenger

53

Friday, May 23rd 2014, 12:06pm

Source code

1
2
3
4
5
6
7
8
if TargetIsDead or (not IsEnemy) then
        target("clear")
    end		
          if (not GotTarget) then
        for i=1,10 do
        target("select", "next", "enemy", "nopets")
    end
    end


Will still target 1 lvl mobs ;)

54

Saturday, May 24th 2014, 6:13am

The target function has the following arguments and is located in plugins/BaseCommands/Commands.lua:

Source code

1
2
3
-- Target selection/clearing
-- target select [prev|next] [enemy|friend] [normal|players|nopets|custom] [custom function]
function target(subcmd, selectdir, trgttype, option, customfunc)


Currently there is no exclusion of lvl 1 mobs. But, as you can see, there is an option to include your own target function as:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
local function MyTargetFunction(prev, trgtfriendly)
    local trgtfunc = trgtfriendly and TargetNearestFriend or TargetNearestEnemy
    for i = 1,10 do
       trgtfunc(prev)
       if not UnitMaster("target") or UnitLevel("target") > 1 then
          break
       end
    end
    if UnitExists("target") and (UnitMaster("target") or UnitLevel("target" <= 1)) then
       TargetUnit("")
    end
end

if TargetIsDead or (not IsEnemy) then
     target("clear")
 end		
 if (TargetIsDead or not GotTarget) then
     target("select", "next", "enemy", "custom",  MyTargetFunction)
 end
 


So, you can elaborate as you want. If there is specific functionality we agree on should be in the targeting I have no problems adding to the distribution but I think the same rule applies here as for the scripts.

.frafall

Edited: bug detected by Peryl :) thx

This post has been edited 1 times, last edit by "frafall" (May 29th 2014, 5:17pm)


55

Saturday, May 24th 2014, 9:21am

FuzzyDIYCE v0.51

New release, most important changes are:
  • Added support for locading combat scripts from "Runes of Magic/Interface/UserScripts", this is outside of Addon space so Curse will not modify it when you update FuzzyDIYCE. There is a sample UserScripts directory in the distribution, to activate this MUST be copied into the Interfaces directory. Note that any combat functions loaded with duplicate function names wrt scripts (example scripts) will replace the example scripts.
  • I remade the /fdiyce reload command, it will now reload the RegisterPlugin files and can therefore also be used when you add a new combat script.I.E no point in restarting client when doing scripting anymore.
  • Fixed bug in config with uninitialized variables, they are now set to reasonable values.
  • Renamed some of the functions used in combat scripts, the upper case 1st letter are all cached variables/functions, the ones with lowercase 1st letter are not cached normal functions. The ones affected are attackActive/attackUsable. Also the CD is renamed to isInCooldown to avoid misunderstanding with the DIYCE CD function which returns the opposite boolean value. So isInCooldown returns true if skill named is in cooldown, false if its ready.


.frafall

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

56

Sunday, May 25th 2014, 1:04pm

Just wanted to indicate a couple of things with frafall's example custom targeting code above.

First, there is a samll problem in the example usage of the custom targeting function.
The line

Source code

1
     target("select", "next", "custom", MyTargetFunction)

should read

Source code

1
    target("select", "next", "enemy", "custom", MyTargetFunction)

Without the target type, it will have no way to know if it is targeting friends or enemies and therefore can choose the correct RoM targeting function.

Anyway, this is exactly why I had added custom targeting. As there is simply no way to know all the different things that people will want for their targeting, and some may not be appropriate for some conditions, I chose to simply give the ability to players to add their own.

Ignoring Level 1 mobs is an example of this. If you look though the DIYCE 2 thread, you will find that some people had problems in some minigames because they couldn't target some of the level 1 mobs needed for the minigame.
2013... The year from hell....

Marvengus

Beginner

Posts: 14

Location: Netherlands

Occupation: Mathematician, Scientist

Mood: Smile

  • Send private message

57

Wednesday, May 28th 2014, 10:00am

In my FD scripts, I auto-eat patt/matt food from my housemaid cook, using the following logic. Basically this eats the housemaid's food, unless I still have a better food buff active. To my knowledge, this could be reusable to all classes, so I share it here. Let me know if you see issues or possible improvements. I may be missing some patt foods, since that list is shorter.

(For simplicity, I did not use a combat-method argument for foodAction, but hard-coded its value (40 in my case) into the script. When you copy this code, you must replace the value 40 with your own action bar slot that contains the housemaid food, or provide that as argument into the combat method.)

Physical classes:

Source code

1
2
3
4
5
6
--	Eat housemaid cook food, unless we have a better food buff active. 
local foodAction = 40 -- action bar slot of house maid food
tryAction( foodAction,     not PlayerHasBuff("Unimaginable Salad")
                       and not PlayerHasBuff("Roast Leg of Lamb")
                       and not PlayerHasBuff("Fried Salted Fish")
                       and not PlayerHasBuff("Fried Rib") )


Magical classes:

Source code

1
2
3
4
5
6
7
8
9
10
--	Eat housemaid cook food, unless we have a better food buff active. 
local foodAction = 40 -- action bar slot of house maid food
tryAction( foodAction,     not PlayerHasBuff("Cheese Fishcake")             -- Housemaid
                       and not PlayerHasBuff("Berry Sandwich")              -- M. Damage
                       and not PlayerHasBuff("Garlic Bread")                -- M. Attack
                       and not PlayerHasBuff("Fried Egg Sandwich")          -- M. Damage
                       and not PlayerHasBuff("Light Fluffy Bread")          -- M. Damage
                       and not PlayerHasBuff("Crispy Chicken Drumstick")    -- M. Damage
                       and not PlayerHasBuff("Loaf of Magic Hard Bread")    -- M. Attack
                       and not PlayerHasBuff("Charcoal Barbequed Beef") )   -- M. Attack
Marvengo R/S/K (90/90/65)
Marvengus M/D/Wd (85/80/68 )
Playing on Isilitir (EU)
Guild Traumfaenger

RoMage

rustyx is lame rogue

Posts: 2,694

Location: web

Occupation: DB Admin

Mood: Unsure

  • Send private message

58

Wednesday, May 28th 2014, 4:56pm

Unless you create food buff as separate item, shouldn't you check if you already have house maid food buff as well?

In DIYCE2 I used buff # for those.

Thanks for sharing.

This topic got me interested in creation of scripts for couple of class combos I play. (Using DIYCE2 atm)

Marvengus

Beginner

Posts: 14

Location: Netherlands

Occupation: Mathematician, Scientist

Mood: Smile

  • Send private message

59

Wednesday, May 28th 2014, 6:29pm

Unless you create food buff as separate item, shouldn't you check if you already have house maid food buff as well?


The samples do check for the house maid food buff. Those are the "Unimaginable Salad" and "Cheese Fishcake".
Marvengo R/S/K (90/90/65)
Marvengus M/D/Wd (85/80/68 )
Playing on Isilitir (EU)
Guild Traumfaenger

RoMage

rustyx is lame rogue

Posts: 2,694

Location: web

Occupation: DB Admin

Mood: Unsure

  • Send private message

60

Wednesday, May 28th 2014, 7:12pm

Are those really names of the buffs? I know that they were different number buffs, but never released they had the same name as real food buffs. Thanks, I will try this tonight.