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.

ghostwolf82

Professional

  • "ghostwolf82" started this thread

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,301

Sunday, February 16th 2014, 9:13pm

Heading in to work, so either I can elaborate more on this later, or BM can pick up on what I'm about to say and elaborate for me. First, you need to properly encapsulate when you are searching for a buff/debuff. Second, there is a way to check for someone's class, and you should be checking that first before looking for a buff to make the engine fire through the code at a faster rate. The less checks it has to do upon each pass, the faster/more efficient DIYCE is.

1,302

Sunday, February 16th 2014, 9:22pm

Thanks, Xamd. All CD statements have been removed.

I tweaked what you submitted and put it into a function:

Source code

1
2
3
4
5
6
7
8
9
function IsHidden (arg1)
	local hide = false 
		for i =1,50 do 
			if UnitBuff("target", i) == "Hide" then 
				hide = true    
			end 
		end 
	return hide
end


What is wierd is that it works when I call it this way:

Source code

1
{name = "Hide Scent",use = IsHidden },


But it does not work this way:

Source code

1
2
3
4
if (enemy and (mode == "DPS") and IsHidden) then
Skill2 = {
	{ name = "Hide Scent", use = true },
		}


Anyways, I think it is working now. Thanks again.
I don't support 1 Server. I just like the Anagram - GOAT GRIP!

1,303

Sunday, February 16th 2014, 9:44pm

Re-reading things I'm not sure why that doesn't work, but one possible reason is because you're not actually calling your function IsHidden.
You need to call it IsHidden(arg1) as you have defined, properly, for it to actually return what you want. Otherwise you're using the function itself (and not the returned value) for the boolean operations.

This post has been edited 1 times, last edit by "BlankMinded" (Feb 16th 2014, 9:52pm)


hangman04

Savage Warrior

Posts: 113

Location: Romania

Mood: Smile

  • Send private message

1,304

Monday, February 17th 2014, 9:36am

try smth like this :

Source code

1
local hidden = IsHidden()


and it will get either true or false. Then

Source code

1
2
3
4
if (enemy and (mode == "DPS") and (hidden) ) then
Skill2 = {
	{ name = "Hide Scent", use = true },
		}

or

Source code

1
2
3
4
if (enemy and (mode == "DPS")  ) then
Skill2 = {
	{ name = "Hide Scent", use = (hidden) },
		}


It all depends on that u want.

1,305

Tuesday, February 18th 2014, 2:41pm

Not the right place for that discussion. Make a new thread or post in an existing one. As previously linked,
please read regarding diyce vs botting here: Discussion: Is the use of DIYCE botting?
There's much discussion relating to your question/view/belief/opinion/w/e you wanna call it in there.

1,306

Tuesday, February 18th 2014, 3:06pm

Figure I'd post my Rogue/Knight for 2.X+; Only problem I'm having is I should probably move Lion's Protection above Power of Lion, but to lazy at the moment.


Source code

1
2
3
4
5
6
            			--Class: Rogue/Knight			if mainClass == "THIEF" and subClass == "KNIGHT" then				--Timers for this class					CreateDIYCETimer("SSBleed", 8.8) --Change the value between 6 -> 7.5 depending on your lag.					CreateDIYCETimer("LBBleed", 8.8) --Change the value between 7 ->  8.5 depending on your lag.                                --goat2: 0 = Burns, 1 = Main/Melee


            			if (goat2 == "0") then          			  Skill = {              				  { name = "Informer",                           use = ((not pbuffs['Informer'])) },            			          { name = "Fervent Attack",                     use = ((not pbuffs['Strong Stimulant'])) },               				  { name = "Assassins Rage",                     use =  (true) },                				    }
            			elseif (goat2 == "1") then		--Cures			Skill = {				{ name = "Holy Light Protection",			use = (pdebuffs["Lightning"]) },				{ name = "Courageous Guard",				use = ((pdebuffs["Horror"]) or (pdebuffs["Fear"]) or (pdebuffs["Terror"]) or (pdebuffs["Flame Burn"]))  },				{ name = "Poison Protection",				use = (pdebuffs["Poison"]) },				{ name = "Action: 21 (Escape)",			        use = ((pdebuffs[500735]) or (pdebuffs["Entangle"]) or (pdebuffs["Movement Restriction"]) or (pdebuffs["Lightning"]) or (pdebuffs[500223])) },				{ name = "Action: 23 (Gloves)",			        use = ((pdebuffs[500735]) or (pdebuffs["Entangle"]) or (pdebuffs["Movement Restriction"]) or (pdebuffs["Lightning"]) or (pdebuffs[500223])) },			--Heals				{ name = "Power of the Lion",				use = (phealth <= .80) and (pctEB2 >= .05) and (pbuffs[620316]) },				{ name = "Action: 61 (Herb)",			        use = (phealth <= .60) },				{ name = "Action: 43 (HP Pot)",			        use = (phealth <= .60) },
			--Buffs				{ name = "Lion's Protection",				use = (pctEB2 >= .05) and ((not pbuffs[620316]) or (pbuffs[620316].time <= 45)) },				{ name = "Searing Light",				use = (pctEB2 >= .05) and ((not pbuffs[503268]) or (pbuffs[503268].time <= 45)) },				{ name = "Enhanced Armor",				use = (pctEB2 >= .05) and ((not pbuffs[500141]) or (pbuffs[500141].time <= 45)) },				{ name = "Action: 13 (Unknown Choice)",				        use = (not combat) },				{ name = "Hide",				        use = (not combat) and (not pbuffs[500675]) },					}				end			--Combat				if ((enemy) and (goat2 == "1")) then				Skill2 = {					 { name = "Strike of Punishment",	        use = (pctEB2 >= .01) and not ((tbuffs[500223]) or (tbuffs[500735]))  },					 { name = "Shadow Prison",		        use = (EnergyBar1 >= 65) and not ((tbuffs[500223]) or (tbuffs[500735])) },					 { name = "Blind Stab",				use = (EnergyBar1 >= 25) and not ((tbuffs[500223]) or (tbuffs[500735]) or (tbuffs[500691])) },					 { name = "Wound Attack",			use = (EnergyBar1 >= 35) and (tbuffs[620313]) and (tbuffs[500704]) },					 { name = "Low Blow",				use = (EnergyBar1 >= 25) and (tbuffs[620313]) and (not tbuffs[500704]),	timer = "LBBleed" },					 { name = "Shadowstab",				use = (EnergyBar1 >= 20) and (not tbuffs[620313]),	timer = "SSBleed" },					 { name = "Shadowstab",				use = (EnergyBar1 >= 20) },					 { name = "Attack",				use = (thealth == 1) },												}				end				
Artemis-Corruption;
Vhailder = P/R/M
Ladykaori = R/K/S

hangman04

Savage Warrior

Posts: 113

Location: Romania

Mood: Smile

  • Send private message

1,307

Tuesday, February 18th 2014, 3:17pm

crap made a 500w reply to Joshua :/

1,308

Wednesday, February 19th 2014, 1:51am

Hello ppl, is there any advice how to force diyce or make macro to use skill why i move, or to use some skill only when i dont move, without notifying u need to stand to cast blabla...? Tnx for help in advance and happy lvling this days :P

1,309

Wednesday, February 19th 2014, 5:03am

Not sure if it can be put into DIYCE but I think this thread will help: Toggle click to move with macro

ghostwolf82

Professional

  • "ghostwolf82" started this thread

Posts: 859

Location: Kalvans Trunk

Occupation: It's dark in here

  • Send private message

1,310

Friday, February 21st 2014, 5:43am

There is a very long and convoluted way to get the code to know if you are moving or standing still, but due to a severe lack of use it was something which we never fully chased down and got locked into place. If you read through the original diyce thread you can find traces of where we talked about it, and if you are good at working in the code you can engineer the process we were working on with some relative degree of ease. There is also a way to make sure you are in range of a mob or a player to cast a skill that was worked out in the original party healer thread (which was lost...), so if you tear that addon apart you can figure that out as well.

1,311

Tuesday, February 25th 2014, 9:36pm

Hi ,i just installed diyce and im gonna ask a really dumb question . Where do u write the text .i have notebook . Do u write it in the toc file..and do u have to go to a blank page by going to the file option? if that makes any sense. plz help:)

1,312

Tuesday, February 25th 2014, 9:38pm

Customfunction.lua download notepad++ its better software for writing codes :)

1,313

Tuesday, February 25th 2014, 9:49pm

i wanna use the wd/rogue text he has in the customllua....when i open that custom lua with notepad it has a whole lot of other classes info and what not do i go to file at top of page for blank page to write on...im confused sorry or do i just have to do nothing and just /runKillSequence in game

Cike

Rogue

Posts: 4,171

Occupation: Being Human

  • Send private message

1,314

Tuesday, February 25th 2014, 10:03pm

i wanna use the wd/rogue text he has in the customllua....when i open that custom lua with notepad it has a whole lot of other classes info and what not do i go to file at top of page for blank page to write on...im confused sorry or do i just have to do nothing and just /runKillSequence in game
i will try and answer your question to the best of my knowledge, hopefully rale will tell me where i am wrong :P

the scripts in the customfunction.lua are ALL the scripts that diyce can call up when you use it. it will check your classes, and automatically go to the correct script. when you are on wdn/r, using the killsequence macro will call up the wdn/r specific script. switch classes, and diyce will automatically use whatever script that is saved for your class combo. to edit a script, you just go into customfunctions.lua and edit whatever section that matches the combo you are trying to adjust...




edit: do you have to "load" diyce after you switch combos/relog(to get the classes and skills from skillbook)? or just run the macro? never was too clear on that part...
my r/p can outdps r/m. your name is stupid.

mages should stack dex. word.

1,315

Tuesday, February 25th 2014, 10:12pm

i wanna use the wd/rogue text he has in the customllua....when i open that custom lua with notepad it has a whole lot of other classes info and what not do i go to file at top of page for blank page to write on...im confused sorry or do i just have to do nothing and just /runKillSequence in game
You do not need to do anything special. Go to the first page of this thread and READ THE INSTRUCTIONS. All you need to do is put class function into Customfunctions.lua (since you want to use one already present, you don't need to do anything) and run macro in game.

Please read at least the front page before asking other questions, else my responses will not be so kind.

@ Cike, you do not need to refresh/reload. One Macro for all classes. Diyce checks your class combination and uses the apporpriate (if it exists) skill table you defined everytime you run the macro (i.e any changes of classes, even if they were magically mid combat wouldn't change anything or require special attention).

hangman04

Savage Warrior

Posts: 113

Location: Romania

Mood: Smile

  • Send private message

1,316

Sunday, March 30th 2014, 11:30pm

i have another macro related problem:

/run _,cd = GetSkillCooldown(3,1) a = GetActionUsable(27)
if (a == 1) then UseAction(27)
elseif (cd <= 0.1) then UseAction(3)
else KillSequence()
end

this does't work. Basically it skips the 1st if and only rotates between option 2 and 3, although option 1 is valid.
When i tried this version:
/run _,cd = GetSkillCooldown(3,1) a = GetActionUsable(27)
if (a == 1) then UseAction(27)
else KillSequence()
end

it also works perfectly.

Any ideas?

1,317

Monday, March 31st 2014, 3:29am

"It also works perfectly" --- I'll ignore the word also in this statement. I'm assuming the first macro doens't work and the second one does....or maybe neither work? Idk...anyways.

Firstly, unless there is more to this code/macro then what you have posted, I suggest declaring the variables as locals. This will help prevent any conflicts with other global variables possibly named " cd ".

Secondly, GetActionUsable might be causing issues. It is kind of hard to check, since it does not check cooldown, it only checks (seperate from cooldown) if you could actually use the action in that slot number. Forexample, if you use GetActionUsable on a consumable item it always returns true. If you are a w/wd and use GetActionUsable() on a wd/s skill, it will return false.

Thirdly, and probably the main problem of your macro is the line

Source code

1
if (a == 1) then UseAction(27)


What you are comparing here is a boolean -- "a" -- which is either true or false, to a number. In some languages this is okay, but in LUA it returns false always. You can verify in game by

Source code

1
2
/run SendChatMessage(tostring(true == 1), "SAY")
/run SendChatMessage(tostring(false == 1), "SAY")

or by just reading up on boolean values in lua.

Try using

Source code

1
/run local _,CD = GetSkillCooldown(3,1) local usable = GetActionUsable(27) if usable then UseAction(27) elseif (CD <= 0.1) then UseAction(3) else KillSequence() end

This post has been edited 1 times, last edit by "BlankMinded" (Mar 31st 2014, 3:35am)


hangman04

Savage Warrior

Posts: 113

Location: Romania

Mood: Smile

  • Send private message

1,318

Monday, March 31st 2014, 9:47am

ty, i'll check it later!

1,319

Thursday, April 10th 2014, 2:44am

does anyone know the code to equip a set of items? with 1 press of diyce? for example

UseItemByName("Aoth Salvation Ring") and UseItemByName("Aoth Salvation Necklace") and UseItemByName("Aoth Salvation Earring")

But it only equiped the last item on the list

I got it to work using this=method...but it requires a press for each piece of gear and i would like to accomplish it in one press

if GetCountInBagByName("Aoth blah1") > 0 then
UseItemByName("Aoth blah1")
return true
end

if GetCountInBagByName("Aoth blah2") > 0 then
UseItemByName("Aoth blah2")
return true
endthank you for any assistance

This post has been edited 1 times, last edit by "dreamweaver537" (Apr 10th 2014, 2:49am)


1,320

Thursday, April 10th 2014, 3:10am

If all you're doing is swapping accessories I'd just recommend putting it in a plain old macro. Or make 2 diyce macros -- one of which looks like

Source code

1
2
/equip my random items
/run KillSequence()


and another just the regular version. That's my suggestion at least -- there are ways to do this within the addon but I don't particularly see why swapping accessories would be needed. I'd understand it for a k/r swapping shield for offhand weapon, and back again though. The reason I suggest doing it outside of diyce is to avoid having to create timers -- you can just use /wait. Although newer version of Diyce DO have timers that you can build, but I'm not sure how to use them outside of a skill table...

As for simply equipping items outside of diyce, if you're only changing a few, you were on the right track.

Source code

1
2
3
4
5
6
7
/run UseItemByName("Lyong's Helmet")
/wait 0.3
/run UseItemByName("Lyong's Chainmail")
/wait 0.3
/run UseItemByName("Lyong's Boots")
/wait 0.3
/run UseItemByName("Lyong's Shoulder Guards")


does exactly what it appears to do. If you have only 1 of each item in your backpack/transmuter, you can have them in any slot and will equip them -- no need to keep them in specific bag slots. If you have more then 1, you will have to have the items you want to equip "before" the other ones. Hope that makes sense.

This post has been edited 4 times, last edit by "BlankMinded" (Apr 10th 2014, 3:22am)