MGRemix.lua search for function mg.function mg.GetSlotByItemId(uniqueID,aExclude) (uniqueID,aExclude) --around line 120
rename function to function mg.GetSlotByItemIdOld(uniqueID,aExclude)
copy paste this in the file:
mg.InvTable = {}
mg.InvTable_nTime=-1000
function mg.GetSlotByItemId(uniqueID,aExclude)
local vBagItems=DataUtils.GetCraftingItems()
local iSmall=10000
local iSlot=0
local nLoc=mg.TYPE_CRAFTING
local vItem
if (mg.nTime > mg.InvTable_nTime+5)then
mg.InvTable_nTime = mg.nTime;
mg.InvTable = {};
for k,v in pairs(vBagItems) do
mg.InvTable[v.uniqueID]=k;
end
end
if (mg.InvTable[uniqueID])then
iSlot = mg.InvTable[uniqueID];
vItem=vBagItems[iSlot];
end
return iSlot,nLoc,vItem
end
checks no longer normal inventory,saves inventory data for 5sec(use at own risk and have larger seed reserve)
MGRemix lags fix
Forum rules
Before posting on this forum, be sure to read the Terms of Use
Before posting on this forum, be sure to read the Terms of Use
Ads
Re: MGRemix lags fix
so what does this change really do no more auto reserve/convert or is it something else ?
Re: MGRemix lags fix
First some indentation:
It seems like this caches the inventory, to remove the lag when replanting (and auto converting). The cache lasts for 5 seconds, and affects every item that MGRemix is searching for, be it seeds or weeds. BUT it only searches the crafting bags, not the "normal" inventory. (Basically what the OP said, but with more style)
EDIT: Tried it and it seems to work.
Code: Select all
mg.InvTable = {}
mg.InvTable_nTime=-1000
function mg.GetSlotByItemId(uniqueID,aExclude)
local vBagItems=DataUtils.GetCraftingItems()
local iSmall=10000
local iSlot=0
local nLoc=mg.TYPE_CRAFTING
local vItem
if (mg.nTime > mg.InvTable_nTime+5)then
mg.InvTable_nTime = mg.nTime;
mg.InvTable = {};
for k,v in pairs(vBagItems) do
mg.InvTable[v.uniqueID]=k;
end
end
if (mg.InvTable[uniqueID])then
iSlot = mg.InvTable[uniqueID];
vItem=vBagItems[iSlot];
end
return iSlot,nLoc,vItem
end
EDIT: Tried it and it seems to work.
Re: MGRemix lags fix
is it intended that after this change my mgr shows as yellow in the addons list ?
Re: MGRemix lags fix
might be good for someone to post this edit into
https://tools.idrinth.de/addons/mgremix/
https://tools.idrinth.de/addons/mgremix/
Re: MGRemix lags fix
Does this mean if you have seeds in your normal inv it will no longer pull from there if you do this change?
Tourist SW 40/50+<Zaxxed> Discotec 40/40+<IRONIC>
Former Pragg/Badlands Destro Iron Rock/Badlands Order player.
Former Pragg/Badlands Destro Iron Rock/Badlands Order player.
Ads
Re: MGRemix lags fix
If this fix makes MGR window shown with different textures, buttons unclickable and window unmovable in layout editor, put the code from
after the last line of MGRemix.lua
Ain't Nobody Gafflin Me.
Re: MGRemix lags fix
Doesnt seem to work for me, any idea ?
"If you want to know who you are, you have to look at your real self and acknowledge what you see."
Darkenya [WE]
Darkenya [WE]
Who is online
Users browsing this forum: Bing [Bot] and 1 guest