Project1

标题: 求助,我的游戏会在后台也可以按键盘 [打印本页]

作者: yang1zhi    时间: 2017-4-26 11:08
标题: 求助,我的游戏会在后台也可以按键盘
没有使用后台运行的脚本。
实际也没有后台运行,切出来过会切会去,还是刚才的进度。
就是键盘是可以操作的。
作者: congwsbn    时间: 2017-4-26 15:04
某些脚本会造成这样的情况,看看是哪个脚本出问题了吧……
作者: 【蛋塔】    时间: 2017-4-27 22:34
RUBY 代码复制
  1. #此脚本用于挂机获得经验之类所用。
  2. #
  3. #
  4. #打开后台  事件脚本:$_Start.call
  5. #关闭后台  事件脚本:$_Stop.call
  6. #
  7. unless $_Start
  8.  
  9.  
  10. $_Start = Win32API.new("Lib/BackgroundRunning","Start",'V','L')
  11. $_Stop = Win32API.new("Lib/BackgroundRunning","Stop",'V','L')
  12. $_OnFocus = Win32API.new("Lib/BackgroundRunning","OnFocus",'V','L')
  13.  
  14. $_Start.call
  15.  
  16. module Input
  17.   InputUpdate = method :update
  18.   InputTrigger = method :trigger?
  19.   InputPress = method :press?
  20.   InputRepeat = method :repeat?
  21.   InputDir4 = method :dir4
  22.   InputDir8 = method :dir8
  23.   def self.update
  24.     InputUpdate.call if $_OnFocus.call != 0
  25.   end
  26.   def self.trigger?(num)
  27.     return $_OnFocus.call != 0 ? InputTrigger.call(num) : false
  28.   end
  29.   def self.press?(num)
  30.     return $_OnFocus.call != 0 ? InputPress.call(num) : false
  31.   end
  32.   def self.repeat?(num)
  33.     return $_OnFocus.call != 0 ? InputRepeat.call(num) : false
  34.   end
  35.   def self.dir4
  36.     return $_OnFocus.call != 0 ? InputDir4.call : 0   
  37.   end
  38.   def self.dir8
  39.     return $_OnFocus.call != 0 ? InputDir8.call : 0   
  40.   end
  41. end
  42.  
  43.  
  44. end


只有脚本可不行,需要在工程目录中增加这个: Lib.rar (19.1 KB, 下载次数: 75)




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1