#此脚本用于挂机获得经验之类所用。 # # #打开后台 事件脚本:$_Start.call #关闭后台 事件脚本:$_Stop.call # unless $_Start $_Start = Win32API.new("Lib/BackgroundRunning","Start",'V','L') $_Stop = Win32API.new("Lib/BackgroundRunning","Stop",'V','L') $_OnFocus = Win32API.new("Lib/BackgroundRunning","OnFocus",'V','L') $_Start.call module Input InputUpdate = method :update InputTrigger = method :trigger? InputPress = method :press? InputRepeat = method :repeat? InputDir4 = method :dir4 InputDir8 = method :dir8 def self.update InputUpdate.call if $_OnFocus.call != 0 end def self.trigger?(num) return $_OnFocus.call != 0 ? InputTrigger.call(num) : false end def self.press?(num) return $_OnFocus.call != 0 ? InputPress.call(num) : false end def self.repeat?(num) return $_OnFocus.call != 0 ? InputRepeat.call(num) : false end def self.dir4 return $_OnFocus.call != 0 ? InputDir4.call : 0 end def self.dir8 return $_OnFocus.call != 0 ? InputDir8.call : 0 end end end
#此脚本用于挂机获得经验之类所用。
#
#
#打开后台 事件脚本:$_Start.call
#关闭后台 事件脚本:$_Stop.call
#
unless $_Start
$_Start = Win32API.new("Lib/BackgroundRunning","Start",'V','L')
$_Stop = Win32API.new("Lib/BackgroundRunning","Stop",'V','L')
$_OnFocus = Win32API.new("Lib/BackgroundRunning","OnFocus",'V','L')
$_Start.call
module Input
InputUpdate = method :update
InputTrigger = method :trigger?
InputPress = method :press?
InputRepeat = method :repeat?
InputDir4 = method :dir4
InputDir8 = method :dir8
def self.update
InputUpdate.call if $_OnFocus.call != 0
end
def self.trigger?(num)
return $_OnFocus.call != 0 ? InputTrigger.call(num) : false
end
def self.press?(num)
return $_OnFocus.call != 0 ? InputPress.call(num) : false
end
def self.repeat?(num)
return $_OnFocus.call != 0 ? InputRepeat.call(num) : false
end
def self.dir4
return $_OnFocus.call != 0 ? InputDir4.call : 0
end
def self.dir8
return $_OnFocus.call != 0 ? InputDir8.call : 0
end
end
end
只有脚本可不行,需要在工程目录中增加这个:
Lib.rar
(19.1 KB, 下载次数: 75)
|