设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2430|回复: 11
打印 上一主题 下一主题

[已经解决] 跳過視頻脚本

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3680
在线时间
203 小时
注册时间
2018-6-17
帖子
172
跳转到指定楼层
1
发表于 2019-1-27 14:42:54 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
10星屑
怎麽跳過失視頻,就是類似某些游戲按右鍵、shift、ctrl之類的就直接結束視頻。

Lv4.逐梦者

梦石
1
星屑
14504
在线时间
2086 小时
注册时间
2017-9-28
帖子
662
2
发表于 2019-1-27 14:42:55 | 只看该作者
  1. #==============================================================================
  2. #
  3. # [ACE]EST_SOV_Video_Player ++ Conversion
  4. #
  5. # v1.4
  6. #==============================================================================
  7. # Author : Estriole
  8. # (Conversion to ace and improving)
  9. # VX version author: SuperOverlord
  10. #
  11. # also credit Crystal Noel for solution for title that have encoding problem character
  12. # also credit ruin for fixes he made to this script.
  13. #
  14. # History :
  15. # version 1.4 2013.05.16 - apply fixes from ruin. typo error and ability to use
  16. #                          play video using battle event page.
  17. # version 1.3 2013.03.05 - create configuration for people that have encoding character
  18. #                          problem with their title. ex: Pokémon Ace.
  19. #                          set the IGNORE_TITLE to true inside module Sov::Video
  20. # version 1.2 2012.09.27 - made if game at fullscreen automaticly become windowed
  21. # version 1.1 2012.09.25 - some bug fix. now avi video can played at full screen mode(alt enter) with some position error.
  22. #                        - can play other format such as mkv but it will play full screen and when played at full screen
  23. #                          mode (alt enter) the size will be smaller and the game switched.
  24. #                        - basicly this script not support full screen game yet. will try to fix this in next version
  25. # version 1.0 2012.09.23 - finish converting + some change
  26. #
  27. #
  28. #==============================================================================
  29. # 功能:
  30. #------------------------------------------------------------------------------
  31. # o 使用一条简单的事件脚本指令在地图或战斗中播放视频
  32. #
  33. # o 可以在视频播放时任意暂停或停止 .
  34. #
  35. # o 全屏或只在游戏窗口播放视频.
  36. #
  37. # o 设定技能视频,在造成伤害之前播放 .
  38. #
  39. # o 不仅可以设定技能视频,还可以设定物品视频
  40. #
  41. # o 可以在标题画面之前播放视频
  42. #
  43. #==============================================================================
  44. # 使用方法:
  45. #------------------------------------------------------------------------------
  46. # o 把所有视频放在一个文件夹里,文件夹的名称在下面的设定部分设定
  47. #   如果文件夹不存在,第一次运行游戏时,系统会自动创建这个文件夹 .
  48. #
  49. # o 在地图中播放视频.
  50. #
  51. #   - 查看下面的“可用脚本”.
  52. #
  53. # o 在战斗中播放视频.
  54. #
  55. #   - 使用在地图播放视频的脚本就可以了,都一样的 .
  56. #
  57. #   - 你还可以设定技能、物品视频,在造成伤害前播放视频.
  58. #     使用技能备注:
  59. #     1) <video_name = "文件名">
  60. #        ~ “文件名”是视频文件的文件名,如果文件名的拓展名缺失,会使用第一个和
  61. #           视频文件名匹配的文件.
  62. #          (文件名请用双引号括起来)
  63. #
  64. #      除了上面这个备注,还有下面这两个备注可以使用. 下面这两个备注仅在“放在上
  65. #      面这条备注之下”时有效 .
  66. #      如果你不使用这两个备注,则这个视频视为既可以被停止,又可以被暂停 .
  67. #
  68. #      2) <video_exitable = n>   ~ 这个视频可以被停止键停止播放吗?
  69. #      3) <video_pausable = n>   ~ 这个视频可以被暂停吗?
  70. #         ~ n 替换为 t 或 f (t : true, f : false)
  71. #
  72. #      对于视频的参数 (x坐标、y坐标、视频宽高、是否全屏等),请在下面的可用脚本
  73. #      中查看
  74. #
  75. # o 在标题画面之前播放视频
  76. # 在本脚本中 ctrl + f 搜索 : 标题视频设定
  77. # 吧
  78. # @video_title = nil
  79. # 改为
  80. # @video_title = "不带拓展名的视频文件名"
  81. #
  82. #==============================================================================
  83. # 可用脚本:
  84. #------------------------------------------------------------------------------
  85. # 使用事件指令中的“使用脚本”
  86. #------------------------------------------------------------------------------
  87. # o 改变默认视频的参数.
  88. #
  89. #  1) Video.default_x = n            #改变视频x坐标
  90. #  2) Video.default_y = n            #改变视频y坐标
  91. #  3) Video.default_width  = n       #改变视频宽度
  92. #  4) Video.default_height = n       #改变视频高度
  93. #  5) Video.fullscreen = true/false  #改变视频全屏设定,默认为false,因为可能会出错
  94. #  
  95. #  上面五个脚本中:
  96. #  ~ n 替换为整数
  97. #
  98. # o 播放视频
  99. #
  100. #   play_video(文件名,可停止?,可暂停?)
  101. #  
  102. # 例子:play_video("video",true,false)
  103. #==============================================================================
  104. # 兼容性:
  105. #------------------------------------------------------------------------------
  106. # o 技能视频的成功率取决于你的战斗系统是否兼容,不过问题应该不大.
  107. #==============================================================================
  108. # Credit:
  109. #------------------------------------------------------------------------------
  110. # o Credit goes to Trebor and Berka whose scripts helped be figure out the
  111. #   mci_send_stringA function.
  112. #==============================================================================

  113. module SOV
  114.   module Video
  115.   #--------------------------------------------------------------------------
  116.   # 设定部分
  117.   #--------------------------------------------------------------------------
  118.     # 视频放在"Videos"文件夹中.
  119.     DIR_NAME = "Videos"
  120.     # 停止视频的按键
  121.     EXIT_INPUT  = Input::B
  122.     # 暂停视频的按键
  123.     PAUSE_INPUT = Input::C
  124.     # 是否无视标题。如果你的标题中有类似é这样奇怪的字符,请设定为true
  125.     IGNORE_TITLE = true
  126.   #--------------------------------------------------------------------------
  127.   # End Configuration
  128.   #--------------------------------------------------------------------------
  129.   end
  130. end

  131. module SceneManager
  132. ################ 标题视频设定 #######################  

  133.   @video_title = nil  # 如果要播放标题视频,请把nil改为"视频文件名"  
  134.   
  135. ################ END CONFIGURATION ##########################################  
  136.   def self.run
  137.     DataManager.init
  138.     Audio.setup_midi if use_midi?
  139.     if @video_title != nil
  140.     video = Cache.video(@video_title)
  141.     video.exitable = true # True/False
  142.     video.pausable = true # True/False
  143.     Video.play(video)
  144.     end
  145.     @scene = first_scene_class.new
  146.     @scene.main while @scene
  147.   end
  148. end

  149. class << Graphics
  150.   def Graphics.fullscreen? # Property
  151.     screen_size = Win32API.new('user32', 'GetSystemMetrics', 'I', 'I')
  152.     screen_width = screen_size.call(0);   screen_height = screen_size.call(1)   
  153.     detect_fullscreen = false
  154.     detect_fullscreen = true if screen_width == 640 and screen_height == 480
  155.     return detect_fullscreen
  156.   end
  157.   def Graphics.toggle_fullscreen # Main function
  158.     keybd = Win32API.new 'user32.dll', 'keybd_event', ['i', 'i', 'l', 'l'], 'v'
  159.     keybd.call(0xA4, 0, 0, 0)
  160.     keybd.call(13, 0, 0, 0)
  161.     keybd.call(13, 0, 2, 0)
  162.     keybd.call(0xA4, 0, 2, 0)   
  163.   end
  164. end

  165. #==============================================================================
  166. # Import
  167. #------------------------------------------------------------------------------
  168. $imported = {} if $imported == nil
  169. $imported['Videos'] = true
  170. #==============================================================================

  171. #==============================================================================
  172. # ** SOV::Video::Commands
  173. #==============================================================================

  174. module SOV::Video::Commands
  175.   #--------------------------------------------------------------------------
  176.   # * Play a video
  177.   #  filename : video's filename (with or without extension)
  178.   #  exitable : Can the video be exited
  179.   #  pausable : Can the video be paused
  180.   #--------------------------------------------------------------------------
  181.   def play_video(filename,exitable=true,pausable=true)
  182.     video = Cache.video(filename)
  183.     video.exitable = exitable
  184.     video.pausable = pausable
  185.     $game_map.video = video
  186.   end
  187.   #---------------------------------------------------------------------------
  188.   # Define as module function
  189.   #---------------------------------------------------------------------------
  190.   module_function :play_video
  191. end

  192. #==============================================================================
  193. # ** SOV::Video::Regexp
  194. #==============================================================================

  195. module SOV::Video::Regexp
  196.   #--------------------------------------------------------------------------
  197.   # * Skill
  198.   #--------------------------------------------------------------------------
  199.   module Skill
  200.     FILENAME   = /<video[_ ]?(?:file)?name = "(.+)">/i
  201.     PAUSABLE   = /<video[_ ]?paus(?:e|able) = (t|f)>/i
  202.     EXITABLE   = /<video[_ ]?exit(?:able)? = (t|f)>/i
  203.   end
  204. end

  205. #==============================================================================
  206. # ** SOV::Game
  207. #==============================================================================

  208. module SOV::Game
  209.   #--------------------------------------------------------------------------
  210.   # Constants
  211.   #--------------------------------------------------------------------------
  212.   INI = 'Game'
  213.   #--------------------------------------------------------------------------
  214.   # * Get the game windows handle
  215.   #--------------------------------------------------------------------------
  216.   def self.hwnd
  217.     unless defined?(@@hwnd)
  218.       find_window = Win32API.new('user32','FindWindow','pp','i')
  219. #      @@hwnd = find_window.call('RGSS Player',title)  
  220.       gamefullscreen = Graphics.fullscreen?
  221.       @@hwnd = find_window.call('RGSS Player',title)  
  222.     end
  223.     return @@hwnd
  224.   end
  225.   #--------------------------------------------------------------------------
  226.   # * Get game title
  227.   #--------------------------------------------------------------------------
  228.   def self.title
  229.     unless defined?(@@title)
  230.       @@title = read_ini('title')
  231.     end
  232.     return @@title
  233.   end
  234.   #--------------------------------------------------------------------------
  235.   # * Read ini (Returns nil or match)
  236.   #--------------------------------------------------------------------------
  237.   def self.read_ini(variable,filename=INI)
  238.     return nil if variable == 'title' && SOV::Video::IGNORE_TITLE
  239.     reg = /^#{variable}=(.*)$/
  240.     File.foreach(filename+'.ini') { |line| break($1) if line =~ reg }
  241.   end
  242. end

  243. #==============================================================================
  244. # ** Cache
  245. #==============================================================================

  246. module Cache
  247.   #--------------------------------------------------------------------------
  248.   # Class Variables
  249.   #--------------------------------------------------------------------------
  250.   @@vcache = {}
  251.   #--------------------------------------------------------------------------
  252.   # Define as class methods
  253.   #--------------------------------------------------------------------------
  254.   class << self
  255.     #------------------------------------------------------------------------
  256.     # Alias List
  257.     #------------------------------------------------------------------------
  258.     alias sov_video_clear clear unless $@
  259.     #------------------------------------------------------------------------
  260.     # * Get a video object
  261.     #  filename : basename of file
  262.     #------------------------------------------------------------------------
  263.     def video(filename)
  264.       # Get full filename if extension is missing
  265.       if File.extname(filename) == ''
  266.         files = Dir["#{SOV::Video::DIR_NAME}/#{filename}.*"]
  267.         filename = File.basename(files[0]) # Set as first matching file
  268.       end
  269.       # Create or get the video object.
  270.       if @@vcache.has_key?(filename)
  271.         @@vcache[filename]
  272.       else
  273.         @@vcache[filename] = Video.new(filename)
  274.       end
  275.     end
  276.     #------------------------------------------------------------------------
  277.     # * Clear
  278.     #------------------------------------------------------------------------
  279.     def clear
  280.       @@vcache.clear
  281.       sov_video_clear
  282.     end
  283.   end
  284. end

  285. #==============================================================================
  286. # ** RPG::Skill
  287. #==============================================================================

  288. class RPG::UsableItem
  289.   #--------------------------------------------------------------------------
  290.   # * Determine if skill has a video skill
  291.   #--------------------------------------------------------------------------
  292.   def video
  293.     if @video == nil
  294.       @note.each_line { |line|
  295.         if @video == nil
  296.           @video = Cache.video($1) if line =~ SOV::Video::Regexp::Skill::FILENAME
  297.         else
  298.           @video.pausable = ($1 == 't') if line =~ SOV::Video::Regexp::Skill::PAUSABLE
  299.           @video.exitable = ($1 == 't') if line =~ SOV::Video::Regexp::Skill::EXITABLE
  300.         end
  301.       }
  302.       @video = :invalid if @video == nil
  303.     end
  304.     return @video
  305.   end
  306. end

  307. #==============================================================================
  308. # ** Video
  309. #------------------------------------------------------------------------------
  310. #  Class handling playing videos.
  311. #==============================================================================

  312. class Video
  313.   #--------------------------------------------------------------------------
  314.   # Constants
  315.   #--------------------------------------------------------------------------
  316.   TYPE_AVI  = 'avivideo'
  317.   TYPE_MPEG = 'mpegvideo'
  318.   #--------------------------------------------------------------------------
  319.   # Class Variables
  320.   #--------------------------------------------------------------------------
  321.   @@default_x = 0
  322.   @@default_y = 0
  323.   @@default_width  = Graphics.width
  324.   @@default_height = Graphics.height
  325.   @@fullscreen = false
  326.   #--------------------------------------------------------------------------
  327.   # * Get and Set default_x/y/width/height
  328.   #--------------------------------------------------------------------------
  329.   for d in %w(x y width height)
  330.     # Define setter method
  331.     module_eval(%Q(def self.default_#{d}=(i); @@default_#{d} = i; end))
  332.     # Define getter method
  333.     module_eval(%Q(def self.default_#{d}; @@default_#{d}; end))
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # * Get fullscreen
  337.   #--------------------------------------------------------------------------
  338.   def self.fullscreen
  339.     @@fullscreen
  340.   end  
  341.   #--------------------------------------------------------------------------
  342.   # * Set fullscreen
  343.   #--------------------------------------------------------------------------
  344.   def self.fullscreen=(val)
  345.     @@fullscreen = val
  346.   end
  347.   #--------------------------------------------------------------------------
  348.   # * Win32API
  349.   #--------------------------------------------------------------------------
  350.   @@mciSendStringA = Win32API.new('winmm','mciSendStringA','pplp','i')
  351.   #--------------------------------------------------------------------------
  352.   # * Video Command
  353.   #  command_string : string following mci_command_string format
  354.   #  buffer : string to retrieve return data
  355.   #  buffer_size : number of characters in buffer
  356.   #  callback_handle : handle of window to callback to. Used if notify is used
  357.   #                    in the command string. (Not supported by game window)
  358.   #--------------------------------------------------------------------------
  359.   def self.send_command(cmnd_string,buffer='',buffer_size=0,callback_handle=0)
  360.     # Returns error code. No error if NULL
  361.     err = @@mciSendStringA.call(cmnd_string,buffer,buffer_size,callback_handle)
  362.     if err != 0
  363.       buffer = ' ' * 255
  364.       Win32API.new('winmm','mciGetErrorString','LPL','V').call(err,buffer,255)
  365.       raise(buffer.squeeze(' ').chomp('\000'))
  366.     end
  367.   end
  368.    
  369.   #--------------------------------------------------------------------------
  370.   # * Play a video
  371.   #--------------------------------------------------------------------------
  372.   def self.play(video)
  373.     # Make path and buffer
  374.     path = "#{SOV::Video::DIR_NAME}/#{video.filename}"
  375.     buffer = ' ' * 255
  376.     # Initialize device and dock window with game window as parent.
  377.     type = " type #{video.type}" if video.type != ''
  378.     send_command("open #{path}#{type} alias VIDEO style child parent #{SOV::Game.hwnd}")
  379.     # Display video in client rect at x,y with width and height.
  380.     x = video.x
  381.     y = video.y
  382.     width  = video.width
  383.     height = video.height
  384.     send_command("put VIDEO window at #{x} #{y} #{width} #{height}")
  385.     # Begin playing video
  386.     screen = @@fullscreen ? 'fullscreen' : 'window'
  387.     gamefullscreen = Graphics.fullscreen?
  388.     case video.type
  389.     when "avivideo"
  390.       if gamefullscreen == true
  391.       #send_command("put VIDEO window at #{x} #{y} 640 480")
  392.       Graphics.toggle_fullscreen
  393.       send_command("play VIDEO window")
  394.       else
  395.       send_command("play VIDEO window")
  396.       end
  397.     when "mpegvideo"
  398.         if gamefullscreen == true
  399.         Graphics.toggle_fullscreen
  400.         send_command("play VIDEO window")
  401.         else
  402.         send_command("play VIDEO fullscreen")
  403.         end
  404.     else
  405.     end
  406.     flag = 0
  407.     # Start Input and status processing loop
  408.     while buffer !~ /^stopped/
  409.       # Idle processing for a frame
  410.       sleep(1.0/Graphics.frame_rate)
  411.       # Get mode string
  412.       send_command('status VIDEO mode',buffer,255)
  413.       Input.update   
  414.       if Input.trigger?(SOV::Video::PAUSE_INPUT) and video.pausable?
  415.         Sound.play_cursor
  416.         if buffer =~ /^paused/                 # If already paused
  417.           send_command("resume VIDEO")         # Resume video
  418.         else                                   # Otherwise
  419.           send_command("pause VIDEO")          # Pause video
  420.         end
  421.       elsif Input.trigger?(SOV::Video::EXIT_INPUT) and video.exitable?
  422.         Sound.play_cancel
  423.         # Terminate loop on exit input
  424.         break
  425.       end
  426.     end
  427.     # Terminate the device
  428.     send_command('close VIDEO')
  429.   end
  430.   #--------------------------------------------------------------------------
  431.   # Public Instance Variables
  432.   #--------------------------------------------------------------------------
  433.   attr_accessor :x
  434.   attr_accessor :y
  435.   attr_accessor :width
  436.   attr_accessor :height
  437.   attr_writer :exitable
  438.   attr_writer :pausable
  439.   attr_reader :filename
  440.   #--------------------------------------------------------------------------
  441.   # * Initialize
  442.   #--------------------------------------------------------------------------
  443.   def initialize(filename)
  444.     unless FileTest.file?("#{SOV::Video::DIR_NAME}/#{filename}")
  445.       raise(Errno::ENOENT,filename)
  446.     end
  447.     @filename = filename
  448.     @x = @@default_x
  449.     @y = @@default_y
  450.     @width  = @@default_width
  451.     @height = @@default_height
  452.     @exitable = true
  453.     @pausable = true
  454.   end
  455.   #--------------------------------------------------------------------------
  456.   # * Get Type
  457.   #--------------------------------------------------------------------------
  458.   def type
  459.     if @type == nil
  460.       case File.extname(@filename)
  461.       when '.avi'; @type = TYPE_AVI
  462.       when '.mpeg'||'.mpg'; @type = TYPE_MPEG
  463.       else
  464.         @type = TYPE_MPEG#''
  465.       end
  466.     end
  467.     @type
  468.   end
  469.   #--------------------------------------------------------------------------
  470.   # * Is the video exitable?
  471.   #--------------------------------------------------------------------------
  472.   def exitable?
  473.     @exitable
  474.   end
  475.   #--------------------------------------------------------------------------
  476.   # * Is the video pausable?
  477.   #--------------------------------------------------------------------------
  478.   def pausable?
  479.     @pausable
  480.   end
  481.   #--------------------------------------------------------------------------
  482.   # Access
  483.   #--------------------------------------------------------------------------
  484.   private_class_method :send_command  
  485. end

  486. #==============================================================================
  487. # ** Game_Interpreter
  488. #==============================================================================

  489. class Game_Interpreter
  490.   #--------------------------------------------------------------------------
  491.   # Import
  492.   #--------------------------------------------------------------------------
  493.   include(SOV::Video::Commands)
  494. end

  495. #==============================================================================
  496. # ** Game_Map
  497. #==============================================================================

  498. class Game_Map
  499.   #--------------------------------------------------------------------------
  500.   # Public Instance Variables
  501.   #--------------------------------------------------------------------------
  502.   attr_accessor :video  
  503. end

  504. #==============================================================================
  505. # ** Scene_Map
  506. #==============================================================================

  507. class Scene_Map
  508.   #--------------------------------------------------------------------------
  509.   # Alias List
  510.   #--------------------------------------------------------------------------
  511.   alias sov_video_update update unless $@
  512.   #--------------------------------------------------------------------------
  513.   # * Play Video
  514.   #--------------------------------------------------------------------------
  515.   def play_video(video)
  516.     # Memorize and stop current bgm and bgs
  517.     bgm = RPG::BGM.last
  518.     bgs = RPG::BGS.last
  519.     RPG::BGM.stop
  520.     RPG::BGS.stop
  521.     # Play video
  522.     Video.play(video)
  523.     # Restart bgm and bgs
  524.     bgm.play
  525.     bgs.play
  526.   end
  527.   #--------------------------------------------------------------------------
  528.   # * Update
  529.   #--------------------------------------------------------------------------
  530.   def update
  531.     if $game_map.video != nil
  532.       play_video($game_map.video)
  533.       $game_map.video = nil
  534.       Input.update
  535.     else
  536.       sov_video_update
  537.     end
  538.   end
  539. end

  540. #==============================================================================
  541. # ** Scene_Battle
  542. #==============================================================================

  543. class Scene_Battle
  544.   #--------------------------------------------------------------------------
  545.   # * Alias list
  546.   #--------------------------------------------------------------------------
  547.   alias sov_video_update_battle update unless $@
  548.   alias sov_video_use_item use_item unless $@
  549.   #--------------------------------------------------------------------------
  550.   # * Play Video
  551.   #--------------------------------------------------------------------------
  552.   def play_video(video)
  553.     # Memorize and stop current bgm
  554.     bgm = RPG::BGM.last
  555.     RPG::BGM.stop
  556.     # Play video
  557.     Video.play(video)
  558.     # Restart bgm
  559.     bgm.play
  560.   end
  561.   #--------------------------------------------------------------------------
  562.   # * Execute Action Skill
  563.   #--------------------------------------------------------------------------
  564.   def use_item
  565.     skill = @subject.current_action.item   
  566.     if skill.video.is_a?(Video)
  567.       execute_action_video(skill)
  568.       sov_video_use_item
  569.     else
  570.       sov_video_use_item
  571.     end
  572.   end
  573.   #--------------------------------------------------------------------------
  574.   # * Execute Action Video
  575.   #--------------------------------------------------------------------------
  576.   def execute_action_video(skill)
  577.     br = Graphics.brightness
  578.     120.times { |i| Graphics.brightness = 255 - 255/60 * i; Graphics.update }
  579.     # Play video
  580.     play_video(skill.video)
  581.     # Reset brightness
  582.     Graphics.brightness = br
  583.   end
  584.   #ADDED UPDATE FUNCTION FROM SCENE_MAP TO SCENE_BATTLE
  585.   def update
  586.     if $game_map.video != nil
  587.       play_video($game_map.video)
  588.       $game_map.video = nil
  589.       Input.update
  590.     else
  591.       sov_video_update_battle
  592.     end
  593.   end
  594.   
  595. end





  596. #==============================================================================
  597. # Pre-Main Processing
  598. #==============================================================================

  599. unless FileTest.directory?(SOV::Video::DIR_NAME) # If directory doesn't exist.
  600.   Dir.mkdir(SOV::Video::DIR_NAME)                # Make the directory
  601. end

  602. =begin
  603. =end
复制代码

评分

参与人数 1星屑 +40 收起 理由
VIPArcher + 40 认可答案

查看全部评分

VA外站脚本汉化群:226308173   |    部分远古文件备份:https://wwzv.lanzoue.com/b02rac5pc  密码:acgm
回复

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
13559
在线时间
2753 小时
注册时间
2014-10-4
帖子
756

R考场第七期纪念奖

3
发表于 2019-1-28 02:59:49 | 只看该作者
本能觉得 按F12既然能关掉播放
内部就该有控制逻辑
然后就跟进函数看了一下 发现目标的实现比想象的简单
因为后台时候不播放 所以实现暂停继续也应该可以 不过就算了..
RUBY 代码复制
  1. module Graphics
  2.   #按键跳过视频
  3.   #逆向了 适用于300的dll
  4.   #借用视频播放过程的一个子函数嵌入了检测按键的代码
  5.   #下面是用于跳过视频的按键 默认 A + S
  6.   #详阅 Virtual-Key Codes
  7.   #要单键的话就设置成一样的
  8.   #或者看着改 就是复制粘贴删除的问题
  9.   key1 = 0x41
  10.   key2 = 0x53
  11.   #大写防止被GC吃掉
  12.   SKIP_VIDEO_CODE = [0x51,                               # push ecx
  13.  
  14.                      0x6A, key1,                         # push key
  15.                      # dll 没被改过 下面这句应当不会出错
  16.                      0xFF, 0x15, 0x88, 0x23, 0x1A, 0x10, # call GetKeyState
  17.                      0x98,                               # cwde
  18.                      0x85, 0xC0,                         # test eax,eax
  19.                      0x78, 0x08,                         # jjjj
  20.                      0x59,                               # pop ecx
  21.                      0xB8, 0xE0, 0xF1, 0x10, 0x10,       # mov eax,原函数
  22.                      0xFF, 0xE0,                         # jmp eax
  23.  
  24.                      0x6A, key2,                         # push key
  25.                      0xFF, 0x15, 0x88, 0x23, 0x1A, 0x10, # call GetKeyState
  26.                      0x98,                               # cwde
  27.                      0x85, 0xC0,                         # test eax,eax
  28.                      0x78, 0x08,                         # jjjj
  29.                      0x59,                               # pop ecx
  30.                      0xB8, 0xE0, 0xF1, 0x10, 0x10,       # mov eax,原函数
  31.                      0xFF, 0xE0,                         # jmp eax
  32.                      # 回 0 停止播放
  33.                      0x59,                               # pop ecx
  34.                      0x33, 0xC0,                         # xor eax,eax
  35.                      0xC3].pack("C*")                    # ret
  36.   aa = [SKIP_VIDEO_CODE].pack("p").unpack("l")[0]
  37.   ww = Win32API.new("kernel32", "WriteProcessMemory", "llpll", "v")
  38.   ww.call(-1, 0x100027EE, [aa - 0x100027F2].pack("l"), 4, 0)
  39. end

点评

谢谢!  发表于 2019-1-28 21:48
这也tql8  发表于 2019-1-28 15:46
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3680
在线时间
203 小时
注册时间
2018-6-17
帖子
172
4
 楼主| 发表于 2019-1-28 15:27:52 | 只看该作者

出現錯誤……

CW.PNG (10.74 KB, 下载次数: 12)

CW.PNG

点评

那是啥……  发表于 2019-1-28 18:02
你是不是没加双引号............  发表于 2019-1-28 15:54
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3680
在线时间
203 小时
注册时间
2018-6-17
帖子
172
5
 楼主| 发表于 2019-1-28 15:28:53 | 只看该作者
有沒有使用例子?
回复

使用道具 举报

Lv5.捕梦者 (管理员)

老黄鸡

梦石
0
星屑
39665
在线时间
7484 小时
注册时间
2009-7-6
帖子
13483

开拓者贵宾

6
发表于 2019-1-28 15:45:59 | 只看该作者

所以2楼不是有答案吗……
RGDirect - DirectX驱动的RGSS,点我了解.
RM全系列成套系统定制请联系QQ1213237796
不接受对其他插件维护的委托
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3680
在线时间
203 小时
注册时间
2018-6-17
帖子
172
7
 楼主| 发表于 2019-1-28 18:38:19 | 只看该作者
這……………………

CW.PNG (203.11 KB, 下载次数: 8)

CW.PNG

点评

啊啊……這個衹是隨便取的名字,不用在意/  发表于 2019-1-28 18:38
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-26 10:41

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表