Some hints and style tips:
/def -t"*tomato*" tomato = :throws a tomato at %1.If Ben uses the word tomato, I will trigger, and then see the text "Hawkeye throws a tomato at Ben." That text contains the word tomato, which will trigger me again, creating an infinite loop. One way to prevent this is by creating a high-priority trigger on myself which does nothing:
/def -p99999 -t"{Hawkeye|You}*" anti_loopNow, when I see "Hawkeye throws a tomato at Ben", the /anti_loop trigger will catch it before /tomato does, so I won't loop.
/def count=/let i=1%;/while (i<=%1) say %i%;/let i=$[i+1]%;/done
/def count = \ /let i=1%; \ /while ( i <= %1 ) \ say %i%; \ /let i=$[i + 1]%; \ /done
/test {1}
".