Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'yaml'
- require 'ap'
- y = YAML::load(open('./macros.yaml'))
- lines = y["bod"]["lines"]
- lines.each {|line|
- if line.is_a? Hash
- sleep line["seconds"] unless !line.has_key? "seconds"
- if line.has_key?("type") && line["type"] == "action"
- puts "action - #{line["msg"]}"
- else
- puts line["msg"]
- end
- elsif line.is_a? String
- puts line
- elsif line.is_a? Array
- puts line.join("\n")
- else
- puts line.to_s
- end
- }
- # ----
- =begin
- macros.yaml:
- alart:
- random:
- - /!\ <input,'ALART'> /!\
- - /// <input,'ALART'> ///
- - \\\ <input,'ALART'> \\\
- bod:
- lines:
- - seconds: 2
- type: action
- msg: <input,nick> should go
- - eat a
- - bag of
- - type: action
- seconds: 5
- msg: DICKS!!!!
- drink:
- random:
- - type: action
- msg: gets <nick> a dr pepper
- - type: action
- msg: gets <nick> a coke
- - type: action
- msg: gets <nick> a pepsi
- - type: action
- msg: gets <nick> a glass of Sussex Golden ginger ale
- dumb bot:
- random:
- - Dumb human!
- - Dumb meatbag!
- - Stupid human!
- - Stupid meatbag!
- =end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement