private static int getItem(int itemNumber, Condition cond) { object arg = null; int itemType = -1; if (itemNumber == 1) { itemType = cond.item1; if (cond.args.Count > 0) { arg = cond.args[0]; } } else { itemType = cond.item2; int item1 = cond.item1; if (cond.args.Count > 1) { arg = cond.args[1]; } else if (cond.args.Count > 0) { arg = cond.args[0]; } } if (itemType == StatementType.conditionElement["Cap"]) { return(GetData.Cap); } else if (itemType == StatementType.conditionElement["Item count"]) { int result = 0; string action = cond.args.FirstOrDefault() as string; int x, y; GetData.getItemFromEQWindowPosition(out x, out y, Constants.ShieldXOffset, Constants.ShieldYOffset); bool wasHealerEnabled = ModulesManager.healer.working; int timeToSleep = 350; for (int i = 0; i < 5; i++) //nr of tries { ModulesManager.HealerDisable(); KeyboardSimulator.Press(action); Thread.Sleep(timeToSleep); MouseSimulator.click(x, y); Thread.Sleep(timeToSleep); result = GetData.GetCountFromServerInfo(); if (wasHealerEnabled) { ModulesManager.HealerEnable(); } GetData.clearLastServerInfo(); if (result != -1) { break; } timeToSleep += 40; } if (result == -1) { result = 0; } return(result); } else if (itemType == StatementType.conditionElement["Value"]) { return((int)arg); } else if (itemType == StatementType.conditionElement["HP"]) { return(GetData.MyHP); } else if (itemType == StatementType.conditionElement["Mana"]) { return(GetData.MyMana); } return(-1); }
private void Save(object sender, RoutedEventArgs e) { try { bool isWorking = ModulesManager.healer.working; if (isWorking) { ModulesManager.HealerDisable(); } ModulesManager.healer.lowHPAction = lowHPB.Text; ModulesManager.healer.medHPAction = medHPB.Text; ModulesManager.healer.highHPAction = highHPB.Text; if (lowHPMana.Text == "") { lowHPMana.Text = "0"; } if (medHPMana.Text == "") { medHPMana.Text = "0"; } if (highHPMana.Text == "") { highHPMana.Text = "0"; } ModulesManager.healer.lowHPMana = int.Parse(lowHPMana.Text); ModulesManager.healer.medHPMana = int.Parse(medHPMana.Text); ModulesManager.healer.highHPMana = int.Parse(highHPMana.Text); if (lowHP.Text == "") { lowHP.Text = "0"; } if (medHP.Text == "") { medHP.Text = "0"; } if (highHP.Text == "") { highHP.Text = "0"; } ModulesManager.healer.lowHP = int.Parse(lowHP.Text); ModulesManager.healer.medHP = int.Parse(medHP.Text); ModulesManager.healer.highHP = int.Parse(highHP.Text); if (lowMana.Text == "") { lowMana.Text = "0"; } if (highMana.Text == "") { highMana.Text = "0"; } ModulesManager.healer.lowMana = int.Parse(lowMana.Text); ModulesManager.healer.highMana = int.Parse(highMana.Text); ModulesManager.healer.lowManaAction = lMB.Text; ModulesManager.healer.highManaAction = hMB.Text; if (isWorking) { ModulesManager.HealerEnable(); } showPopUpWindow("Saved succesfully"); } catch (Exception) { showPopUpWindow(); } }
private void HealerRun(object sender, RoutedEventArgs e) { ModulesManager.HealerEnable(); }