查看: 2568|回复: 1

[已经解决] 自编脚本出错

[复制链接]
梦石
0
星屑
50
在线时间
255 小时
注册时间
2010-11-13
回帖
134
发表于 2012-2-4 16:37:03 | 显示全部楼层 |阅读模式

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

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

×
我刚刚写了一个勋章的脚本,插在菜单中用.
结果我发现无论当变量49等于多少时
勋章显示的都是变量49等于1时的图标
请问有人能教一下吗?谢谢了
一下是脚本
def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(10, 75, 120, 32, "勋章")
  if $game_variables[49] =1
    bitmap=Bitmap.new("Graphics/XZ/1")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =2
    bitmap=Bitmap.new("Graphics/XZ/2")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =3
    bitmap=Bitmap.new("Graphics/XZ/3")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =4
    bitmap=Bitmap.new("Graphics/XZ/4")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =5
    bitmap=Bitmap.new("Graphics/XZ/5")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =6
    bitmap=Bitmap.new("Graphics/XZ/6")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =7
    bitmap=Bitmap.new("Graphics/XZ/7")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =8
    bitmap=Bitmap.new("Graphics/XZ/8")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =9
    bitmap=Bitmap.new("Graphics/XZ/9")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =10
    bitmap=Bitmap.new("Graphics/XZ/10")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =11
    bitmap=Bitmap.new("Graphics/XZ/11")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =12
    bitmap=Bitmap.new("Graphics/XZ/12")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =13
    bitmap=Bitmap.new("Graphics/XZ/13")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =14
    bitmap=Bitmap.new("Graphics/XZ/14")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =15
    bitmap=Bitmap.new("Graphics/XZ/15")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =16
    bitmap=Bitmap.new("Graphics/XZ/16")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =17
    bitmap=Bitmap.new("Graphics/XZ/17")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =18
    bitmap=Bitmap.new("Graphics/XZ/18")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =19
    bitmap=Bitmap.new("Graphics/XZ/19")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =20
    bitmap=Bitmap.new("Graphics/XZ/20")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    elsif $game_variables[49] =21
    bitmap=Bitmap.new("Graphics/XZ/21")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    else
    bitmap=Bitmap.new("Graphics/XZ/21")
    src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
    self.contents.blt(50, 75, bitmap, src_rect)
    end

点评

搞什么飞机  发表于 2012-2-4 16:47

评分

参与人数 2星屑 -122 收起 理由
jiuji250 -100 下次看清楚门牌
死伤殆尽 -22 错区

查看全部评分

梦石
0
星屑
7095
在线时间
1666 小时
注册时间
2008-10-29
回帖
6612

贵宾

发表于 2012-2-4 21:21:57 | 显示全部楼层
一个 = 号是赋值.
两个 = 号是判断.

点评

谢谢  发表于 2012-2-4 21:25











你知道得太多了

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

在本版发帖返回顶部