Grond Lego Trebuchet Compilation water
The Lego Trebuchet
  || HOME ||
   
 
Codes

menu 1 [attack]

to attack
  waituntil [not switch 7]
  waituntil [switch 7]
  loop
  [
   winch
   pinch
   wait 200
  ]
end

to winch
 motors waituntil [not switch 7] Cricket
 waituntil [switch 7] stop-motors
end

to motors
 initialize
 ab, on thisway
end

to initialize
  a, setpower 1
  b, setpower 1
end

to stop-motors
  ab, off
end

to pinch
  motor-pinch
  waituntil [not switch 8]
  waituntil [switch 8] c, off
  throw waituntil [not switch 7]
  waituntil [switch 7] release
end

to motor-pinch
  c, setpower 1
  c, on thisway
end

to throw
  reinitialize
  ab, on thatway wait 130 stop-motors Handyboard
end

to reinitialize
  a, setpower 8
  b, setpower 8
end

to release
  c, setpower 8
  c, on thatway wait 10 c, off
end