www.ClassicTW.com
https://mail.black-squirrel.com/

Scpript pack 2, 2_Col.ts is messed up
https://mail.black-squirrel.com/viewtopic.php?f=15&t=33037
Page 1 of 1

Author:  SteveH_66 [ Mon Mar 12, 2012 7:12 pm ]
Post subject:  Scpript pack 2, 2_Col.ts is messed up

Has anyone else noticed that the 2_Col.ts script doesn't work right on equipment? It deposits colo's fine in fuel ore and organics, but doesn't deposit them right in equipment. I am not sure if the error is in the code in 2_Col.ts or if it's wrong in the Colonise.ts include script.

I was looking at the code in both, from what I could tell it looks fine in the Colonise.ts include, I believe it is somewhere in the 2_Col.ts script. I don't know much about using menu's or understand how the code is done for that, so I am having a tough time narrowing the error down in 2_Col.ts with all that menu stuff.

I would like to use menu's in my scripts and I'm studying it a little but right now it still looks like spaghetti code to me. But I believe the error is somewhere in this block of code

Code:
:Menu_Category
if ($Col_Category < 2)
  add $Col_Category 1
else
  setVar $Col_Category 0
end
saveVar $Col_Category
gosub :sub_SetMenu
openMenu "Col"


Of course I could be wrong, like I said I don't know that much about scripting, and definitely not about menu's.

Or could it be from this block of code?

Code:
if ($ColSaved)
  loadVar $Col_Method
  loadVar $Col_Category
  loadVar $Col_TurnLimit
  loadVar $Col_CycleLimit
  loadVar $Col_FuelSource
  loadVar $Col_Overload
else
  setVar $Col_Method 1
  setVar $Col_Category 1
  setVar $Col_TurnLimit 20
  setVar $Col_CycleLimit 0
  setVar $Col_FuelSource P
  setVar $Col_Overload 0
 
  saveVar $Col_Method
  saveVar $Col_Category
  saveVar $Col_TurnLimit
  saveVar $Col_CycleLimit
  saveVar $Col_FuelSource
  saveVar $Col_Overload

  setVar $ColSaved 1
  saveVar $ColSaved
end


Maybe a combination of the 2? If you already ran the script a few times, it could have $Col_Category saved as 3 in the cfg file I would think. In the block of text where it sets the Menu_Category, I think something was left out for handling if it was already set to 3 for equipment in the cfg file. Well, anyway, I would appreciate it if some of the experienced scripters could take a look at it and tell me if I am right or if it is another error somewhere else. Thanks

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/