public static IsCubeNearby ( |
||
CubeStand | ||
return | bool |
public static void DoUpgrade() { try { IsUpgrading_Rare = true; ActorCommonData CubeStand; bool CubeNearby = Tools.IsCubeNearby(out CubeStand); var UpgradableItems = Tools.Get_Items("rare"); int Count_AvailableEnchants = (int)Tools.Get_AvailableEnchants_UpgradeRare(); if (CubeNearby & UpgradableItems.Count > 0 & Count_AvailableEnchants > 0) { if (Tools.ClickOnCube(CubeStand)) { Stopwatch s1 = new Stopwatch(); ///////// s1.Start(); /////////// int Count_Enchants = 0; //receipe button A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Recipe_Button); Thread.Sleep(5); //press next button 2x for upgrade rare menu A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Page_Next); Thread.Sleep(5); A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Page_Next); Thread.Sleep(5); int numberOfItemsBeforeTrying = UpgradableItems.Count; //var a = UpgradableItems.Where(a => a.); foreach (var item in UpgradableItems) { if (StopConversion) { break; } if (Count_Enchants == Count_AvailableEnchants) { break; } Count_Enchants++; if (Tools.ClickOnCube(CubeStand)) { //put item in cube UIRect UIRect_item = A_Collection.D3UI.InventoryItemUIRectMesh.FirstOrDefault( x => x.Key.ItemSlotX == item.x118_ItemSlotX && x.Key.ItemSlotY == item.x11C_ItemSlotY).Value; A_Tools.T_D3UI.UIElement.rightClick(UIRect_item); //fill A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Fill_Button); //transmute A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Transmute_Button); Thread.Sleep(Properties.Settings.Default.SleepTransmute); //click next and back to reset A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Page_Next); A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Page_Previous); } } //close all windows int close_timeout = 5; while (Tools.IsKanaisCube_MainPage_Visible()) { //A_Tools.InputSimulator.IS_Keyboard.Close_AllWindows(); //doesnt work if not assigned :D //Press "X" - Button in Kanais Cube A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Exit_Button); close_timeout--; if (close_timeout == 0) { break; } Thread.Sleep(200); } s1.Stop(); ///////// TimeSpan t1 = s1.Elapsed; ////// Console.WriteLine(t1.TotalSeconds); //////// } } if (Properties.Settings.Default.RosBotUpgradeKadalaBool) { WindowsInput.InputSimulator.SimulateKeyPress(WindowsInput.VirtualKeyCode.F6); } IsUpgrading_Rare = false; } catch (Exception) { IsUpgrading_Rare = false; } }
public static void DoUpgrade() { try { IsUpgrading_Rare = true; ActorCommonData CubeStand; bool CubeNearby = Tools.IsCubeNearby(out CubeStand); if (CubeNearby) { while (true) { float RX_Cube, RY_Cube; A_Tools.T_World.ToScreenCoordinate(CubeStand.x0D0_WorldPosX, CubeStand.x0D4_WorldPosY, CubeStand.x0D8_WorldPosZ, out RX_Cube, out RY_Cube); if (Tools.IsVendorPage_Visible() && Tools.IsKanaisCube_MainPage_Visible()) { break; } A_Tools.InputSimulator.IS_Mouse.MoveCursor((uint)RX_Cube, (uint)RY_Cube); A_Tools.InputSimulator.IS_Mouse.LeftClick(); Thread.Sleep(100); } Stopwatch s1 = new Stopwatch(); ///////// s1.Start(); /////////// var UpgradableItems = Tools.Get_RareUpgradableItems(); List <ActorCommonData> Materials; var Count_AvailableEnchants = Tools.Get_AvailableEnchants_UpgradeRare(out Materials); var Count_Enchants = 0; foreach (var item in UpgradableItems) { if (Count_Enchants == Count_AvailableEnchants) { break; } while (true) { float RX_Cube, RY_Cube; A_Tools.T_World.ToScreenCoordinate(CubeStand.x0D0_WorldPosX, CubeStand.x0D4_WorldPosY, CubeStand.x0D8_WorldPosZ, out RX_Cube, out RY_Cube); if (Tools.IsVendorPage_Visible() && Tools.IsKanaisCube_MainPage_Visible()) { break; } A_Tools.InputSimulator.IS_Mouse.MoveCursor((uint)RX_Cube, (uint)RY_Cube); A_Tools.InputSimulator.IS_Mouse.LeftClick(); Thread.Sleep(100); } UIRect UIRect_item = A_Collection.D3UI.InventoryItemUIRectMesh.FirstOrDefault( x => x.Key.ItemSlotX == item.x118_ItemSlotX && x.Key.ItemSlotY == item.x11C_ItemSlotY) .Value; A_Tools.InputSimulator.IS_Mouse.RightCLick((int)UIRect_item.Left, (int)UIRect_item.Top, (int)UIRect_item.Right, (int)UIRect_item.Bottom); Thread.Sleep(100); foreach (var material in Materials) { UIRect UIRect_material = A_Collection.D3UI.InventoryItemUIRectMesh.FirstOrDefault( x => x.Key.ItemSlotX == material.x118_ItemSlotX && x.Key.ItemSlotY == material.x11C_ItemSlotY) .Value; A_Tools.InputSimulator.IS_Mouse.RightCLick((int)UIRect_material.Left, (int)UIRect_material.Top, (int)UIRect_material.Right, (int)UIRect_material.Bottom); Thread.Sleep(100); } UIRect Transmute = A_Tools.T_D3UI.UIElement.getRect(BTN_Transmute); A_Tools.InputSimulator.IS_Mouse.LeftClick((int)Transmute.Left, (int)Transmute.Top, (int)Transmute.Right, (int)Transmute.Bottom); Thread.Sleep(100); while (Tools.IsVendorPage_Visible()) { A_Tools.InputSimulator.IS_Keyboard.Close_AllWindows(); } Count_Enchants++; } s1.Stop(); ///////// TimeSpan t1 = s1.Elapsed; ////// Console.WriteLine(t1.TotalSeconds); //////// } IsUpgrading_Rare = false; } catch (Exception) { IsUpgrading_Rare = false; } }
public static void DoConvert(string FromMaterialQuality, string ToMaterialQuality) { // check input if ((FromMaterialQuality == "normal" || FromMaterialQuality == "magic" || FromMaterialQuality == "rare") && (ToMaterialQuality == "normal" || ToMaterialQuality == "magic" || ToMaterialQuality == "rare")) { try { IsConvertingMaterial = true; ActorCommonData CubeStand; bool CubeNearby = Tools.IsCubeNearby(out CubeStand); if (CubeNearby) { if (Tools.ClickOnCube(CubeStand)) { Stopwatch s1 = new Stopwatch(); ///////// s1.Start(); /////////// // Get list of Materials to convert from List <ActorCommonData> Materials; var Count_AvailableEnchants = Tools.Get_AvailableMaterial_Convert(FromMaterialQuality, out Materials); // Get list of equipment of the specified quality var ToItemList = Tools.Get_Items(ToMaterialQuality); var Count_Enchants = 0; foreach (var item in ToItemList) { if (Count_Enchants == Count_AvailableEnchants) { break; } if (Tools.ClickOnCube(CubeStand)) { // Find the item position and rightclick on the item UIRect UIRect_item = A_Collection.D3UI.InventoryItemUIRectMesh.FirstOrDefault(x => x.Key.ItemSlotX == item.x118_ItemSlotX && x.Key.ItemSlotY == item.x11C_ItemSlotY).Value; A_Tools.InputSimulator.IS_Mouse.RightCLick((int)UIRect_item.Left, (int)UIRect_item.Top, (int)UIRect_item.Right, (int)UIRect_item.Bottom); Thread.Sleep(200); // Find the positions and rightclick on materials (RP/AD/VC) foreach (var material in Materials) { UIRect UIRect_material = A_Collection.D3UI.InventoryItemUIRectMesh.FirstOrDefault( x => x.Key.ItemSlotX == material.x118_ItemSlotX && x.Key.ItemSlotY == material.x11C_ItemSlotY).Value; A_Tools.InputSimulator.IS_Mouse.RightCLick((int)UIRect_material.Left, (int)UIRect_material.Top, (int)UIRect_material.Right, (int)UIRect_material.Bottom); Thread.Sleep(100); } // Click the Transmute button UIRect Transmute = A_Tools.T_D3UI.UIElement.getRect(BTN_Transmute); A_Tools.InputSimulator.IS_Mouse.LeftClick((int)Transmute.Left, (int)Transmute.Top, (int)Transmute.Right - 10, (int)Transmute.Bottom); Thread.Sleep(500); // Close Cube window after transmute while (Tools.IsVendorPage_Visible()) { A_Tools.InputSimulator.IS_Keyboard.Close_AllWindows(); Thread.Sleep(250); } Count_Enchants++; } } s1.Stop(); ///////// TimeSpan t1 = s1.Elapsed; ////// Console.WriteLine(t1.TotalSeconds); //////// } } IsConvertingMaterial = false; } catch (Exception) { IsConvertingMaterial = false; } } }
public static void DoConvert(string FromMaterialQuality, string ToMaterialQuality) { // check input if ((FromMaterialQuality == "normal" || FromMaterialQuality == "magic" || FromMaterialQuality == "rare") && (ToMaterialQuality == "normal" || ToMaterialQuality == "magic" || ToMaterialQuality == "rare")) { try { IsConvertingMaterial = true; ActorCommonData CubeStand; bool CubeNearby = Tools.IsCubeNearby(out CubeStand); // Get list of equipment of the specified quality var ToItemList = Tools.Get_Items(ToMaterialQuality); int Count_AvailableConversions = (int)Tools.Get_AvailableMaterial_Convert(FromMaterialQuality); if (CubeNearby & ToItemList.Count > 0 & Count_AvailableConversions > 0) { if (Tools.ClickOnCube(CubeStand)) { Stopwatch s1 = new Stopwatch(); ///////// s1.Start(); /////////// int Count_Conversions = 0; // Get list of Materials to convert from //receipe button A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Recipe_Button); //press next button 2x for upgrade rare menu - white (6) -blue (7) - yellow (8) [from] var nextClicks = 0; switch (FromMaterialQuality) { case "normal": nextClicks = 6; break; case "magic": nextClicks = 7; break; case "rare": nextClicks = 8; break; } while (nextClicks > 0) { A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Page_Next); Thread.Sleep(120); nextClicks--; } int numberOfItemsBeforeTrying = ToItemList.Count; foreach (var item in ToItemList) { if (StopConversion) { break; } if (Count_Conversions == Count_AvailableConversions) { break; } Count_Conversions++; if (Tools.ClickOnCube(CubeStand)) { // Find the item position and rightclick on the item UIRect UIRect_item = A_Collection.D3UI.InventoryItemUIRectMesh.FirstOrDefault(x => x.Key.ItemSlotX == item.x118_ItemSlotX && x.Key.ItemSlotY == item.x11C_ItemSlotY).Value; A_Tools.InputSimulator.IS_Mouse.RightCLick((int)UIRect_item.Left, (int)UIRect_item.Top, (int)UIRect_item.Right, (int)UIRect_item.Bottom); //fill A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Fill_Button); //transmute A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Transmute_Button); Thread.Sleep(Properties.Settings.Default.SleepTransmute); //click next and back to reset A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Page_Next); A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Page_Previous); } } // Close Cube window after transmute int close_timeout = 5; while (Tools.IsKanaisCube_MainPage_Visible()) { //A_Tools.InputSimulator.IS_Keyboard.Close_AllWindows(); //doesnt work if not assigned :D //Press "X" - Button in Kanais Cube A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Exit_Button); close_timeout--; if (close_timeout == 0) { break; } Thread.Sleep(200); } s1.Stop(); ///////// TimeSpan t1 = s1.Elapsed; ////// Console.WriteLine(t1.TotalSeconds); //////// } } IsConvertingMaterial = false; } catch (Exception) { IsConvertingMaterial = false; } } } //end method doconvert
public static void DoUpgrade() { try { IsUpgrading_Rare = true; ActorCommonData CubeStand; bool CubeNearby = Tools.IsCubeNearby(out CubeStand); if (CubeNearby) { if (Tools.ClickOnCube(CubeStand)) { Stopwatch s1 = new Stopwatch(); ///////// s1.Start(); /////////// var UpgradableItems = Tools.Get_Items("rare"); var Count_AvailableEnchants = 50; var Count_Enchants = 0; foreach (var item in UpgradableItems) { if (Count_Enchants == Count_AvailableEnchants) { break; } if (Tools.ClickOnCube(CubeStand)) { //receipe button A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Recipe_Button); //press next button 2x for upgrade rare menu A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Page_Next); A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Page_Next); //put item in cube UIRect UIRect_item = A_Collection.D3UI.InventoryItemUIRectMesh.FirstOrDefault( x => x.Key.ItemSlotX == item.x118_ItemSlotX && x.Key.ItemSlotY == item.x11C_ItemSlotY).Value; A_Tools.T_D3UI.UIElement.rightClick(UIRect_item); //fill A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Fill_Button); //transmute A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Transmute_Button); //close all windows int close_timeout = 2; while (Tools.IsVendorPage_Visible()) { //A_Tools.InputSimulator.IS_Keyboard.Close_AllWindows(); //doesnt work if not assigned :D //Press "X" - Button in Kanais Cube A_Tools.T_D3UI.UIElement.leftClick(UIElements.Kanai_Cube_Exit_Button); close_timeout--; if (close_timeout == 0) { break; } } Count_Enchants++; } } s1.Stop(); ///////// TimeSpan t1 = s1.Elapsed; ////// Console.WriteLine(t1.TotalSeconds); //////// } } IsUpgrading_Rare = false; } catch (Exception) { IsUpgrading_Rare = false; } }