protected override void OnInit(Point2D position, object[] args) { var recipeName = (string)args[0]; widget = new CraftWindow(Parent.Widget); widget.Move(position); widget.RecipeName = recipeName; widget.Craft += () => SendMessage("make", 0); widget.CraftAll += () => SendMessage("make", 1); }
private void OnCraftClick(object sender, RoutedEventArgs e) { if (_craftWindow == null) { _craftWindow = new CraftWindow(ProjectManager.Instance.Project) { Owner = this }; _craftWindow.Closed += (o, args) => { _craftWindow = null; }; } _craftWindow.Show(); _craftWindow.Focus(); }
public void ShowWindow() { if (window != null) { return; } window = BaseWindow.LoadWindow("CraftWindow") as CraftWindow; if (window != null) { window.OnWindowHide += OnWindowHide; window.id = BaseWindow.WindowId.Craft; window.Show(); } }
private void OnWindowHide() { window.OnWindowHide -= OnWindowHide; window = null; }
public void DoWork() { List <Character> monsters = new List <Character>(); List <Character> fate = new List <Character>(); List <Character> players = new List <Character>(); Character user = null; int craftAmount = 0; _status = StatusEnum.Initializing; MemoryFunctions.GetCharacters(monsters, fate, players, ref user); while (craftAmount < MaxCrafts) { user.Refresh(); Debug.Print(user.Status.ToString() + " - " + user.Status.ToString("X")); if (Paused) { continue; } if ((user.Status == CharacterStatus.Idle || user.Status == CharacterStatus.Crafting_Idle || user.Status == CharacterStatus.Crafting_Idle2) && user.IsCrafting == false) { CraftWindow craftwindow = new CraftWindow(); while (craftwindow.RefreshPointers() == false) { Utilities.Keyboard.KeyBoardHelper.KeyPress(Keys.NumPad0); Thread.Sleep(350); } Thread.Sleep(200); if (ScriptMode) { CraftAi.Craftwindow = craftwindow; CraftAi.Synth(); } else { foreach (CraftingKey keyCondition in _keyConditions) { while (Paused) { Thread.Sleep(250); } if (craftwindow.RefreshPointers() == false) { break; } user.Refresh(); craftwindow.Refresh(); if (craftwindow.CurrProgress == craftwindow.MaxProgress) { break; } if (keyCondition.CPCondition) { if (user.CurrentCP < keyCondition.CP) { continue; } } if (keyCondition.DurabilityCondition) { if (craftwindow.CurrDurability <= keyCondition.Durability) { continue; } } if (keyCondition.ProgressCondition) { if (craftwindow.CurrProgress > keyCondition.Progress) { continue; } } if (keyCondition.ConditionCondition) { if (craftwindow.Condition.Trim().ToLower() == keyCondition.Condition.Trim().ToLower()) { continue; } } // Utilities.Keyboard.KeyBoardHelper.KeyPress(keyCondition.Key); WaitForAbility(user, keyCondition.Key, keyCondition.ControlKey); } } while (craftwindow.RefreshPointers()) { Thread.Sleep(250); } craftAmount++; } Thread.Sleep(500); } }
public ScriptingObject(CraftWindow craftWindow) { Craftwindow = craftWindow; CraftStep = 0; }