| 赞 | 72 |
| VIP | |
| 好人卡 | |
| 积分 | 23 |
| 经验 | |
| 最后登录 | 2022-3-9 |
| 在线时间 | 4033 小时 |
…あたしは天
- 梦石
- 0
- 星屑
- 2308
- 在线时间
- 4033 小时
- 注册时间
- 2010-10-4
- 回帖
- 10548
 
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 taroxd 于 2014-7-28 12:36 编辑
需要用到这个功能的人自然知道怎么用
[pre lang="ruby" line="1"]
#==============================================================================
# ★ 输出脚本
#==============================================================================
path = 'scripts'
ext = '.rb'
output = lambda do
Dir.mkdir(path) unless File.directory?(path)
$RGSS_SCRIPTS.each_with_index do |(_, tag, _, contents), i|
next unless tag.start_with?('★')..tag.start_with?('☆')
next if contents.force_encoding("utf-8").empty?
filename = tag.delete('/:*?"<>|\\')
if filename.empty?
msgbox "Warning: script #{i} with an invalid tag"
else
File.open("#{path}/#{filename}#{ext}", "wb") {|f| f << contents }
end
end
msgbox 'Scripts output successfully.'
exit
end
#~ output.call if $TEST
[/pre] |
|