Recent Topics

Ads

[Addon] GatherButton

Here you can post addons, or anything related to addons.
Forum rules
Before posting on this forum, be sure to read the Terms of Use
User avatar
Golaz
Posts: 18

Re: [Addon] GatherButton

Post#11 » Fri Jul 26, 2019 4:18 am

Thanks for a fantastic addon. No lag from this one like Miracle Grow Remix that made your game stutter more and more for each time you had harvest the seeds. So not only better but easier. Just click one button to harvest and replant. Fantastic :D

Ads
User avatar
Taz83
Posts: 87
Contact:

Re: [Addon] GatherButton

Post#12 » Thu Oct 03, 2019 4:50 pm

very laggy and alot of game crush this addon need some rework and fixes

User avatar
wdesu
Posts: 66

Re: [Addon] GatherButton

Post#13 » Thu Oct 17, 2019 12:47 am

Hello everyone.

Sorry, I see that some people experience troubles with the addon while other people seem to have it working okay. I am not sure why this is happening. There may be a conflict with another addon (I don't know what would result in the conflict though). Or, uh. I dunno, maybe my code is just wrong somewhere and I just don't see it. (I will always welcome a patch/pull request or a fork, especially since I don't currently play the game.) Maybe I should add a poll to actually see how many people have problems.

Anyways, I can't reproduce the lags/crashes. Works on my machine ;)

I updated the OP and posted 1.0.1 version with mostly code refactoring/formatting changes. If you had troubles, it probably won't fix these.

User avatar
Akalukz
Posts: 1587

Re: [Addon] GatherButton

Post#14 » Thu Oct 31, 2019 2:38 pm

the problem i have is that it takes over control of all my macros. It doesn't change any, but at the same time I can't go in and add or change any myself.
-= Agony =-

User avatar
wdesu
Posts: 66

Re: [Addon] GatherButton

Post#15 » Wed Nov 06, 2019 1:18 am

Akalukz wrote: Thu Oct 31, 2019 2:38 pm the problem i have is that it takes over control of all my macros. It doesn't change any, but at the same time I can't go in and add or change any myself.
Oh, that's the strangest one yet. I played a bit on my profile, and on a new profile with only my addon enabled, but I didn't encounter any problems with the macro window. Does the addon break the 'Save' button? Can you press 'Save' and it just doesn't save the new name/text values? Or does it break the text/name fields? Or something I didn't think of?

Here's the related macro code:

Code: Select all

function GatherButton.GetMacroId(text)
	local macros = DataUtils.GetMacros()

	for slot = 1, EA_Window_Macro.NUM_MACROS do
		if macros[slot].text == text then
			return slot
		end
	end

	return nil
end

function GatherButton.SetMacro(slot, name, text, iconId)
	SetMacroData(name, text, iconId, slot)
	EA_Window_Macro.UpdateDetails(slot)
end

function GatherButton.CreateMacro(name, text, iconId)
	--[[find macro by text and return it (and also reset its icon and name). 
		or make a new one.
	--]]

	local slot = GatherButton.GetMacroId(text)
	if (slot) then
		GatherButton.SetMacro(slot, name, text, iconId) -- set icon and name
		return slot
	end

	local macros = DataUtils.GetMacros()
	for slot = 1, EA_Window_Macro.NUM_MACROS do
		if (macros[slot].text == L"") then
			GatherButton.SetMacro(slot, name, text, iconId)
			return slot
		end
	end

	return nil
end

function GatherButton.SetMacroName(newname)
	GatherButton.SetMacro(MACRO_ID, newname, MACRO_TEXT, ICON)
end
(newer revision (the only new thing is status messages): https://gitlab.com/cupnoodles14/gatherb ... n.lua#L377 )

There are 4 places where I interact with the macro system:
  • call and read the result of DataUtils.GetMacros()
  • read EA_Window_Macro.NUM_MACROS
  • call SetMacroData(name, text, iconId, slot)
  • call EA_Window_Macro.UpdateDetails(slot)
None of it should result in the described behavior. I could just comment out parts of code and hope that it fixes the problem but I can't do it because I can't reproduce the issue, sorry.

By the way, the standard macro window has a bug in .xml with two rows of macros overlapping (see weird inconsistent borders on the picture). If you don't see a macro created by the addon, it's possible that it was created in these cells.
Spoiler:
Image

User avatar
Akalukz
Posts: 1587

Re: [Addon] GatherButton

Post#16 » Wed Nov 06, 2019 1:52 pm

wdesu wrote: Wed Nov 06, 2019 1:18 am
Akalukz wrote: Thu Oct 31, 2019 2:38 pm the problem i have is that it takes over control of all my macros. It doesn't change any, but at the same time I can't go in and add or change any myself.
Oh, that's the strangest one yet. I played a bit on my profile, and on a new profile with only my addon enabled, but I didn't encounter any problems with the macro window. Does the addon break the 'Save' button? Can you press 'Save' and it just doesn't save the new name/text values? Or does it break the text/name fields? Or something I didn't think of?

Here's the related macro code:

Code: Select all

function GatherButton.GetMacroId(text)
	local macros = DataUtils.GetMacros()

	for slot = 1, EA_Window_Macro.NUM_MACROS do
		if macros[slot].text == text then
			return slot
		end
	end

	return nil
end

function GatherButton.SetMacro(slot, name, text, iconId)
	SetMacroData(name, text, iconId, slot)
	EA_Window_Macro.UpdateDetails(slot)
end

function GatherButton.CreateMacro(name, text, iconId)
	--[[find macro by text and return it (and also reset its icon and name). 
		or make a new one.
	--]]

	local slot = GatherButton.GetMacroId(text)
	if (slot) then
		GatherButton.SetMacro(slot, name, text, iconId) -- set icon and name
		return slot
	end

	local macros = DataUtils.GetMacros()
	for slot = 1, EA_Window_Macro.NUM_MACROS do
		if (macros[slot].text == L"") then
			GatherButton.SetMacro(slot, name, text, iconId)
			return slot
		end
	end

	return nil
end

function GatherButton.SetMacroName(newname)
	GatherButton.SetMacro(MACRO_ID, newname, MACRO_TEXT, ICON)
end
(newer revision (the only new thing is status messages): https://gitlab.com/cupnoodles14/gatherb ... n.lua#L377 )

There are 4 places where I interact with the macro system:
  • call and read the result of DataUtils.GetMacros()
  • read EA_Window_Macro.NUM_MACROS
  • call SetMacroData(name, text, iconId, slot)
  • call EA_Window_Macro.UpdateDetails(slot)
None of it should result in the described behavior. I could just comment out parts of code and hope that it fixes the problem but I can't do it because I can't reproduce the issue, sorry.

By the way, the standard macro window has a bug in .xml with two rows of macros overlapping (see weird inconsistent borders on the picture). If you don't see a macro created by the addon, it's possible that it was created in these cells.
Spoiler:
Image

I appreciate the response, I run a lot of addons so it could just be a conflict somewhere. I will try to get a video and share a link to it. It doesn't break any existing macros, but i can't create or change any either. I will try to do tonight. If you don't want to mess with it, no worries. Just thought it a weird occurence.
-= Agony =-

User avatar
sullemunk
Addon Developer
Posts: 1213

Re: [Addon] GatherButton

Post#17 » Wed Nov 06, 2019 2:44 pm

I suggest cheking your user folder and make sure the files and folders there are not write protected
Image
Image Ethreal   Image Corque   Image Urgiz   Image Loxley   Image Chilli   Image Maduza

User avatar
gerard86
Posts: 71

Re: [Addon] GatherButton

Post#18 » Sun Apr 05, 2020 5:07 am

this addon is absolutely amazing, is there a way to like flash the button if its time to gather? or any other way to inform the user visually if its time to gather?

Ads
Drewsephy
Posts: 8

Re: [Addon] GatherButton

Post#19 » Thu Apr 09, 2020 1:27 am

This addon was working great for me but lately it has been harvesting way too many seeds up to stacks of 40 seeds after a long RvR session. I checked the lua file and the seed count is set to 7 (default, I did not change any settings simply followed instructions to drag and drop the macros to hotbar)

Any help is appreciated!

User avatar
wdesu
Posts: 66

Re: [Addon] GatherButton

Post#20 » Fri Apr 17, 2020 5:46 pm

Drewsephy wrote: Thu Apr 09, 2020 1:27 am This addon was working great for me but lately it has been harvesting way too many seeds up to stacks of 40 seeds after a long RvR session. I checked the lua file and the seed count is set to 7 (default, I did not change any settings simply followed instructions to drag and drop the macros to hotbar)

Any help is appreciated!
Oh, it may be that I call Refine() without any guards preventing it from making 40 requests at once. In 1.0.2 I've added a limit of max pending refine requests and each second i decrement the counter of currently pending requests by 1 (as I don't know of a way to check if some requests were dropped). This seems like the most simple solution. The seed count will still fluctuate a bit but hopefully not by 40 seeds. Thanks for reporting it.
gerard86 wrote: Sun Apr 05, 2020 5:07 am this addon is absolutely amazing, is there a way to like flash the button if its time to gather? or any other way to inform the user visually if its time to gather?
Thanks. The macro button should have a glow effect by default, as I thought it was more noticeable than a flash. I've added a flash and also hacked together a notification setting by reusing some default UI components that I could think of (like chat/chat bubbles). It's disabled by default since I think such notifications may be a little too intrusive for some people.

I've updated the addon.
Source: https://gitlab.com/cupnoodles14/gatherbutton
Download: 1.0.2 release

Didn't test it very thoroughly though :D .

Who is online

Users browsing this forum: No registered users and 23 guests