Project1
标题: 想要按键随时都有效开头结尾怎么写? [打印本页]
作者: he11120 时间: 2012-4-10 17:44
标题: 想要按键随时都有效开头结尾怎么写?
本帖最后由 eve592370698 于 2012-4-16 15:50 编辑
我用了个截图脚本,想要在任何时候按键都有效,开头和结尾写什么?(调用按键那部分我会了)。
‘‘──he11120于2012-4-10 22:11补充以下内容
战斗中按键是不是都无效啊?
截图功能所需文件.rar
(678.07 KB, 下载次数: 2)
添加代码文字无效。。直接复制了。- #==============================================================================
- # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
- #============================================================================== #
- # Screenshot V2
- # Screen::shot 调用
- # Screenshot Script v1 & screenshot.dll v1 created by: Andreas21
- # Screenshot Script v2 created/edit by: cybersam
- # the autor is found on a german board...
- # the comments are added by me...
- # since the autor didnt want to add any comment...
- # so thats it from here...
- # have fund with it... ^-^
- #
- # oh yea.. the needed command line is found in "Scene_Map" in "def update"
- #
- #===============================================================================
- module Screen
- @screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), ''
- @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
- @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
- module_function
- #-----------------------------------------------------------------------------
- # here comes the stuff...
- # i add here the stuff for automatic change of the number for the screenshot
- # so it wont overrite the old one...
- # if you want to change so stuff change them in this line below
- # or you can change them in your command line... like
- # Screen::shot("screenshot", 2)
- # this change the name and the type of the screenshot
- # (0 = bmp, 1 = jpg and 2 = png)
- # ----------------------------------------------------------------------------
- def shot(file = "screenshot", typ = 1)
- # to add the right extension...
- if typ == 0
- typname = ".bmp"
- elsif typ == 1
- typname = ".jpg"
- elsif typ == 2
- typname = ".png"
- end
- $game_variables[100] += 1
- file_index = 0
- dir = "screenshot/"
- # make the filename....
- file_name = dir + file.to_s + $game_variables[100].to_s + typname.to_s
- # make the screenshot.... Attention dont change anything from here on....
- @screen.call(0,0,640,480,file_name,handel,typ)
- end
- # find the game window...
- def handel
- game_name = "\0" * 256
- @readini.call('Game','Title','',game_name,255,".\\Game.ini")
- game_name.delete!("\0")
- return @findwindow.call('RGSS Player',game_name)
- end
- end
- #==============================================================================
- # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
- #==============================================================================
复制代码