Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.06 KB | None | 0 0
  1. private void buyCommand(string command, string[] parameters)
  2. {
  3. if (parameters.Length == 0) return;
  4. try
  5. {
  6. string stonks = parameters[0];
  7. int amount = int.Parse(parameters[1]);
  8. if (string.Equals(stonks, "joja"))
  9. {
  10. int TotalPrice = JojaPrice * amount;
  11. if (Game1.player.Money >= TotalPrice)
  12. {
  13. var svJoja = this.Helper.Data.ReadSaveData<SaveModel>("InvestJoja");
  14. JojaShare = svJoja.InvestJoja + amount;
  15. Game1.player.Money -= TotalPrice;
  16. moneyInvested = moneyInvested + TotalPrice;
  17. this.Helper.Data.WriteSaveData("InvestJoja", new SaveModel { InvestJoja = JojaShare });
  18. Monitor.Log($"Successfully purchased {amount} shares in JojaCorp for {TotalPrice}g!", LogLevel.Info);
  19. }
  20. else
  21. {
  22. Monitor.Log("This Is Not Enough Golds!", LogLevel.Info);
  23. }
  24.  
  25. }
  26. if (string.Equals(stonks, "stardrop"))
  27. {
  28. int TotalPrice = StardropPrice * amount;
  29. if (Game1.player.Money >= TotalPrice)
  30. {
  31. var svStar = this.Helper.Data.ReadSaveData<SaveModel>("InvestStardrop");
  32. StardropShare = svStar.InvestStardrop + amount;
  33. Game1.player.Money -= TotalPrice;
  34. moneyInvested = moneyInvested + TotalPrice;
  35. this.Helper.Data.WriteSaveData("InvestStardrop", new SaveModel { InvestStardrop = StardropShare });
  36. Monitor.Log($"Successfully purchased {amount} shares in StardropINC for {TotalPrice}g!", LogLevel.Info);
  37. }
  38. else
  39. {
  40. Monitor.Log("This Is Not Enough Golds!", LogLevel.Info);
  41. }
  42. }
  43. if (string.Equals(stonks, "sauce"))
  44. {
  45. int TotalPrice = SaucePrice * amount;
  46. if (Game1.player.Money >= TotalPrice)
  47. {
  48. var svSus = this.Helper.Data.ReadSaveData<SaveModel>("InvestSauce");
  49. SauceShare = svSus.InvestSauce + amount;
  50. Game1.player.Money -= TotalPrice;
  51. moneyInvested = moneyInvested + TotalPrice;
  52. this.Helper.Data.WriteSaveData("InvestSauce", new SaveModel { InvestSauce = SauceShare });
  53. Monitor.Log($"Successfully purchase {amount} shares in Queen of Sauce INC for {TotalPrice}g!");
  54. }
  55. else
  56. {
  57. Monitor.Log("This Is Not Enough Golds!", LogLevel.Info);
  58. }
  59. }
  60. if (string.Equals(stonks, "ferngill"))
  61. {
  62. int TotalPrice = FerngillPrice * amount;
  63. if (Game1.player.Money >= TotalPrice)
  64. {
  65. var svFrn = this.Helper.Data.ReadSaveData<SaveModel>("InvestFerngill");
  66. FerngillShare = svFrn.InvestFerngill + amount;
  67. Game1.player.Money -= TotalPrice;
  68. moneyInvested = moneyInvested + TotalPrice;
  69. this.Helper.Data.WriteSaveData("InvestFerngill", new SaveModel { InvestFerngill = FerngillShare });
  70. Monitor.Log($"Successfully purchase {amount} shares in Bank of Ferngill for {TotalPrice}g!");
  71. }
  72. else
  73. {
  74. Monitor.Log("This Is Not Enough Golds!", LogLevel.Info);
  75. }
  76. }
  77.  
  78.  
  79. }
  80. catch (Exception) { }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement