Code |FrontPage |HiveTraits | ||
trigger :mytrig do |channel, machine, action, args|
case action when /join/ say '!do $system:version', machine do |reply| reply "got reply #{reply}" reply "channel:#{channel} machine:#{machine} action:#{action} args:#{args}" end when /part/ reply "#{machine} leaving #{channel}" reply "channel:#{channel} machine:#{machine} action:#{action} args:#{args}" end end end |
!create trigger mytr for join use mytrig
|
trigger :myargtrig do |channel, machine, action, args|
@me.reply "Created with args #{@initargs}" end |
!create trigger mytr for join use myargtrig(Created with this arg)
|
!create trigger dummyt on #hive for join use dummytrig
|
!create trigger dummyt for join use dummytrig
|
!create trigger dummyt for join use dummytrig(myargs)
|
!create trigger mytr for join use !do $sys:rdate[hivehome]
|
!create trigger newtrig on #hive for part use {|machine,args| @me.send_message machine, '!do $sys:rdate[webproxy]'}
|
!drop trigger dummytrig on #hive
|
!drop trigger dummytrig
|
!triggers on #hive
|
!triggers
|
!triggers on #hive for join
|
!triggers on #hive using dummytrig
|
!triggers on #hive for join using dummytrig
|