|
So there are a few things you want to look into.
First is a loop, usually a for loop (although you could use a while loop and a variable to act as a counter), which will let you say "repeat this n times" (where in your case n will be 15).
Second you might want to look into functions, so that you can wrap the for loop in a more convenient command. This would make it possible for you to replace your set-wait-set-wait with something like holdButton("up").
Finally you might want to look into arrays, so that you can have a list of buttons to press and loop over them, e.g. something like buttons = {"up", "up", "right"} (plus a loop over buttons) instead of holdButton("up"); holdButton("up"); holdButton("right").
|