class MyNewGS extends GSController
{
function Start()
{
//This function is inside the class declaration.
}
//These are optional prototypes. Notice the ; at the end rather than {}.
//Squirrel doesn't require it, but some programmers like to use them.
function Save();
function Load(version, data);
}
function MyNewGS::Save()
{
GSLog.Info("//This function is outside the class declaration and requires the name of the class so squirrel can assign it to the right place.")
return {};
}
function MyNewGS::Load(version, data)
{
GSLog.Info("Load")
}
function MyNewGS::Start()
{
local goal_reached = false
while (true) {
while (goal_reached == false) {
local goal = GSController.GetSetting("value")
local date = GSDate.GetCurrentDate()
GSLog.Warning("Current Date: " + GSDate.GetYear(date) + "-" + GSDate.GetMonth(date) + "-" + GSDate.GetDayOfMonth(date) + " ; Goal: £" + goal)
local cid = 0
while (cid != 15) {
local cv = GSCompany.GetQuarterlyCompanyValue(cid, GSCompany.CURRENT_QUARTER)
cid = cid + 1
GSLog.Info("Company " + cid + ": £" + cv)
if (cv >= goal) {
GSLog.Warning("Company " + cid + " has reached the company value goal of £" + goal)
GSGame.Pause()
goal_reached = true
break
}
}
GSLog.Warning(" ")
this.Sleep(74)
}
this.Sleep(500)
}
}