Patrol Script (attached to fighter Chigaco 27) -- a slight variation
on newday
repeat until I am inside a city
move 1 toward nearest city
if I am near enemy transport than attack enemy transport
end repeat
move 5 bearing 215°
repeat 5 times
move 1 in any direction
if I am near enemy then beep
end repeat
end newday
Script of menu selection "Patrol"
clear movement code of current piece
inquire startloc,endloc of patrol vector
repeat until distance from startloc to endloc is not greater than range of current piece / 2
Warn "That patrol is too long for the range of that" type of current piece
inquire startloc,endloc of patrol vector of current piece
end repeat
set targetloc of current piece to endloc of current piece
define movement code for current piece
{
on newday
repeat forever
repeat until I reach targetloc
move 1 toward targetloc
if I am near enemy piece than pause for manual intervention
end repeat
if targetloc equals startloc
then set targetloc to endloc
else set targetloc to startloc
end repeat
end newday
}
execute movement code for current piece
|