Guest User

Untitled

a guest
Dec 11th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.97 KB | None | 0 0
  1. WoWObject untiled = (from o in ObjectManager.GetObjectsOfType<WoWUnit>(true,true)
  2.     where o.Name == "Untilled Soil"
  3.     orderby o.Distance ascending
  4.     select o).FirstOrDefault();
  5. if (untiled != null) {
  6.     Log("Tilling soil...");
  7.     untiled.Interact();
  8.     Thread.Sleep(500);
  9. }
  10.  
  11. WoWUnit tiled = (from o in ObjectManager.GetObjectsOfType<WoWUnit>(true,true)
  12.     where o.Name == "Tilled Soil"
  13.     orderby o.Distance ascending
  14.     select o).FirstOrDefault();
  15. if ( tiled != null) {
  16.     Log("Planting seed...");
  17.     tiled.Target();
  18.     Thread.Sleep(100);
  19.     Lua.DoString("UseItemByName(80591)");
  20.     Thread.Sleep(100);
  21. }
  22.  
  23. if ( tiled == null && untiled == null ) {
  24.  
  25.     WoWUnit parched = (from o in ObjectManager.GetObjectsOfType<WoWUnit>(true,true)
  26.         where o.Name == "Parched Scallions"
  27.         orderby o.Distance ascending
  28.         select o).FirstOrDefault();
  29.     if ( parched != null ) {
  30.         Log("Found Parched Scallions");
  31.         parched.Target();
  32.         Lua.DoString("UseItemByName(79104)");
  33.     }
  34.  
  35.     WoWUnit growing = (from o in ObjectManager.GetObjectsOfType<WoWUnit>(true,true)
  36.         where o.Name == "Growing Scallions"
  37.         orderby o.Distance ascending
  38.         select o).FirstOrDefault();
  39.     if ( growing!= null ) {
  40.         Log("Found Growing Scallions");
  41.         growing.Target();
  42.         Lua.DoString("UseItemByName(89880)");
  43.         Thread.Sleep(100);
  44.     }
  45.    
  46.     WoWUnit wiggling = (from o in ObjectManager.GetObjectsOfType<WoWUnit>(true,true)
  47.         where o.Name == "Wiggling Scallions"
  48.         orderby o.Distance ascending
  49.         select o).FirstOrDefault();
  50.     if ( wiggling!= null ) {
  51.         Log("Found Wiggling Scallions");
  52.         wiggling.Interact();
  53.         Thread.Sleep(100);
  54.     }
  55.    
  56.     WoWUnit alluring = (from o in ObjectManager.GetObjectsOfType<WoWUnit>(true,true)
  57.         where o.Name == "Alluring Scallions"
  58.         orderby o.Distance ascending
  59.         select o).FirstOrDefault();
  60.     if ( alluring != null ) {
  61.         Log("Found Alluring Scallions");
  62.         alluring.Interact();
  63.         Thread.Sleep(100);
  64.     }
  65.    
  66.     WoWUnit infested = (from o in ObjectManager.GetObjectsOfType<WoWUnit>(true,true)
  67.         where o.Name == "Infested Scallions"
  68.         orderby o.Distance ascending
  69.         select o).FirstOrDefault();
  70.     if ( infested != null ) {
  71.         Log("Found Infested Scallions");
  72.         infested.Target();
  73.         Lua.DoString("UseItemByName(80513)");
  74.         Thread.Sleep(100);
  75.     }
  76.    
  77.     WoWUnit runty = (from o in ObjectManager.GetObjectsOfType<WoWUnit>(true,true)
  78.         where o.Name == "Runty Scallions"
  79.         orderby o.Distance ascending
  80.         select o).FirstOrDefault();
  81.     if ( runty != null ) {
  82.         Log("Found Runty Scallions");
  83.         runty.Interact();
  84.         Thread.Sleep(1000);
  85.         WoWMovement.Move(WoWMovement.MovementDirection.JumpAscend);
  86.         Thread.Sleep(300);
  87.         WoWMovement.MoveStop(WoWMovement.MovementDirection.JumpAscend);
  88.     }
  89.    
  90.     WoWUnit wild = (from o in ObjectManager.GetObjectsOfType<WoWUnit>(true,true)
  91.         where o.Name == "Wild Scallions"
  92.         orderby o.Distance ascending
  93.         select o).FirstOrDefault();
  94.     if ( wild != null ) {
  95.         Log("Found Wild Scallions");
  96.         wild.Interact();
  97.         do {
  98.             Lua.DoString("CastPetAction(1)");
  99.             Thread.Sleep(100);
  100.         } while (Lua.GetReturnVal<bool>("return  UnitUsingVehicle(\"player\")", 0));
  101.         Thread.Sleep(300);
  102.     }
  103.    
  104.     WoWUnit tangled = (from o in ObjectManager.GetObjectsOfType<WoWUnit>(true,true)
  105.         where o.Name == "Tangled Scallions"
  106.         orderby o.Distance ascending
  107.         select o).FirstOrDefault();
  108.     if ( tangled != null ) {
  109.         Log("Found Tangled Scallions");
  110.         tangled.Interact();
  111.         Thread.Sleep(300);
  112.         Navigator.MoveTo(new WoWPoint(-187.7984, 627.1614, 165.5227));
  113.         Thread.Sleep(10000);
  114.         Navigator.MoveTo(new WoWPoint(-173.2856, 640.6902, 165.4093));
  115.     }
  116. }
Add Comment
Please, Sign In to add comment