TheoAllen

Theo - Auto-Toggle Switches

Aug 29th, 2013
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.98 KB | None | 0 0
  1. # =============================================================================
  2. # TheoAllen - Auto-Toggle Switches
  3. # Version : 1.0
  4. # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
  5. # (This script documentation is written in informal indonesian language)
  6. # =============================================================================
  7. ($imported ||= {})[:Theo_AutoSwitch] = true
  8. # =============================================================================
  9. # CHANGE LOGS:
  10. # -----------------------------------------------------------------------------
  11. # 2013.08.22 - Finished script
  12. # =============================================================================
  13. =begin
  14.  
  15.   Perkenalan :
  16.   Script ini berfungsi untuk ngebikin game switches otomatis nyala dengan
  17.   kondisi yang ditentuin berdasar script
  18.  
  19.   Cara penggunaan :
  20.   Pasang diatas main namun dibawah material.
  21.   Edit konfignya
  22.  
  23.   Terms of Use :
  24.   Credit gw, TheoAllen. Kalo semisal u bisa ngedit2 script gw trus jadi lebih
  25.   keren, terserah. Ane bebasin. Asal ngga ngeklaim aja. Kalo semisal mau
  26.   dipake buat komersil, jangan lupa, gw dibagi gratisannya.  
  27.  
  28. =end
  29. # =============================================================================
  30. # Konfigurasi :
  31. # =============================================================================
  32. module THEO
  33.   module Switch
  34.    
  35.     List = {
  36.     # ID => "Script Eval"
  37.       5  => "$game_system.playtime > 10",
  38.     }
  39.    
  40.   end
  41. end
  42. # =============================================================================
  43. # Akhir dari konfigurasi
  44. # =============================================================================
  45. class Game_Switches
  46.  
  47.   def update
  48.     THEO::Switch::List.each do |id,script|
  49.       cond = eval(script)
  50.       self[id] = cond if self[id] != cond
  51.     end
  52.   end
  53.  
  54. end
  55.  
  56. class Scene_Base
  57.  
  58.   alias theo_auto_toggle_switches_update update
  59.   def update
  60.     theo_auto_toggle_switches_update
  61.     $game_switches.update
  62.   end
  63.  
  64. end
Advertisement
Add Comment
Please, Sign In to add comment