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.

1

Thursday, April 10th 2014, 7:47am

FuzzyDIYCE combat scripts

FuzzyDIYCE Usage and Combat Scripts



This is the user forum for FuzzyDIYCE


Please, only post questions/contributions pertaining to combat scripts for FuzzyDIYCE.
Unrelated posts will be ignored.

Any questions relating to bugs or discussions of the core functionality can be directed to the developement thread

Note that FuzzyDIYCE framework was written by Peryl, his has given his permission to move forward with this project.

FuzzyDIYCE is an add-on that allows the creation of skill lists that can be triggered, via a macro, in a context sensitive manner similar to DIYCE and DIYCE 2.0 does. FuzzyDIYCE is inspired by those earlier add-ons.


The main features of FuzzyDIYCE are:
  • Just-in-Time cached data reading so no piece of information need be read more than once.
  • Simplified DIYCE timer usage.
  • Skill sub-lists.
  • Configurable (only flags for now) in the game interface configuration panel.

Getting started with FuzzyDIYCE:
  • Install the addon from Curse
  • Add your combat script to Addons/FuzzyDIYCE/scripts directory
  • Add your macro "/fdiyce Attack"
  • ..go kill something

Adding combat scripts:
  • Write a script, there are some examples in the Addons/FuzzyDIYCE/scripts directory
  • Add your script to the Addons/FuzzyDIYCE/scripts directory
  • Add your script to the "InitPlugin" part of the Addons/FuzzyDIYCE/scripts/RegisterPlugin.lua
  • Relog
  • Now your script should be available to use as "/fdiyce YourScriptname"
  • Note, if you name your combat function as "MainclassSecondaryclass" it will also be available for the Attack plugin and you can call it as "/fdiyce Attack"


Using fdiyce:
  • You need to create a macro '/fdiyce Attack', note that FD HAS TO BE CALLED FROM MACRO as it uses UseSkill which is disabled in command line.
  • To check which combat scripts you have installed you can use '/fdiyce list' (version > 0.33)
  • To reload combat scripts after editing you can use '/fdiyce reload', note that only scripts already in the script list can be reloaded, if you add a new combat script you will have to restart client.

Best regards
frafall

This post has been edited 4 times, last edit by "frafall" (May 8th 2014, 9:32pm) with the following reason: New features


2

Thursday, April 10th 2014, 11:30am

Sample combat script

A combat script is a lua script which implements a combat function, i.e. a function which selects which action to take.
I aim to include the best scripts as default in the distribution but I am dependent on submissions from you so please feel free to submit in this thread!

An example is "WarriorWarden.lua":

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
local fd     = FuzzyDIYCE
local api    = fd.API
local Skills = fd.Skills

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

function WarriorWarden(mode, hero, uni)
	local hero = hero or 59
	local uni = uni or 60
	
	-- Silence target skills
	try("skill", Skills["Shout"].entry, SilenceThis)

	-- Survival skills
	try("skill", Skills["Survival Instinct"].entry, PlayerInCombat and PlayerHealthPct < .5 )
	try("skill", Skills["Defensive Formation"].entry, PlayerInCombat and PlayerHealthPct < .5 and PlayerMana >= 25 )
	try("skill", Skills["Elven Amulet"].entry, PlayerInCombat and PlayerHealthPct < .4 )

	-- Long buffs (XXX: Mana/Mana2 enough?)
	try("skill", Skills["Battle Creed"].entry, (not PlayerHasBuff("Battle Creed")) or PlayerHasBuff("Battle Creed").time <= 5)
	
	-- Maintain Hero, Speed pots, HP pots and speed pots
	try("action", hero, PlayerHasBuff("Hero Magic Medicine") and PlayerHasBuff("Hero Magic Medicine").time <= 5)
	try("action", uni, PlayerHasBuff("Touch of the Unicorn") and PlayerHasBuff("Touch of the Unicorn").time <= 5)

	-- We have a target?
        if IsEnemy and not TargetIsDead then
		-- Timer for Bleed
		api.CreateFDTimer("Bleed",  7.0)		-- Tune 6 - 7.5
	
		-- Regenerate rage
		try("skill", Skills["Enraged"].entry, IsTargetType{"boss"} and PlayerMana <= 20)

		-- Surprise Attack
		try("skill", Skills["Surprise Attack"].entry, true)

		-- Maintain Briar Shield if in use, if not on skip (might be to avoid aoe's)
		try("skill", Skills["Briar Shield"].entry, PlayerHasBuff("Briar Shield") and PlayerHasBuff("Briar Shield").time <= 5)

		-- Make sure we get damage buff for party
		try("skill", Skills["Savage Whirlwind"].entry, IsTargetType{"boss"} and PlayerSecMana >= 270)

		-- Keep these going all times 
		try("skill", Skills["Slash"].entry, PlayerMana >= 25, "Bleed")
		try("skill", Skills["Charged Chop"].entry, PlayerSecMana >= 260)
		try("skill", Skills["Tactical Attack"].entry, TargetHasBuff("Bleed") and PlayerMana >= 15)
		try("skill", Skills["Probing Attack"].entry, PlayerMana >= 20 and not TargetHasBuff("Vulnerable"))
		try("skill", Skills["Open Flank"].entry, TargetHasBuff("Vulnerable") and PlayerMana >= 10)
		
		-- If we can lessen damage boss gives
		try("skill", Skills["Attack Weakener"].entry, IsTargetType{"boss"} and TargetHasBuff("Vulnerable") and PlayerSecMana >= 210)			
	
    end

	-- Re-target if shift held down or in siegewars
    if (TargetIsDead or not GotTarget) and (IsSiege or ShiftHeld) then
        target("select", "next", "enemy")
    end
end


This script must be placed in FuzzyDIYCE/Scripts, then it must be added to the file FuzzyDIYCE/Scripts/RegisterPlugin.lua as:

Source code

1
2
3
local function InitPlugin()
 	api.FDLoad(PLUGIN_PATH..PLUGIN_FOLDER.."WarriorWarden.lua")
end


After a relog the script is available for usage as "/fdiyce WarriorWarden".

A plugin "AttackScripts" is included, this accepts the command "/fdiyce Attack" and will, based on your primary and secondary class call the respective class scripts such as our "WarriorWarden" script above.

Note that in the combat script there is a number of variables such as 'IsEnemy' and 'PlayerMana', these are evaluated and cached by the framework by need, i.e. the first time you references a variable its loaded by the framework, the next times you reference it its loaded from cache.

Currently the list of variables is as follows, note that this is subject to change (mostly due to new ones), the current updated list is available in FuzzyDIYCE/Plugins/BaseCommands/Vars.lua. Note, for usage you should probably look in this file as some are used as variables and some as functions.

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
GotTarget
IsEnemy
PlayerInCombat
CurrentZone
ShiftHeld
CtrlHeld
AltHeld
IsBehind
InPvP
TargetIsDead
PlayerInParty
PlayerInRaid
TargetInParty
TargetInRaid
PlayerHealth
PlayerHealthPct
TargetHealth
TargetHealthPct
PlayerMana
PlayerManaPct
PlayerSecMana
PlayerSecManaPct
TargetMana
TargetManaPct
TargetSecMana
TargetSecManaPct
IsTargetType
BuffTable
TargetHasBuff
PlayerHasBuff
RSBleed
Bleeding
Dodged
HaveOffhand
SilenceThis
IsSiege
PetExists
PetName
PetHealth
PetHealthPct
PetActive

This post has been edited 3 times, last edit by "frafall" (Apr 11th 2014, 7:04am)


3

Thursday, April 17th 2014, 11:35pm

There is some bug in FuzzyDIYCE, whenever I got killed and click DIYCE makro my game crashes without any crash report...

Here is script I am currently using for my W/WD:

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
local fd     = FuzzyDIYCE
local api    = fd.API
local Skills = fd.Skills
local fdvars = FuzzyDIYCE.FDVars

api.SetDefaultScriptApartment()

function WarriorWarden(mode, hero, uni)
	local hero = hero or 43
	local uni = uni or 58
	local Caviar = Caviar or 47
	local ManaPot = ManaPot or 21
	local GCSkill = GCSkill or 24
	
	try("skill", Skills["Survival Instinct"].entry, (IsTargetType{"boss"} and PlayerInCombat and PlayerHealthPct < .20))
	
	try("skill", Skills["Battle Creed"].entry, (not PlayerHasBuff("Battle Creed")) or PlayerHasBuff("Battle Creed").time <= 120)
	try("action", hero, PlayerHasBuff("Hero Magic Medicine") and PlayerHasBuff("Hero Magic Medicine").time <= 30)
	try("action", uni, PlayerHasBuff("Touch of the Unicorn") and PlayerHasBuff("Touch of the Unicorn").time <= 15)
	try("skill", Skills["Briar Shield"].entry, ((not PlayerInCombat) and (not PlayerHasBuff("Briar Shield")) or PlayerHasBuff("Briar Shield").time <= 120))
	try("action", GCSkill, ((not PlayerHasBuff("Composure")) or PlayerHasBuff("Composure").time <= 120))
	
	if IsEnemy and not TargetIsDead then

		try("skill", Skills["Power of the Wood Spirit"].entry, (IsShiftKeyDown() and PlayerSecMana >= 400))
		try("skill", Skills["Blasting Cyclone"].entry, (IsShiftKeyDown() and PlayerMana >= 35))
		try("skill", Skills["Moon Cleave"].entry, (IsShiftKeyDown() and PlayerMana >= 50))
		try("skill", Skills["Air Tremor"].entry, (IsShiftKeyDown() and PlayerSecMana >= 2000 and PlayerSecManaPct > .15))


			try("skill", Skills["Charged Chop"].entry, PlayerSecMana >= 600)
			try("action", ManaPot, (IsTargetType{"boss"} and PlayerMana <= 10000))
			try("skill", Skills["Berserk"].entry, (IsTargetType{"boss"} and (not IsShiftKeyDown()) and PlayerMana >= 25))
			try("action", Caviar, (IsTargetType{"boss"} and ((not PlayerHasBuff("Caviar Sandwich")) or (PlayerHasBuff("Caviar Sandwich").time <= 3))))
			try("skill", Skills["Attack Weakener"].entry, TargetHasBuff("Vulnerable") and PlayerSecMana >= 900)	
			try("skill", Skills["Open Flank"].entry, TargetHasBuff("Vulnerable") and PlayerMana >= 10)
			try("skill", Skills["Savage Whirlwind"].entry, ((not IsAltKeyDown()) and PlayerSecMana >= 800))
			try("skill", Skills["Probing Attack"].entry, PlayerMana >= 30)
			try("skill", Skills["Slash"].entry, PlayerMana >= 30)
			try("skill", Skills["Enraged"].entry, IsTargetType{"boss"} and PlayerMana <= 20)
		end
    

	    if TargetIsDead then
        TargetUnit("")
        return
    end
          if (not GotTarget) or (not IsEnemy) then
        for i=1,10 do
            TargetNearestEnemy()
	if (not UnitMaster("target")) then
		break
		end
	end
	if UnitMaster("target") then TargetUnit("")
		end
        return
    end
end

4

Sunday, April 20th 2014, 12:10pm

Hey, I will have to try to recreate your crash, sorry reply has taken some time, I've been on easter vacation.

Just to clarify, you die and then click the fdiyce macro before resurrecting or after resurrecting to provoke the client crash?

Nice script btw, I have a few comments thats different in fdiyce with respect to 'normal' diyce:

  • You use quite high numbers in the PlayerHasBuff().time tests, I usually use like 5s to make sure I use a new Hero before the old one runs out, as you have put it u will use a new when old buff has 30s left.
  • If 'Manapot' is a phirius I'd prolly use a percentage instead. (PlayerManaPct)
  • If u use the 'ShiftHeld' instead of the 'IsShiftKeyDown' the lua call is only done once and result is cached => lower overhead
  • The whole targetting thing is in the plugins/Commands.lua: "target select [prev|next] [enemy|friend] [normal|only players|no pets|custom] [custom function]".


Source code

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


Regards,
Frafall

This post has been edited 1 times, last edit by "frafall" (Apr 20th 2014, 6:49pm)


5

Sunday, April 20th 2014, 11:53pm

I am getting crash when I die... Simply I spam my DIYCE during boss fight, get big hit, that makes me dead, and bam I am on windows desktop, actually no crash pop up, just forced game close.

Mana pot is from craft, as it wouldn't be possible to have that many phirus pot, well it wouldn't be back in KBN... As for buff times... From skills I prefer it to be clicked before boss fight, potions and food, well without DIYCE I am clicking even more... Well even with it I usually take full set before boss fight... Generally whole buff part for me is just to make sure, as most of the time I am applying each one manually.

And THX for the tips ;)

This post has been edited 2 times, last edit by "pietroasp" (Apr 21st 2014, 12:01am)


6

Thursday, April 24th 2014, 4:29pm

Hi every time when trying to run Default skrypt warriorwarden ,client stopped working.

eguner

Beginner

Posts: 15

Location: Türkiye

  • Send private message

7

Wednesday, April 30th 2014, 8:27am

Hi every time when trying to run Default skrypt warriorwarden ,client stopped working.
same as me, by my scout warden script, i both try /fdiyce Attack and /fdiyce ScoutWarden

8

Friday, May 2nd 2014, 3:03pm

For me last revision is not crashing anymore... And from what I know so far, FD is not working if you have new installation of ROM client... mine is like 3y old

9

Sunday, May 4th 2014, 1:18pm

I have identified and fixed a severe bug in the skills reading code which resulted in skills not being read in correctly.

This would have resulted in FD crashing client erratically.

My biggest question would be why it worked for me.

Can some1 who experienced issues please test v0.3 and give me some feedback?


The major issue with FD atm is the voulnerability in the skills system, it results in instant client crash. I am looking into this to see how we can avoid this and get some nice error messages instead.

-frafall

10

Sunday, May 4th 2014, 3:17pm

Skills table

Version 0.31 published.

Changes:
  • Added metatable to the Skills table to catch any non-existing skills references which has caused a lot of crashes, now we should get out a nice error message instead.


-frafall

11

Sunday, May 4th 2014, 7:55pm

Yes I have Checked 0.31 version, and still after calling the dafault script ' warriourwarden', client was instantly closing.
It wasn't a crash client was shutting down.

eguner

Beginner

Posts: 15

Location: Türkiye

  • Send private message

12

Tuesday, May 6th 2014, 11:21am

Yes I have Checked 0.31 version, and still after calling the dafault script ' warriourwarden', client was instantly closing.
It wasn't a crash client was shutting down.
yea same as me, still crushing after update

13

Tuesday, May 6th 2014, 3:05pm

Crashing

Damn, I tried to re-create by installing FD 0.31 on a fresh client install without any other addons but no luck, it still worked.

Can one (or both) of you supply me with a list of addons you use, there might be a collition somehow.

regards
Frafall

14

Tuesday, May 6th 2014, 10:56pm

Glad to see FD is not dead ^^, thanks for keeping this project alive frafall, will look foward into testing it out when i get back home.
Roxzincrazy r/wd/s/m 87/85/85/85 | Crazybr wd/d 85/63
Roxzin m/wl 85/70 | Roxzn ch/m/r/w 87/70/70/70

eguner

Beginner

Posts: 15

Location: Türkiye

  • Send private message

15

Wednesday, May 7th 2014, 8:22am

i have found my mistake, some warrior mage code in my scoutwarden script cause instand closing client. :minigun:

i need some help for adding autoshot in script.

PHP Source code

1
2
3
local a1,a2,a3,a4,a5,ASon GetActionInfo(20)  -- # is your Autoshot slot number

name "Autoshot",                     use = (not ASon) },



this is diyce 2.0 code for autoshot....

eguner

Beginner

Posts: 15

Location: Türkiye

  • Send private message

16

Wednesday, May 7th 2014, 11:44am

Adding combat scripts:
Write a script, there are some examples in the Addons/FuzzyDIYCE/scripts directory
Add your script to the Addons/FuzzyDIYCE/scripts directory
Add your script to the "InitPlugin" part of the Addons/FuzzyDIYCE/scripts/RegisterPlugin.lua
Relog
Now your script should be available to use as "/fdiyce YourScriptname"
Note, if you name your combat function as "MainclassSecondaryclass" it will also be available for the Attack plugin and you can call it as "/fdiyce Attack"
ScoutWarden.lua in C:\Runes Of Magic\interface\addons\FuzzyDIYCE\scripts


RegisterPlugin.lua


---- Function to initialize the plug-in
-- Add new user defined scripts to this list
--
local function InitPlugin()
api.FDLoad(PLUGIN_PATH..PLUGIN_FOLDER.."DummySkill.lua")
api.FDLoad(PLUGIN_PATH..PLUGIN_FOLDER.."ScoutWarden.lua")
end
-- Register the plug-in with FuzzyDIYCE.
fdp.RegisterPlugin(PLUGIN_NAME, InitPlugin, ON_DEMAND, PLUGIN_PRIORITY)


but i still have " No attack script for ScoutWarden" , how can i register my attack script? do i missed something? :dash:

This post has been edited 6 times, last edit by "eguner" (May 7th 2014, 11:52am)


17

Thursday, May 8th 2014, 2:10pm

There are a couple of things that might result in this:
  • There might be a lua bug in your ScroutWarden script, this will result in it not being loaded. To check for this I usually do a "lua ScoutWarden.lua" in a windows cmd window, this will report any syntax errors, if it reports "attempt to index local 'fd' (a nil value)" it is syntactically ok.
  • Another way to check your script is to print out the table 'FuzzyDIYCE.Scripts.compiled' which contains all the loaded scripts with the script name as a key. If its not there its not loaded.
  • You have two options to run a script, one is the direct method "/fdiyce ScoutWarden", the other is "/fdiyce Attack". The latter is just a plugin that enables using the same macro on multiple classes. If your in doubt you can use the first to test.
  • And finaly, there might be a bug in core FD thats triggered by your script, to check out functionality of core you can do a "/fdiyce DummySkill" which will print out the skills table and do some rudimentary tests (only tests for incorrect skill handling for now).


I typically insert some debug code by using the following when necessary in my scripts:

Source code

1
2
3
4
5
local fdvars = fd.FDVars

if fdvars.Debug then
	api.FDMsg("Some debug message")
end


Then, to enable debugging you enter the "Interface Settings" menu (by pressing escape in-game), select "FuzzyDIYCE" and tick off "Debug" button.

-frafall

P.S. Also remember that FD uses the call UseSkill deep down...this is not available from command line, only from macros. I.E To test, make sure u call FD from a macro.

This post has been edited 1 times, last edit by "frafall" (May 8th 2014, 4:08pm)


18

Thursday, May 8th 2014, 4:52pm

Version 0.33

I've pushed new version, the major changes are some new commands:

  • /fdiyce list - this will list the loaded combat scripts
  • /fdiyce reload - this will reload the existing combat scripts. I.E. you dont have to restart client every time you modified the combat script AND you get a nice error in chat if you have syntax issues in script. Note you will still have to restart client for changes in RegisterPlugin, i.e. for new combat scripts.
  • /fdiyce help....


-frafall

eguner

Beginner

Posts: 15

Location: Türkiye

  • Send private message

19

Friday, May 9th 2014, 7:42am

i have tried what u tell but still couldnt register my script.

will u register a scoutwarden, wardenscout and rogue scout script templates for next FDiyce release please?

p.s. scripts contain just 1 skill such as shot , rogue combo or charged chop for warden, ill develop scripts and share on this threat.

20

Friday, May 9th 2014, 1:51pm

I can make templates for all (most?) classes but I will have to depend on you guys to make the actual content.

-frafall