Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void buyCommand(string command, string[] parameters)
- {
- if (parameters.Length == 0) return;
- try
- {
- string stonks = parameters[0];
- int amount = int.Parse(parameters[1]);
- if (string.Equals(stonks, "joja"))
- {
- int TotalPrice = JojaPrice * amount;
- if (Game1.player.Money >= TotalPrice)
- {
- var svJoja = this.Helper.Data.ReadSaveData<SaveModel>("InvestJoja");
- JojaShare = svJoja.InvestJoja + amount;
- Game1.player.Money -= TotalPrice;
- moneyInvested = moneyInvested + TotalPrice;
- this.Helper.Data.WriteSaveData("InvestJoja", new SaveModel { InvestJoja = JojaShare });
- Monitor.Log($"Successfully purchased {amount} shares in JojaCorp for {TotalPrice}g!", LogLevel.Info);
- }
- else
- {
- Monitor.Log("This Is Not Enough Golds!", LogLevel.Info);
- }
- }
- if (string.Equals(stonks, "stardrop"))
- {
- int TotalPrice = StardropPrice * amount;
- if (Game1.player.Money >= TotalPrice)
- {
- var svStar = this.Helper.Data.ReadSaveData<SaveModel>("InvestStardrop");
- StardropShare = svStar.InvestStardrop + amount;
- Game1.player.Money -= TotalPrice;
- moneyInvested = moneyInvested + TotalPrice;
- this.Helper.Data.WriteSaveData("InvestStardrop", new SaveModel { InvestStardrop = StardropShare });
- Monitor.Log($"Successfully purchased {amount} shares in StardropINC for {TotalPrice}g!", LogLevel.Info);
- }
- else
- {
- Monitor.Log("This Is Not Enough Golds!", LogLevel.Info);
- }
- }
- if (string.Equals(stonks, "sauce"))
- {
- int TotalPrice = SaucePrice * amount;
- if (Game1.player.Money >= TotalPrice)
- {
- var svSus = this.Helper.Data.ReadSaveData<SaveModel>("InvestSauce");
- SauceShare = svSus.InvestSauce + amount;
- Game1.player.Money -= TotalPrice;
- moneyInvested = moneyInvested + TotalPrice;
- this.Helper.Data.WriteSaveData("InvestSauce", new SaveModel { InvestSauce = SauceShare });
- Monitor.Log($"Successfully purchase {amount} shares in Queen of Sauce INC for {TotalPrice}g!");
- }
- else
- {
- Monitor.Log("This Is Not Enough Golds!", LogLevel.Info);
- }
- }
- if (string.Equals(stonks, "ferngill"))
- {
- int TotalPrice = FerngillPrice * amount;
- if (Game1.player.Money >= TotalPrice)
- {
- var svFrn = this.Helper.Data.ReadSaveData<SaveModel>("InvestFerngill");
- FerngillShare = svFrn.InvestFerngill + amount;
- Game1.player.Money -= TotalPrice;
- moneyInvested = moneyInvested + TotalPrice;
- this.Helper.Data.WriteSaveData("InvestFerngill", new SaveModel { InvestFerngill = FerngillShare });
- Monitor.Log($"Successfully purchase {amount} shares in Bank of Ferngill for {TotalPrice}g!");
- }
- else
- {
- Monitor.Log("This Is Not Enough Golds!", LogLevel.Info);
- }
- }
- }
- catch (Exception) { }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement