Advertisement
sdini

code snippet farming bot

Mar 12th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.06 KB | None | 0 0
  1. if (obj.Name == "Chest")
  2.                 {
  3.                     Microsoft.Xna.Framework.Vector2 chestLocation = new Vector2();
  4.                     chestLocation = obj.TileLocation;
  5.  
  6.                     //if (location.Objects.ContainsKey(chestLocation) && location.Objects[chestLocation].Is<ChestAccessor>())
  7.                     //{
  8.                         try
  9.                         {
  10.                             Storm.StardewValley.Wrapper.Chest obj2 = location.Objects[chestLocation].As<ChestAccessor, Chest>();
  11.                             savedChest.Add(obj2);
  12.  
  13.                         } catch (Exception e)
  14.                         {
  15.                             Console.WriteLine();
  16.                             Console.WriteLine(e);
  17.                             Console.WriteLine();
  18.                         }
  19.                         //Debugger.Break();
  20.                         //find locations
  21.                        
  22.                         //debugging
  23.                         //chestLocation.X = obj.BoundingBox.X;
  24.                         //chestLocation.Y = obj.BoundingBox.Y;
  25.                         chestLocation.X = obj.BoundingBox.X / 64;
  26.                         chestLocation.Y = obj.BoundingBox.Y / 64;
  27.                        
  28.  
  29.                         //debuging
  30.                         Console.WriteLine();
  31.                         Console.WriteLine(chestCounter1 + 1 + " individual saved chest information");
  32.  
  33.                         try
  34.                         {
  35.                             Console.WriteLine(savedChest[chestCounter1].Items);
  36.                         }
  37.                         catch (Exception e)
  38.                         {
  39.                             Console.WriteLine();
  40.                             Console.WriteLine(e);
  41.                             Console.WriteLine();
  42.                         }
  43.  
  44.                         Console.WriteLine(location.Name);
  45.                         //Console.WriteLine("TILELOCATION x is " + obj.TileLocation.X + ". y is " + obj.TileLocation.Y);
  46.                         //Console.WriteLine("BOUNDINGBOX x is " + obj.BoundingBox.X + ". y is " + obj.BoundingBox.Y);
  47.                         //Console.WriteLine("Width is " + obj.BoundingBox.Width + ". Height is " + obj.BoundingBox.Height);
  48.                         //Console.WriteLine();
  49.  
  50.                         //Console.WriteLine("obj location at " + obj.BoundingBox.X + ", " + obj.BoundingBox.Y);
  51.                         //Console.WriteLine("obj location at " + obj.BoundingBox.X / 64 + ", " + obj.BoundingBox.Y / 64);
  52.  
  53.                         savedChestLocations.Add(chestLocation);
  54.                         Console.WriteLine("----------------");
  55.                         Console.WriteLine("Finding chests and saving location at " + chestLocation.X + ", " + chestLocation.Y);
  56.                         Console.WriteLine("----------------");
  57.  
  58.  
  59.                         Console.WriteLine(savedChestLocations.Count + " total chests found");
  60.                         ++chestCounter1;
  61.                         //Debugger.Break();
  62.                     //}
  63.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement