Loading

Paste #phvyja9wq

  1. class CompanyValue extends GSController
  2. {
  3.   function Start()
  4.   function Save()
  5.   function Load(version, data);
  6. }
  7.  
  8. function CompanyValue::Save()
  9. {
  10.   return{}
  11. }
  12.  
  13. function CompanyValue::Load(version, data)
  14. {
  15. }
  16.  
  17. function CompanyValue::Start()
  18. {
  19.  local goal_reached = false
  20.   while (true) {
  21.    while (goal_reached == false) {
  22.     local goal = GSController.GetSetting("value")
  23.     local date = GSDate.GetCurrentDate()
  24.     GSLog.Warning("Current Date: " + GSDate.GetYear(date) + "-" + GSDate.GetMonth(date) + "-" + GSDate.GetDayOfMonth(date) + " ; Goal: £" + goal)
  25.     local cid = 0
  26.     while (cid != 15) {
  27.      local cv = GSCompany.GetQuarterlyCompanyValue(cid, GSCompany.CURRENT_QUARTER)
  28.      cid = cid + 1
  29.      GSLog.Info("Company " + cid + ": £" + cv)
  30.      if (cv >= goal) {
  31.       GSLog.Warning("Company " + cid + " has reached the company value goal of £" + goal)
  32.       GSGame.Pause()
  33.       goal_reached = true
  34.       break
  35.      }
  36.     }
  37.     GSLog.Warning(" ")
  38.     this.Sleep(74)
  39.    }
  40.    this.Sleep(500)
  41.   }
  42. }

Version history

Revision # Author Created at
pnqweidrz Anonymous 06 Feb 2018, 21:49:27 UTC Diff

Comments