Recycle

Recycle crafted items to base resources

Total Downloads: 3,965 - First Release: Aug 11, 2015 - Last Update: Apr 1, 2018

5/5, 12 likes
  1. This does not fix the problem
     
  2. I saw this in my console. I can't tell what was happening at the time.

    Code:
    (22:02:54) | Failed to call hook 'OnItemAddedToContainer' on plugin 'Recycle v2.1.0' (NullReferenceException: Object reference not set to an instance of an object)
      at Oxide.Plugins.Recycle.SalvageItem (.BasePlayer player, .Item item) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.Recycle.OnItemAddedToContainer (.ItemContainer container, .Item item) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.Recycle.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in <filename unknown>:0
     
  3. Code:
     [Error] Failed to call hook 'OnItemAddedToContainer' on plugin 'Recycle v2.1.0' (NullReferenceException: Object reference not set to an instance of an object)
      at Oxide.Plugins.Recycle.SalvageItem (.BasePlayer player, .Item item) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.Recycle.OnItemAddedToContainer (.ItemContainer container, .Item item) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.Recycle.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in <filename unknown>:0
    i see this error, if somebody trys recycling items which one u cant recycle, ex. Quarrys
     
  4. Same here:
    Code:
    [Error] Failed to call hook 'OnItemAddedToContainer' on plugin 'Recycle v2.1.0' (NullReferenceException: Object reference not set to an instance of an object)
      at Oxide.Plugins.Recycle.SalvageItem (.BasePlayer player, .Item item) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.Recycle.OnItemAddedToContainer (.ItemContainer container, .Item item) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.Recycle.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in <filename unknown>:0 
     
  5. Well, it appears like the MoegicBox.cs finally does not work. I literally was able to make changes as Rust changed to keep it going till today. However this time I have no idea. It now gets an error starting with EXCEPTION: An element with the same key already exists in the dictionary. The things I did were basic. I get that the plugin is done, and I do use this recycle.cs, but I liked the ability to /mlink and /mulink a real box.

    Could you add the old /mlink and /mulink functions to this version?
    It's the only thing needed.
    This gives the option for a player to put a small box under their level 3 workbench, or wherever, /mlink it once, and not have to type /rec while they're crafting, to go into their inventory screen. I use on a base building server where I often need to make a bunch of skinrandomizer.cs doors of a particular skin, and recycle all the undesired skins. Typing /rec in chat is cumbersome for that task.

    Of course /rec is great for out and about.

    You can rename /mlink and /mulink to /blink and /bulink.

    It would be appreciated to add those two commands.
     
  6. If you adjust the ratio, it changes what you get for resources, but not for scrap.

    Recycling 100 Tech Trash at a ratio of 0.5:
    • 520 scrap, 25 hqm
    Recycling 100 Tech Trash at a ratio of 1.0:
    • 520 scrap 52 hqm
    It would be great to control the scrap returned without upping the other items.
     
  7. Anyone able to help me understand why the recycle plugin will grant you 5 scrap and 2 hqm a road sign but if you do 100 road signs together it does 50 scrap and 20 hqm? I can't seem to get my refund ratio to even work in the config either, it does no change to it.

    --> 1 Road Sign Screenshot
    --> 100 Road Signs Screenshot
     
  8. on my server recycle only max 4 Items and lost norecycle items.
     
  9. So is there any way to fix this?
    Code:
    10:39 [Error] Failed to call hook 'OnServerInitialized' on plugin 'MoegicBox v1.0.4' (ArgumentException: An element with the same key already exists in the dictionary.)
      at System.Collections.Generic.Dictionary`2[System.String,ItemDefinition].Add (System.String key, .ItemDefinition value) [0x00000] in <filename unknown>:0
      at System.Linq.Enumerable.ToDictionary[ItemDefinition,String,ItemDefinition] (IEnumerable`1 source, System.Func`2 keySelector, System.Func`2 elementSelector, IEqualityComparer`1 comparer) [0x00000] in <filename unknown>:0
      at System.Linq.Enumerable.ToDictionary[ItemDefinition,String,ItemDefinition] (IEnumerable`1 source, System.Func`2 keySelector, System.Func`2 elementSelector) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.MoegicBox.OnServerInitialized () [0x00000] in <filename unknown>:0
      at Oxide.Plugins.MoegicBox.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in <filename unknown>:0
    See 4 messages up for when this started and my suggestion on May 3rd.

    The value of being able to make a box recycle is OP!

    Imagine you're a solo player and a big clan raids and harasses you.
    You're smart, and have enough hard earned resources to wipe their whole compound.
    The next day they come online, and all they see is a small box where their compound was.

    I was known for this to the point where as soon as someone saw their base missing and a recycle box in it's place, you'd see in chat: SNIVEL!!!!!!!

    I only did this to someone (everyone) that attacks me first, other than that I just gathered, built, and managed my quarrys.

    But I love the recycle box option. Also /rec STILL wont open 1 out of 3 times, and when it wont open, it can take 10 or more tries.
     
  10. Wulf

    Wulf Community Admin

    That error is from MoegicBox, not this plugin and isn't something this plugin would be controlling.
     
  11. I know this is the replacement for Moegic, but I hope to see if someone could add the /mulink and /mrec function to this.

    Or possibly give me a hint how to fix that error in moegic.

    Up till May 3rd, I used both plugins together.
     
  12. who i can create it? max 4 items?
     
  13. this is what I see..... and I don't know this programming language. but the file seems full of errors and full of things that don't belong... and fully commented sections.... A bunch of "F"s where they don't belong. Some nasty math to calculate some sort of scrap devaluation of an item as a convenience fee. I dub thee mod broken/incomplete. :(

    and lastly, this "CONTAINER" issue.

    to be blunt:

    if(mod.OhSweetMod.broken)fix
    else(find.fixerCoderGuy)


    below is what I think is wrong. don't quote me. I'm a noob.



    void OnItemAddedToContainer (ItemContainer container, Item item)

    if (container.playerOwner is BasePlayer)
    if (onlinePlayers.ContainsKey (container.playerOwner))
    BasePlayer owner = container.playerOwner;



    if ( containerS <=========== REMOVE THIS S, .ContainsKey (container))



    if (SalvageItem (owner, item))
    item.Remove (0f);
    item.RemoveFromContainer ();
    else
    ShowNotification (owner, GetMsg ("Recycle: Invalid", owner));
    item.MoveToContainer (owner.inventory.containerMain);
     
    Last edited by a moderator: Jun 12, 2018
  14. Wulf

    Wulf Community Admin

    That is not a fix, that will make the plugin no longer compile. The "containers" is the dictionary that is storing the containers, so the "s" is supposed to be there.
     
  15. Hello not sure if anyone could help me here. People on my server said they placed a vending machine and if they did /rec and recycled something all the vending machines would all break. Checked logs and saw no errors. I tried it myself and it does break them using /rec . Any one have any ideas?
     
    Last edited by a moderator: Jun 25, 2018
  16. Seems a few items, like ladders as well will break when you do something else close by. And that is in vanilla. Could be the temporary creation of a virtual recycle box has an effect on some items nearby. See if you recycle /rec near a ladder on a rock if it destroys the ladder.

    It might be another one of those "welcome to rust" things again.
     
    Last edited by a moderator: Jun 25, 2018
  17. IS this anything to worry about ?
    Code:
    (09:40:56) | Failed to call hook 'OnItemAddedToContainer' on plugin 'Recycle v2.1.0' (NullReferenceException: Object reference not set to an instance of an object)
    at Oxide.Plugins.Recycle.SalvageItem (BasePlayer player, Item item) [0x00095] in <cae7e4c9a39d4186975a22ea19df74fd>:0
    at Oxide.Plugins.Recycle.OnItemAddedToContainer (ItemContainer container, Item item) [0x00039] in <cae7e4c9a39d4186975a22ea19df74fd>:0
    at Oxide.Plugins.Recycle.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x003d0] in <cae7e4c9a39d4186975a22ea19df74fd>:0
    at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <2dad53883fcd4b7faaf900f511ce972a>:0
    at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <a178d34943f746dd9b92eeffb8beec48>:0
    at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <a178d34943f746dd9b92eeffb8beec48>:0
     
    Last edited by a moderator: Jul 6, 2018
  18. this error comes, if somebody trys recycling items which one u cant recycle, ex. Quarrys
     
  19. As I am not recycling items that I have not recycled before this should not occur, I am recycling sheet metal, weapons i dont need, and other items I do not need, If an object is non recyclable it just stays in the recycle box and you have to remove it.
     
  20. Pls help me... the plugin don't go on my server :(