查看: 1889|回复: 0

[已经过期] 关于程序停止工作

[复制链接]
梦石
2
星屑
34507
在线时间
614 小时
注册时间
2014-7-18
回帖
647

MZ评测员开拓者

发表于 2016-2-7 18:17:41 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
自己为了提高脚本水平,所以写了一个课程表显示系统,现在只写了一个投影,想要测试时,却发现只要选择课程表投影选项时,就会造成程序无响应,测试了win10和win8,都是这样... 360截图20160207181634261.jpg
这是我的所有脚本代码:
  1. $课程表 = []
  2. module DataManager
  3.   def self.check_player_location
  4.       msgbox("欢迎使用课程表显示系统!\n版本号:V0.1")
  5.   end
  6. end

  7. class Window_TitleCommand < Window_Command
  8.   #--------------------------------------------------------------------------
  9.   # ● 生成指令列表
  10.   #--------------------------------------------------------------------------
  11.   def make_command_list
  12.     add_command(Vocab::new_game, :new_game)#, continue_enabled)
  13.     add_command(Vocab::continue, :continue)
  14.     add_command(Vocab::shutdown, :shutdown)
  15.   end
  16. end

  17. class Scene_Title < Scene_Base
  18.   #--------------------------------------------------------------------------
  19.   # ● 指令“课程表投影”
  20.   #--------------------------------------------------------------------------
  21.   def command_new_game
  22.     close_command_window
  23.     SceneManager.goto(Scene_投影)
  24.   end
  25.   #--------------------------------------------------------------------------
  26.   # ● 指令“课程表设置”
  27.   #--------------------------------------------------------------------------
  28.   def command_continue
  29.     close_command_window
  30.     SceneManager.call(Scene_设置)
  31.   end
  32. end
  33. class Scene_投影 < Scene_Base
  34.   def start
  35.     super
  36.     投影
  37.   end
  38.   def 投影
  39.     x = Window_投影.new
  40.   end


  41. end
  42. class Window_投影 < Window_Base
  43.   def initialize
  44.     super(-15,-40,192,10000)
  45.     refresh
  46.   end
  47.   def update
  48.     super
  49.     refresh
  50.   end
  51.   def refresh
  52.     代入
  53.     投影(课程)
  54.   end
  55.   def 投影(a,b,c,d,e,f,g,h,i,j,s)
  56.     self.contents.font.name = ["楷体"]#_GB2312
  57.     self.contents.font.size = 48
  58.     变色 if 节次 == 1
  59.     draw_text(0,0,96,96,a)
  60.     还原
  61.     变色 if 节次 == 2
  62.     draw_text(0,40,96,96,b)
  63.     还原
  64.     变色 if 节次 == 3
  65.     draw_text(0,80,96,96,c)
  66.     还原
  67.     变色 if 节次 == 4
  68.     draw_text(0,120,96,96,d)
  69.     还原
  70.     变色 if 节次 == 11
  71.     draw_text(0,145,96,96,"—")
  72.     还原
  73.     变色 if 节次 == 5
  74.     draw_text(0,168,96,96,e)
  75.     还原
  76.     变色 if 节次 == 6
  77.     draw_text(0,208,96,96,f)
  78.     还原
  79.     变色 if 节次 == 7
  80.     draw_text(0,248,96,96,g)
  81.     还原
  82.     变色 if 节次 == 8
  83.     draw_text(0,288,96,96,h)
  84.     还原
  85.     变色 if 节次 == 12
  86.     draw_text(0,313,96,96,"—")
  87.     还原
  88.     变色 if 节次 == 9
  89.     draw_text(0,336,96,96,i)
  90.     还原
  91.     变色 if 节次 == 10
  92.     draw_text(0,376,96,96,j)
  93.     self.opacity = 0
  94.   end
  95.   def 代入
  96.     #判断星期
  97.     星期 = Time.new.wday
  98.     case 星期
  99.     when 1
  100.       s = 11
  101.     when 2
  102.       s = 21
  103.     when 3
  104.       s = 31
  105.     when 4
  106.       s = 41
  107.     when 5
  108.       s = 51
  109.     when 6
  110.       s = 61
  111.     when 0
  112.       s = 71
  113.     end
  114.     课程 = $课程表[s,10]
  115.     #判断正在上的课   
  116.     时 = Time.now.strftime("%H").to_i
  117.     分 = Time.now.strftime("%M").to_i
  118.     #第一节
  119.     节次 = 1 if 时 <= 8 && 分 <= 45
  120.     #第二节
  121.     节次 = 2 if 时 == 8 && 分 > 45
  122.     节次 = 2 if 时 == 9 && 分 <= 40
  123.     #第三节
  124.     节次 = 3 if 时 == 10 && 分 <= 55
  125.     节次 = 3 if 时 == 9 && 分 > 40
  126.     #第四节
  127.     节次 = 4 if 时 == 10 && 分 > 55
  128.     节次 = 4 if 时 == 11 && 分 <= 50
  129.     #中午
  130.     节次 = 11 if 时 == 11 && 分 > 50
  131.     节次 = 11 if 时 == 12
  132.     节次 = 11 if 时 == 13
  133.     节次 = 11 if 时 == 14 && $夏令时 == true
  134.     #第五节
  135.     节次 = 5 if 时 == 15 && 分 <= 45 && $夏令时 == true
  136.     节次 = 5 if 时 == 14 && 分 <= 45 && $夏令时 == false
  137.     #第六节
  138.     节次 = 6 if 时 == 15 && 分 > 45 && $夏令时 == true
  139.     节次 = 6 if 时 == 16 && 分 <= 40 && $夏令时 == true
  140.     节次 = 6 if 时 == 14 && 分 > 45 && $夏令时 == false
  141.     节次 = 6 if 时 == 15 && 分 <= 40 && $夏令时 == false
  142.     #第七节
  143.     节次 = 7 if 时 == 16 && 分 > 40 && $夏令时 == true
  144.     节次 = 7 if 时 == 17 && 分 <= 35 && $夏令时 == true
  145.     节次 = 7 if 时 == 15 && 分 > 50 && $夏令时 == false
  146.     节次 = 7 if 时 == 16 && 分 <= 55 && $夏令时 == false
  147.     #第八节
  148.     节次 = 8 if 时 == 17 && 分 > 35 && $夏令时 == true
  149.     节次 = 8 if 时 == 18 && 分 <= 30 && $夏令时 == true
  150.     节次 = 8 if 时 == 16 && 分 > 55 && $夏令时 == false
  151.     节次 = 8 if 时 == 17 && 分 <= 50 && $夏令时 == false
  152.     #小自习
  153.     节次 = 12 if 时 == 18 && 分 > 30 && $夏令时 == true
  154.     节次 = 12 if 时 == 19 && 分 <= 20 && $夏令时 == true
  155.     节次 = 12 if 时 == 17 && 分 > 45 && $夏令时 == false
  156.     节次 = 12 if 时 == 18 && $夏令时 == false
  157.     节次 = 12 if 时 == 19 && 分 <= 10 && $夏令时 == false
  158.     #晚1
  159.     节次 = 9 if 时 == 19 && 分 > 20 && $夏令时 == true
  160.     节次 = 9 if 时 == 20 && 分 <= 10 && $夏令时 == true
  161.     节次 = 9 if 时 == 19 && 分 > 10 && $夏令时 == false
  162.     节次 = 9 if 时 == 20 && 分 <= 0 && $夏令时 == false
  163.     #晚2
  164.     节次 = 10 if 时 == 20 && 分 > 10 && $夏令时 == true
  165.     节次 = 10 if 时 == 21 && $夏令时 == true
  166.     节次 = 10 if 时 == 20 && 分 > 0 && $夏令时 == false
  167.     节次 = 10 if 时 == 20 && 分 <= 50 && $夏令时 == false
  168.   end
  169.   def 还原
  170.     change_color(Color.new(255,255,255,255))
  171.   end
  172.   def 变色
  173.     change_color(Color.new(0,255,0,255))
  174.   end
  175. end
复制代码

求大神看看到底是怎么回事
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部