This is what I have tried..
it seems to multiply the input.. not the output.
Code:object OnRecycleItem(Recycler recycler, Item item) { item.amount = (item.amount * 10); return null; // anything but null appears to cause the recycler to run aimlessly }
Changing return amount using OnRecycleItem?
Discussion in 'Rust Development' started by carny666, May 14, 2017.
-
My plugin RecycleManager for Rust | Oxide has an example of this i believe
-
Thank you.. perfect.
Code:object OnRecycleItem(Recycler recycler, Item item) { Item slot = item; double itemamount = Convert.ToDouble(slot.amount); int usedItems = 1; int multiplier = 5; if (slot.amount > 1) usedItems = slot.amount; slot.UseItem(usedItems); foreach (ItemAmount ingredient in slot.info.Blueprint.ingredients) { var def = ItemManager.FindItemDefinition(ingredient.itemid); PrintToChat(def.displayName.english); int outputamount = Convert.ToInt32(usedItems * ((Convert.ToDouble(ingredient.amount) * multiplier))); recycler.MoveItemToOutput(ItemManager.CreateByItemID(ingredient.itemid, outputamount, 0)); } return true; }