
Re: SWATH Script Help Needed
HiTechRedneck wrote:
Can anyone tell me what is wrong with this bit of code???
// start our main loop
for (loop = 1; loop < 10 ; loop++);
{
LaunchEtherProbe.exec(start);
start++;
if (start == Swath.main.currSector()) start++;
if (start > totsectors) {
PrintText.exec("\nMax sectors reached quitting!\n");
return true;
}
if ( maxcycles <= cycle ) {
PrintText.exec("\nMax cycles reached quitting!\n");
return true;
}
}
All of the initialization works correctly, values get passed, etc. But when I run the script, it launches 1 probe to the sector I tell it to start in, then the script just ends like it finished. I have tried setting the loop up with both "loop < 10" and "loop >10". No change.
I am trying to create a script that will probe all 20k sectors in the game I am playing in, starting at 1, and reloading on probes as needed. but if I can't get the basic loop to work, nothing else will either. Any help would be greatly appreciated.
Just some general help with scripting/programming....
When having problems.... Output the values of all the variables inside your loop....
such as maxcycles and cycles... this is important because the comparison might be causing your loop to abort.
I would also double check all initializations and if statements to make sure that they are what you
assume they would be.
What would happen for arguments sake... start is Greater than totsectors... your loop would
fire 1 probe and exec the PrintText routine and then return true....
<Edit>
After thinking about it some more... do you ever increment cycles?
I know it is just personal choice but I find it helps me to have the test variable come first...
i.e. if (cycles >= maxcycles) to me is more readable... but to each his/her own.
Do you get a message from the PrintText routine? Check both of them...