Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions TetherSE/Tether.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
Expand Down Expand Up @@ -88,26 +88,44 @@ public static void DoWelder(MyCharacter localPlayer)
public static void DoGrinder()
{
var inventory = (MyInventory)GetTargetedBlock.selectedBlock.GetInventory();
var toRemove = new List<MyPhysicalInventoryItem>();

foreach (var objectId in MySession.Static.LocalCharacter.GetInventory().GetItems())
{
if (!objectId.Content.GetObjectId().ToString().ToLower().Contains("ore") &&
!objectId.Content.GetObjectId().ToString().ToLower().Contains("ingot") &&
!objectId.Content.GetObjectId().ToString().ToLower().Contains("component")) continue;

MyConstants.DEFAULT_INTERACTIVE_DISTANCE = 10000;
MyInventory.TransferByPlanner(MySession.Static.LocalCharacter.GetInventory(), inventory, objectId.Content.GetObjectId(), MyItemFlags.None, objectId.Amount);

toRemove.Add(objectId);
MyConstants.DEFAULT_INTERACTIVE_DISTANCE = 10;
}

foreach (var item in toRemove)
{
MyInventory.TransferByPlanner(MySession.Static.LocalCharacter.GetInventory(), inventory,
item.Content.GetObjectId(), MyItemFlags.None, item.Amount);
}
}
public static void DoDrill()
{
var inventory = (MyInventory)GetTargetedBlock.selectedBlock.GetInventory();
var toRemove = new List<MyPhysicalInventoryItem>();

foreach (var objectId in MySession.Static.LocalCharacter.GetInventory().GetItems())
{
if (!objectId.Content.GetObjectId().ToString().ToLower().Contains("ore")) continue;
MyConstants.DEFAULT_INTERACTIVE_DISTANCE = 10000;
MyInventory.TransferByPlanner(MySession.Static.LocalCharacter.GetInventory(), inventory, objectId.Content.GetObjectId(), MyItemFlags.None, objectId.Amount);
toRemove.Add(objectId);
MyConstants.DEFAULT_INTERACTIVE_DISTANCE = 10;
}

foreach (var item in toRemove)
{
MyInventory.TransferByPlanner(MySession.Static.LocalCharacter.GetInventory(), inventory,
item.Content.GetObjectId(), MyItemFlags.None, item.Amount);
}
}
public static int ticks = 0;
}
Expand Down