Recent Topics

Ads

MGRemix lags fix

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
Raito
Posts: 3

MGRemix lags fix

Post#1 » Thu Aug 27, 2020 8:18 pm

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)

Ads
User avatar
Akalukz
Posts: 1587

Re: MGRemix lags fix

Post#2 » Thu Aug 27, 2020 11:35 pm

woot
-= Agony =-

User avatar
Taz83
Posts: 87
Contact:

Re: MGRemix lags fix

Post#3 » Sun Sep 06, 2020 8:48 am

so what does this change really do no more auto reserve/convert or is it something else ?

kaloel
Posts: 17

Re: MGRemix lags fix

Post#4 » Sun Sep 06, 2020 10:10 am

First some indentation:

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
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.

Trsh
Posts: 9

Re: MGRemix lags fix

Post#5 » Sat Sep 12, 2020 10:34 am

is it intended that after this change my mgr shows as yellow in the addons list ?

User avatar
Natherul
Former Staff
Posts: 3154
Contact:

Re: MGRemix lags fix

Post#6 » Sat Sep 12, 2020 11:12 am

might be good for someone to post this edit into
https://tools.idrinth.de/addons/mgremix/

User avatar
Darks63
Posts: 651

Re: MGRemix lags fix

Post#7 » Sat Sep 12, 2020 8:16 pm

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.

Mcz
Posts: 54

Re: MGRemix lags fix

Post#8 » Fri Oct 02, 2020 10:17 am

Any chance to get a more detailed explanation please?

Ads
User avatar
lolwut
Posts: 29

Re: MGRemix lags fix

Post#9 » Sun Nov 15, 2020 3:49 am

If this fix makes MGR window shown with different textures, buttons unclickable and window unmovable in layout editor, put the code from
kaloel wrote: Sun Sep 06, 2020 10:10 amFirst some indentation:

Code: Select all

...
after the last line of MGRemix.lua
Ain't Nobody Gafflin Me.

User avatar
Eisboleas
Posts: 140

Re: MGRemix lags fix

Post#10 » Thu Apr 15, 2021 12:26 pm

lolwut wrote: Sun Nov 15, 2020 3:49 am If this fix makes MGR window shown with different textures, buttons unclickable and window unmovable in layout editor, put the code from
kaloel wrote: Sun Sep 06, 2020 10:10 amFirst some indentation:

Code: Select all

...
after the last line of MGRemix.lua
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]

Who is online

Users browsing this forum: Google Adsense [Bot] and 15 guests