Advertisement
Zeriab

(WIP) Combo script - Test example

Jan 19th, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.21 KB | None | 0 0
  1.   ##
  2.   # Press A within the first 20 frames
  3.   # Press L + R between frame 20 inclusive and frame 40 exclusive
  4.   # Press C between frame 40 inclusive and frame 60 exclusive
  5.   # Release C between frame 70 inclusive and frame 90 exclusive
  6.   # Press A + B between frame 90 inclusive and frame 90 exclusive
  7.   #
  8.   def self.test_combo_start
  9.     kp_ab = Key_Press.new(Input::A, Input::B)
  10.     kp_a = Key_Press.new(Input::A)
  11.     kp_c = Key_Press.new(Input::C)
  12.     kp_lr = Key_Press.new(Input::L, Input::R)
  13.     true_condition = TrueCondition.new
  14.     tka_a = Trigger_Key_Action.new(kp_a, true_condition, 20)
  15.     tka_lr = Trigger_Key_Action.new(kp_lr, true_condition, 20)
  16.     tka_c = Trigger_Key_Action.new(kp_c, true_condition, 20)
  17.     rka_c = Release_Key_Action.new(kp_c, true_condition, 20, 10)
  18.     tka_ab = Trigger_Key_Action.new(kp_ab, true_condition, 20)
  19.     combo = Key_Combo.new
  20.     combo.put(tka_a, 0)
  21.     combo.put(tka_lr, 20)
  22.     combo.put(tka_c, 40)
  23.     combo.put(rka_c, 60)
  24.     combo.put(tka_ab, 90)
  25.     @@combo = combo
  26.     @@counter = 0
  27.   end
  28.  
  29.   def self.key_combo
  30.     res = @@combo.update
  31.     @@counter += 1
  32.     if res.nil?
  33.       return false
  34.     end
  35.     p res, @@counter
  36.     return true
  37.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement