2019-04-05 04:21 PM
line1X1 = x[10]: line1Y1 = y[10] ! S1 segment line1X2 = x[1]: line1Y2 = y[1] line2X1 = x[8]: line2Y1 = y[8] ! S2 segment line2X2 = x[7]: line2Y2 = y[7] T = (line1X1-line1X2) * (line2Y1-line2Y2) - (line1Y1-line1Y2) * (line2X1-line2X2) gosub "T" line1X1 = x[1]: line1Y1 = y[1] ! S1 segment line1X2 = x[10]: line1Y2 = y[10] line2X1 = x[9]: line2Y1 = y[9] ! S2 segment line2X2 = x[8]: line2Y2 = y[8] T = (line1X1-line1X2) * (line2Y1-line2Y2) - (line1Y1-line1Y2) * (line2X1-line2X2) gosub "T" !*************************************************************************************** END !*************************************************************************************** "T": E= 0.00000001 if (T > 0.00000000001) or (T < -0.000000001)then temp1 = line1X1 * line1Y2 - line1Y1 * line1X2 temp2 = line2X1 * line2Y2 - line2Y1 * line2X2 tempx = temp1 * (line2X1-line2X2) - (line1X1-line1X2) * temp2 tempy = temp1 * (line2Y1-line2Y2) - (line1Y1-line1Y2) * temp2 cx = (tempx / T) cy = (tempy / T) if(cx>=min(line1X1,line1X2)-E)and(cx<=max(line1X1,line1X2)+E)and(cx>=min(line2X1,line2X2)-E)and(cx<=max(line2X1,line2X2)+E)and(cy>=min(line1Y1,line1Y2)-E)and(cy<=max(line1Y1,line1Y2)+E)and(cy>=min(line2Y1,line2Y2)-E)and(cy<=max(line2Y1,line2Y2)+E)then state = 1 else state = 0 endif endif returnThis would be fine, however I have 100+ different gosubs rather than just 1 so my script will run the gosub once and that one might make state = 1 but the next time it does a gosub it can obviously make it 0 so it cancels out. I want to be able to essentially stop the script when state = 1. How can I achieve this? (This script has been written in the parameter script)
Solved! Go to Solution.
2019-04-09 03:12 AM
2019-04-08 03:13 AM
state = 1 END
2019-04-08 12:43 PM
2019-04-09 03:12 AM