All pastes #827305 Raw Edit

Untitled

public text v1 · immutable
#827305 ·published 2007-12-21 17:55 UTC
rendered paste body
method Sweep()
	{
	
	variable string blocked
		if ${goal}==1000
			{
			i:Set[1]
			
			startpos:Set[${Math.Calc[${Me.Heading}-360]}]
			goal:Set[${Math.Calc[${Me.Heading}-360]}]
			bearing:Set[${startpos}]
			
			;echo ${startpos} ${goal} ${bearing} ${Me.Heading}
			;Script[test2]:End
			}
	   		 					 	 
		 	 	 		bearing:Set[${This.DegreeOut[${bearing}]}]
		 	 	 				;echo ${bearing} ${Me.Heading}
						   FeelPoint.X:Set[ ${Me.X} + ${Math.Cos[${Math.Calc[${bearing}]}].Precision[6]} * ${FeelAhead} ]
							 FeelPoint.Y:Set[ ${Me.Y} - ${Math.Sin[${Math.Calc[${bearing}]}].Precision[6]} * ${FeelAhead} ]
							 if ${Me.IsPathObstructed[${FeelPoint.X},${FeelPoint.Y},${Math.Calc[${ScanZ}]},3]} 
							 {
							;echo blocked ${bearing} ${i}
							 blocked:Set[X]
							 ScanAverage[${i}]:Dec
							 
							 }
							 else
							 {
							 blocked:Set[o]
							 ScanAverage[${i}]:Inc
							 }
							 							
							if ${i:Inc}<=9
							{
							
							bearing:Inc[45]
							Vision:Set["${Vision}${blocked}"]
							return
							
							}							
							
							;echo ${Sc}:${Vision}
							
							goal:Set[1000]
							if ${Sc}<=0
							{
							Vision:Set["${Vision}"]
							
							;echo "Zset ${Vision}" 
							
							Sc:Inc[1]
							ScanZ:Inc[-1]
							
							i:Set[1]
							return
							}
							TestVision:Set[${Vision}]
							;echo I SEE : ${Vision}
							
							Vision:Set[]
						
							ScanZ:Set[${Math.Calc[${Me.Z}]}]
							Sc:Set[1]
			}