ChickenBuyer: type: interact debug: false steps: 'Starting*': click trigger: script: - chat "hello" - random 2 - repeat 1 - chat "Hello. How are you doing today?" - if { - chat "Something smells delicious. Is that cooked chicken you have? Could I buy it from you?" - narrate "Type yes if you agree." - zap 'step:chicken' } - repeat 1 - chat "Hey, want to buy a bow? Only 100 gold ingots." - narrate "Type yes if you want to buy it." - zap 'step:bow' chat trigger: 'hello': trigger: "/hello/" script: - chat "Would you like to buy a bow?" - zap 'step:bow' 'chicken': click trigger: script: - chat "Hello. How are you doing today?" - if { - chat "Something smells delicious. Is that cooked chicken you have? Could I buy it from you?" - narrate "Type yes if you agree." - zap 'step:chicken' } chat trigger: 'fine': trigger: "I am /fine/" script: - chat "That is great." 'yes': trigger: "/Yes/. You can have the chicken." script: - if { - chat "Thank you so much!" - take cooked_chicken - money take quantity:10 } else { - chat "I must be confused. That isn't chicken. Bye." } - zap 'step:starting' 'no': trigger: "No." script: - chat "ok." - zap 'step:starting*' 'howmuch': trigger: '/How much/ do you pay?' script: - chat "I will give you 10 dollars." 'bow': trigger: "I'd like to buy a /bow/" script: - if > 100 { - chat "Great, here you are." - give i@bow - money take quantity:100 - zap 'step:starting' } else { - chat "Sorry, you don't have enough money. I'll pay you some for cooked chickens, if you want."} - zap 'step:chicken' } 'bow': click trigger: script: - chat "Want to buy a bow?" - narrate "Type yes if you want to buy it." chat trigger: 'yes': trigger: "/Yes/, I'd love a bow!" script: - if =].to[100]> { - chat "Great, here you are." - give i@bow - money take quantity:100 - zap 'step:starting*' } else { - chat "Sorry, you don't have enough money. I'll pay you some for cooked chickens, if you want."} - zap 'step:chicken' } 'no': trigger: '/No/' script: - chat "Your loss." - zap 'step:chicken' 'chickens': trigger: "I want to sell some /chickens/." script: - if { - chat "Thank you so much!" - take i@cooked_chicken - money take quantity:10 } else { - chat "I must be confused. That isn't chicken. Bye." } - zap 'step:starting'