查看: 1944|回复: 5

[已经过期] 求大大帮忙,脚本 在登陆成功后 场景移动到指定的地图,...

[复制链接]
梦石
0
星屑
137
在线时间
185 小时
注册时间
2008-2-10
回帖
197
发表于 2013-7-3 05:59:24 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 632808263 于 2013-7-4 22:15 编辑

请问怎么把下面的脚本 在登陆成功后 场景移动到指定的地图,而且不是默认进入第一个设定的地图?(就是我设定了个开头动画,动画结束 开启这个脚本,  登陆成功 又回到开头动画,然后就是一直重复。。。。。。哎,!!!在第一次登陆成功后转移地图。。。求助!!!!!)(我在下面加入了场所移动的脚本,可是没反映?)谢谢!




  1. #==============================================================================
  2. # ■ Scene_Login
  3. #------------------------------------------------------------------------------
  4. #  处理用户登录的类。
  5. #==============================================================================

  6. class Scene_Login
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     @mouse_press_register = false # 注册按钮
  12.     @mouse_press_login = false # 登录按钮
  13.     @focus_index = 1 #焦点
  14.     @get_focus = false #获得焦点
  15.     @textcursor_count = 0 # 用来控制光标闪烁
  16.     @textcursor_index = 0 # 用来控制光标位置
  17.     @text_index = 0 # 字符计数
  18.     # 在文件不存在的情况下创建默认的测试帐号
  19.     filename = "Data/Message.log"
  20.     unless FileTest.exist?(filename)
  21.       newuser = {"test"=>["gm","gm","gm"]}
  22.       file = File.open(filename, "wb")
  23.       Marshal.dump(newuser, file)
  24.       file.close
  25.     end
  26.   end
  27.   #--------------------------------------------------------------------------
  28.   # ● 主处理
  29.   #--------------------------------------------------------------------------
  30.   def main
  31.     # 载入数据库
  32.     $data_actors        = load_data("Data/Actors.rxdata")
  33.     $data_classes       = load_data("Data/Classes.rxdata")
  34.     $data_skills        = load_data("Data/Skills.rxdata")
  35.     $data_items         = load_data("Data/Items.rxdata")
  36.     $data_weapons       = load_data("Data/Weapons.rxdata")
  37.     $data_armors        = load_data("Data/Armors.rxdata")
  38.     $data_enemies       = load_data("Data/Enemies.rxdata")
  39.     $data_troops        = load_data("Data/Troops.rxdata")
  40.     $data_states        = load_data("Data/States.rxdata")
  41.     $data_animations    = load_data("Data/Animations.rxdata")
  42.     $data_tilesets      = load_data("Data/Tilesets.rxdata")
  43.     $data_common_events = load_data("Data/CommonEvents.rxdata")
  44.     $data_system        = load_data("Data/System.rxdata")
  45.     # 生成系统对像
  46.     $game_system = Game_System.new
  47.     # 生成背景图形
  48.     @sprite_back = Sprite.new
  49.     @sprite_back.bitmap = RPG::Cache.picture("用户登录.png")
  50.     # 生成登录按钮
  51.     @sprite_login = Sprite.new
  52.     @sprite_login.bitmap = RPG::Cache.picture("登录1.png")
  53.     @sprite_login.x = 320
  54.     @sprite_login.y = 300
  55.     # 生成注册按钮
  56.     @sprite_register = Sprite.new
  57.     @sprite_register.bitmap = RPG::Cache.picture("注册1.png")
  58.     @sprite_register.x = 400
  59.     @sprite_register.y = 300
  60.     # 生成文本光标
  61.     @sprite_textcursor = Sprite.new
  62.     @sprite_textcursor.bitmap = RPG::Cache.picture("文本光标.png")
  63.     @sprite_textcursor.x = 247
  64.     @sprite_textcursor.y = 200
  65.     @sprite_textcursor.opacity = 0
  66.     @login_window = Window_Login.new
  67.     # 执行过渡
  68.     Graphics.transition
  69.     # 主循环
  70.     loop do
  71.       # 刷新游戏画面
  72.       Graphics.update
  73.       # 刷新输入情报
  74.       Mouse.update
  75.       # 刷新画面
  76.       update
  77.       # 如果画面切换的话就中断循环
  78.       if $scene != self
  79.         break
  80.       end
  81.     end
  82.     # 准备过渡
  83.     Graphics.freeze
  84.     # 释放窗口
  85.     @sprite_back.dispose
  86.     @sprite_back.bitmap.dispose
  87.     @sprite_login.dispose
  88.     @sprite_login.bitmap.dispose
  89.     @sprite_register.dispose
  90.     @sprite_register.bitmap.dispose
  91.     @sprite_textcursor.dispose
  92.     @sprite_textcursor.bitmap.dispose
  93.     @login_window.dispose
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   # ● 刷新画面
  97.   #--------------------------------------------------------------------------
  98.   def update
  99.     # 在获得焦点的情况下监听键盘输入
  100.     if @get_focus == true
  101.       listen_keyboard_input
  102.       # 按TAB键切换光标位置
  103.       if Kboard.keyboard($R_Key_TAB)
  104.         case @focus_index
  105.         when 1
  106.           @focus_index = 2
  107.           @textcursor_index = $password.length
  108.           @text_index = $password.length
  109.         when 2
  110.           @focus_index = 1
  111.           @textcursor_index = $username.length
  112.           @text_index = $username.length
  113.         end
  114.       end
  115.     end
  116.     if @get_focus == true # 在获得焦点的情况下刷新文本光标
  117.       if @textcursor_count%40 < 20 # 每秒钟刷新一次
  118.         @sprite_textcursor.opacity = 0
  119.       else
  120.         @sprite_textcursor.opacity = 255
  121.       end
  122.       # 刷新光标位置,因为背景图片的文本框没有对齐,所以设置比较麻烦
  123.       @sprite_textcursor.x = 247 + @textcursor_index * 10 # 8为每个字符的间距
  124.       case @focus_index
  125.       when 1
  126.         @sprite_textcursor.y = 200
  127.       when 2
  128.         @sprite_textcursor.y = 200 + 53
  129.       end
  130.       @textcursor_count += 1
  131.     else
  132.       @sprite_textcursor.opacity = 0
  133.     end
  134.     mouse_x,mouse_y = Mouse.get_mouse_pos
  135.     Mouse.click_lock
  136.     # 用户登录
  137.     if (mouse_x > @sprite_login.x) and (mouse_y > @sprite_login.y) and
  138.         (mouse_x < @sprite_login.x + @sprite_login.bitmap.width) and
  139.         (mouse_y < @sprite_login.y + @sprite_login.bitmap.height)
  140.       Mouse.click_unlock
  141.       @sprite_login.bitmap = RPG::Cache.picture("登录2.png")
  142.       if Mouse.press?(Mouse::LEFT)
  143.         @sprite_login.bitmap = RPG::Cache.picture("登录3.png")
  144.         @mouse_press_login = true
  145.         return
  146.       end
  147.       if Input.trigger?(Input::C)
  148.         @sprite_login.bitmap = RPG::Cache.picture("登录3.png")
  149.         @mouse_press_login = true
  150.         return
  151.         end
  152.       if @mouse_press_login
  153.         # 演奏确定 SE
  154.         $game_system.se_play($data_system.decision_se)
  155.         # 读取数据库
  156.         filename = "Data/Message.log"
  157.         file = File.open(filename, "r")
  158.         user_info = Marshal.load(file)
  159.         file.close
  160.         if $username.length <= 0 #如果用户名为空
  161.           p "请输入用户名"
  162.           @mouse_press_login = false
  163.           return
  164.         end
  165.         if $password.length <= 0 #如果密码为空
  166.           p "请输入密码"
  167.           @mouse_press_login = false
  168.           return
  169.         end
  170.         if user_info.include?($username.to_s)
  171.           if $password.to_s == user_info[$username.to_s][0]
  172.             $scene = Scene_Title.new
  173.           else
  174.             p "密码错误"
  175.           end
  176.         else
  177.           p "用户名不存在"
  178.         end
  179.         # 移动场景
  180.         
  181. $game_temp.player_transferring = true
  182. $game_temp.player_new_map_id = (23)
  183. $game_temp.player_new_x = (10)
  184. $game_temp.player_new_y = (7)
  185. $game_temp.player_new_direction = 0

  186.         @mouse_press_login = false
  187.       end
  188.          
  189.     else
  190.       Mouse.click_lock
  191.       @sprite_login.bitmap = RPG::Cache.picture("登录1.png")
  192.       @mouse_press_login = false
  193.     end
  194.        # 用户名注册
  195.     if (mouse_x > @sprite_register.x) and (mouse_y > @sprite_register.y) and
  196.         (mouse_x < @sprite_register.x + @sprite_register.bitmap.width) and
  197.         (mouse_y < @sprite_register.y + @sprite_register.bitmap.height)
  198.       Mouse.click_unlock
  199.       @sprite_register.bitmap = RPG::Cache.picture("注册2.png")
  200.       if Mouse.press?(Mouse::LEFT)
  201.         @sprite_register.bitmap = RPG::Cache.picture("注册3.png")
  202.         @mouse_press_register = true
  203.         return
  204.       end
  205.       if @mouse_press_register
  206.         # 演奏确定 SE
  207.         $game_system.se_play($data_system.decision_se)
  208.         $scene = Scene_Register.new
  209.         @mouse_press_register = false
  210.       end
  211.     else
  212.       Mouse.click_lock
  213.       @sprite_register.bitmap = RPG::Cache.picture("注册1.png")
  214.       @mouse_press_register = false
  215.     end
  216.     # 用户名文本框区域
  217.     if (mouse_x > 248 - 5) and (mouse_y > 202 - 10) and
  218.        (mouse_x < 475 + 5) and (mouse_y < 220)
  219.       Mouse.click_unlock
  220.       $mouse_tag = "text"
  221.       if Mouse.trigger?(Mouse::LEFT)
  222.         @get_focus = true
  223.         @focus_index = 1
  224.         @textcursor_index = $username.length
  225.         @text_index = $username.length
  226.       end
  227.       return
  228.     else
  229.       Mouse.click_lock
  230.       $mouse_tag = nil
  231.     end
  232.     # 密码文本框区域
  233.     if (mouse_x > 248 - 5) and (mouse_y > 255 - 10) and
  234.        (mouse_x < 475 + 5) and (mouse_y < 272)
  235.       Mouse.click_unlock
  236.       $mouse_tag = "text"
  237.       if Mouse.trigger?(Mouse::LEFT)
  238.         @get_focus = true
  239.         @focus_index = 2
  240.         @textcursor_index = $password.length
  241.         @text_index = $password.length
  242.       end
  243.       return
  244.     else
  245.       Mouse.click_lock
  246.       $mouse_tag = nil
  247.     end
  248.   end
  249.   ############################################################################
  250.   # 监听键盘输入
  251.   def listen_keyboard_input
  252.     case @focus_index
  253.     when 1
  254.       # 字母A
  255.       if Kboard.keyboard($R_Key_A)
  256.         if $username.length >= 15
  257.           return
  258.         end
  259.         $username[@text_index] = "a"
  260.         @textcursor_index += 1
  261.         @text_index += 1
  262.         @login_window.refresh
  263.       end
  264.       # 字母B
  265.       if Kboard.keyboard($R_Key_B)
  266.         if $username.length >= 15
  267.           return
  268.         end
  269.         $username[@text_index] = "b"
  270.         @textcursor_index += 1
  271.         @text_index += 1
  272.         @login_window.refresh
  273.       end
  274.       # 字母C
  275.       if Kboard.keyboard($R_Key_C)
  276.         if $username.length >= 15
  277.           return
  278.         end
  279.         $username[@text_index] = "c"
  280.         @textcursor_index += 1
  281.         @text_index += 1
  282.         @login_window.refresh
  283.       end
  284.       # 字母D
  285.       if Kboard.keyboard($R_Key_D)
  286.         if $username.length >= 15
  287.           return
  288.         end
  289.         $username[@text_index] = "d"
  290.         @textcursor_index += 1
  291.         @text_index += 1
  292.         @login_window.refresh
  293.       end
  294.       # 字母E
  295.       if Kboard.keyboard($R_Key_E)
  296.         if $username.length >= 15
  297.           return
  298.         end
  299.         $username[@text_index] = "e"
  300.         @textcursor_index += 1
  301.         @text_index += 1
  302.         @login_window.refresh
  303.       end
  304.       # 字母F
  305.       if Kboard.keyboard($R_Key_F)
  306.         if $username.length >= 15
  307.           return
  308.         end
  309.         $username[@text_index] = "f"
  310.         @textcursor_index += 1
  311.         @text_index += 1
  312.         @login_window.refresh
  313.       end
  314.       # 字母G
  315.       if Kboard.keyboard($R_Key_G)
  316.         if $username.length >= 15
  317.           return
  318.         end
  319.         $username[@text_index] = "g"
  320.         @textcursor_index += 1
  321.         @text_index += 1
  322.         @login_window.refresh
  323.       end
  324.       # 字母H
  325.       if Kboard.keyboard($R_Key_H)
  326.         if $username.length >= 15
  327.           return
  328.         end
  329.         $username[@text_index] = "h"
  330.         @textcursor_index += 1
  331.         @text_index += 1
  332.         @login_window.refresh
  333.       end
  334.       # 字母I
  335.       if Kboard.keyboard($R_Key_I)
  336.         if $username.length >= 15
  337.           return
  338.         end
  339.         $username[@text_index] = "i"
  340.         @textcursor_index += 1
  341.         @text_index += 1
  342.         @login_window.refresh
  343.       end
  344.       # 字母J
  345.       if Kboard.keyboard($R_Key_J)
  346.         if $username.length >= 15
  347.           return
  348.         end
  349.         $username[@text_index] = "j"
  350.         @textcursor_index += 1
  351.         @text_index += 1
  352.         @login_window.refresh
  353.       end
  354.       # 字母K
  355.       if Kboard.keyboard($R_Key_K)
  356.         if $username.length >= 15
  357.           return
  358.         end
  359.         $username[@text_index] = "k"
  360.         @textcursor_index += 1
  361.         @text_index += 1
  362.         @login_window.refresh
  363.       end
  364.       # 字母L
  365.       if Kboard.keyboard($R_Key_L)
  366.         if $username.length >= 15
  367.           return
  368.         end
  369.         $username[@text_index] = "l"
  370.         @textcursor_index += 1
  371.         @text_index += 1
  372.         @login_window.refresh
  373.       end
  374.       # 字母M
  375.       if Kboard.keyboard($R_Key_M)
  376.         if $username.length >= 15
  377.           return
  378.         end
  379.         $username[@text_index] = "m"
  380.         @textcursor_index += 1
  381.         @text_index += 1
  382.         @login_window.refresh
  383.       end
  384.       # 字母N
  385.       if Kboard.keyboard($R_Key_N)
  386.         if $username.length >= 15
  387.           return
  388.         end
  389.         $username[@text_index] = "n"
  390.         @textcursor_index += 1
  391.         @text_index += 1
  392.         @login_window.refresh
  393.       end
  394.       # 字母O
  395.       if Kboard.keyboard($R_Key_O)
  396.         if $username.length >= 15
  397.           return
  398.         end
  399.         $username[@text_index] = "o"
  400.         @textcursor_index += 1
  401.         @text_index += 1
  402.         @login_window.refresh
  403.       end
  404.       # 字母P
  405.       if Kboard.keyboard($R_Key_P)
  406.         if $username.length >= 15
  407.           return
  408.         end
  409.         $username[@text_index] = "p"
  410.         @textcursor_index += 1
  411.         @text_index += 1
  412.         @login_window.refresh
  413.       end
  414.       # 字母Q
  415.       if Kboard.keyboard($R_Key_Q)
  416.         if $username.length >= 15
  417.           return
  418.         end
  419.         $username[@text_index] = "q"
  420.         @textcursor_index += 1
  421.         @text_index += 1
  422.         @login_window.refresh
  423.       end
  424.       # 字母R
  425.       if Kboard.keyboard($R_Key_R)
  426.         if $username.length >= 15
  427.           return
  428.         end
  429.         $username[@text_index] = "r"
  430.         @textcursor_index += 1
  431.         @text_index += 1
  432.         @login_window.refresh
  433.       end
  434.       # 字母S
  435.       if Kboard.keyboard($R_Key_S)
  436.         if $username.length >= 15
  437.           return
  438.         end
  439.         $username[@text_index] = "s"
  440.         @textcursor_index += 1
  441.         @text_index += 1
  442.         @login_window.refresh
  443.       end
  444.       # 字母T
  445.       if Kboard.keyboard($R_Key_T)
  446.         if $username.length >= 15
  447.           return
  448.         end
  449.         $username[@text_index] = "t"
  450.         @textcursor_index += 1
  451.         @text_index += 1
  452.         @login_window.refresh
  453.       end
  454.       # 字母U
  455.       if Kboard.keyboard($R_Key_U)
  456.         if $username.length >= 15
  457.           return
  458.         end
  459.         $username[@text_index] = "u"
  460.         @textcursor_index += 1
  461.         @text_index += 1
  462.         @login_window.refresh
  463.       end
  464.       # 字母V
  465.       if Kboard.keyboard($R_Key_V)
  466.         if $username.length >= 15
  467.           return
  468.         end
  469.         $username[@text_index] = "v"
  470.         @textcursor_index += 1
  471.         @text_index += 1
  472.         @login_window.refresh
  473.       end
  474.       # 字母W
  475.       if Kboard.keyboard($R_Key_W)
  476.         if $username.length >= 15
  477.           return
  478.         end
  479.         $username[@text_index] = "w"
  480.         @textcursor_index += 1
  481.         @text_index += 1
  482.         @login_window.refresh
  483.       end
  484.       # 字母X
  485.       if Kboard.keyboard($R_Key_X)
  486.         if $username.length >= 15
  487.           return
  488.         end
  489.         $username[@text_index] = "x"
  490.         @textcursor_index += 1
  491.         @text_index += 1
  492.         @login_window.refresh
  493.       end
  494.       # 字母Y
  495.       if Kboard.keyboard($R_Key_Y)
  496.         if $username.length >= 15
  497.           return
  498.         end
  499.         $username[@text_index] = "y"
  500.         @textcursor_index += 1
  501.         @text_index += 1
  502.         @login_window.refresh
  503.       end
  504.       # 字母Z
  505.       if Kboard.keyboard($R_Key_Z)
  506.         if $username.length >= 15
  507.           return
  508.         end
  509.         $username[@text_index] = "z"
  510.         @textcursor_index += 1
  511.         @text_index += 1
  512.         @login_window.refresh
  513.       end
  514.       # 数字0
  515.       if Kboard.keyboard($R_Key_0) or Kboard.keyboard($R_Key_NUMPAD0)
  516.         if $username.length >= 15
  517.           return
  518.         end
  519.         $username[@text_index] = "0"
  520.         @textcursor_index += 1
  521.         @text_index += 1
  522.         @login_window.refresh
  523.       end
  524.       # 数字1
  525.       if Kboard.keyboard($R_Key_1) or Kboard.keyboard($R_Key_NUMPAD1)
  526.         if $username.length >= 15
  527.           return
  528.         end
  529.         $username[@text_index] = "1"
  530.         @textcursor_index += 1
  531.         @text_index += 1
  532.         @login_window.refresh
  533.       end
  534.       # 数字2
  535.       if Kboard.keyboard($R_Key_2) or Kboard.keyboard($R_Key_NUMPAD2)
  536.         if $username.length >= 15
  537.           return
  538.         end
  539.         $username[@text_index] = "2"
  540.         @textcursor_index += 1
  541.         @text_index += 1
  542.         @login_window.refresh
  543.       end
  544.       # 数字3
  545.       if Kboard.keyboard($R_Key_3) or Kboard.keyboard($R_Key_NUMPAD3)
  546.         if $username.length >= 15
  547.           return
  548.         end
  549.         $username[@text_index] = "3"
  550.         @textcursor_index += 1
  551.         @text_index += 1
  552.         @login_window.refresh
  553.       end
  554.       # 数字4
  555.       if Kboard.keyboard($R_Key_4) or Kboard.keyboard($R_Key_NUMPAD4)
  556.         if $username.length >= 15
  557.           return
  558.         end
  559.         $username[@text_index] = "4"
  560.         @textcursor_index += 1
  561.         @text_index += 1
  562.         @login_window.refresh
  563.       end
  564.       # 数字5
  565.       if Kboard.keyboard($R_Key_5) or Kboard.keyboard($R_Key_NUMPAD5)
  566.         if $username.length >= 15
  567.           return
  568.         end
  569.         $username[@text_index] = "5"
  570.         @textcursor_index += 1
  571.         @text_index += 1
  572.         @login_window.refresh
  573.       end
  574.       # 数字6
  575.       if Kboard.keyboard($R_Key_6) or Kboard.keyboard($R_Key_NUMPAD6)
  576.         if $username.length >= 15
  577.           return
  578.         end
  579.         $username[@text_index] = "6"
  580.         @textcursor_index += 1
  581.         @text_index += 1
  582.         @login_window.refresh
  583.       end
  584.       # 数字7
  585.       if Kboard.keyboard($R_Key_7) or Kboard.keyboard($R_Key_NUMPAD7)
  586.         if $username.length >= 15
  587.           return
  588.         end
  589.         $username[@text_index] = "7"
  590.         @textcursor_index += 1
  591.         @text_index += 1
  592.         @login_window.refresh
  593.       end
  594.       # 数字8
  595.       if Kboard.keyboard($R_Key_8) or Kboard.keyboard($R_Key_NUMPAD8)
  596.         if $username.length >= 15
  597.           return
  598.         end
  599.         $username[@text_index] = "8"
  600.         @textcursor_index += 1
  601.         @text_index += 1
  602.         @login_window.refresh
  603.       end
  604.       # 数字9
  605.       if Kboard.keyboard($R_Key_9) or Kboard.keyboard($R_Key_NUMPAD9)
  606.         if $username.length >= 15
  607.           return
  608.         end
  609.         $username[@text_index] = "9"
  610.         @textcursor_index += 1
  611.         @text_index += 1
  612.         @login_window.refresh
  613.       end
  614.       # 删除键
  615.       if Kboard.keyboard($R_Key_BACK)
  616.         if $username.length > 0
  617.           $username.pop
  618.           @textcursor_index -= 1
  619.           @text_index -= 1
  620.           @login_window.refresh
  621.         end
  622.       end
  623.     when 2
  624.       # 字母A
  625.       if Kboard.keyboard($R_Key_A)
  626.         if $password.length >= 15
  627.           return
  628.         end
  629.         $password[@text_index] = "a"
  630.         @textcursor_index += 1
  631.         @text_index += 1
  632.         @login_window.refresh
  633.       end
  634.       # 字母B
  635.       if Kboard.keyboard($R_Key_B)
  636.         if $password.length >= 15
  637.           return
  638.         end
  639.         $password[@text_index] = "b"
  640.         @textcursor_index += 1
  641.         @text_index += 1
  642.         @login_window.refresh
  643.       end
  644.       # 字母C
  645.       if Kboard.keyboard($R_Key_C)
  646.         if $password.length >= 15
  647.           return
  648.         end
  649.         $password[@text_index] = "c"
  650.         @textcursor_index += 1
  651.         @text_index += 1
  652.         @login_window.refresh
  653.       end
  654.       # 字母D
  655.       if Kboard.keyboard($R_Key_D)
  656.         if $password.length >= 15
  657.           return
  658.         end
  659.         $password[@text_index] = "d"
  660.         @textcursor_index += 1
  661.         @text_index += 1
  662.         @login_window.refresh
  663.       end
  664.       # 字母E
  665.       if Kboard.keyboard($R_Key_E)
  666.         if $password.length >= 15
  667.           return
  668.         end
  669.         $password[@text_index] = "e"
  670.         @textcursor_index += 1
  671.         @text_index += 1
  672.         @login_window.refresh
  673.       end
  674.       # 字母F
  675.       if Kboard.keyboard($R_Key_F)
  676.         if $password.length >= 15
  677.           return
  678.         end
  679.         $password[@text_index] = "f"
  680.         @textcursor_index += 1
  681.         @text_index += 1
  682.         @login_window.refresh
  683.       end
  684.       # 字母G
  685.       if Kboard.keyboard($R_Key_G)
  686.         if $password.length >= 15
  687.           return
  688.         end
  689.         $password[@text_index] = "g"
  690.         @textcursor_index += 1
  691.         @text_index += 1
  692.         @login_window.refresh
  693.       end
  694.       # 字母H
  695.       if Kboard.keyboard($R_Key_H)
  696.         if $password.length >= 15
  697.           return
  698.         end
  699.         $password[@text_index] = "h"
  700.         @textcursor_index += 1
  701.         @text_index += 1
  702.         @login_window.refresh
  703.       end
  704.       # 字母I
  705.       if Kboard.keyboard($R_Key_I)
  706.         if $password.length >= 15
  707.           return
  708.         end
  709.         $password[@text_index] = "i"
  710.         @textcursor_index += 1
  711.         @text_index += 1
  712.         @login_window.refresh
  713.       end
  714.       # 字母J
  715.       if Kboard.keyboard($R_Key_J)
  716.         if $password.length >= 15
  717.           return
  718.         end
  719.         $password[@text_index] = "j"
  720.         @textcursor_index += 1
  721.         @text_index += 1
  722.         @login_window.refresh
  723.       end
  724.       # 字母K
  725.       if Kboard.keyboard($R_Key_K)
  726.         if $password.length >= 15
  727.           return
  728.         end
  729.         $password[@text_index] = "k"
  730.         @textcursor_index += 1
  731.         @text_index += 1
  732.         @login_window.refresh
  733.       end
  734.       # 字母L
  735.       if Kboard.keyboard($R_Key_L)
  736.         if $password.length >= 15
  737.           return
  738.         end
  739.         $password[@text_index] = "l"
  740.         @textcursor_index += 1
  741.         @text_index += 1
  742.         @login_window.refresh
  743.       end
  744.       # 字母M
  745.       if Kboard.keyboard($R_Key_M)
  746.         if $password.length >= 15
  747.           return
  748.         end
  749.         $password[@text_index] = "m"
  750.         @textcursor_index += 1
  751.         @text_index += 1
  752.         @login_window.refresh
  753.       end
  754.       # 字母N
  755.       if Kboard.keyboard($R_Key_N)
  756.         if $password.length >= 15
  757.           return
  758.         end
  759.         $password[@text_index] = "n"
  760.         @textcursor_index += 1
  761.         @text_index += 1
  762.         @login_window.refresh
  763.       end
  764.       # 字母O
  765.       if Kboard.keyboard($R_Key_O)
  766.         if $password.length >= 15
  767.           return
  768.         end
  769.         $password[@text_index] = "o"
  770.         @textcursor_index += 1
  771.         @text_index += 1
  772.         @login_window.refresh
  773.       end
  774.       # 字母P
  775.       if Kboard.keyboard($R_Key_P)
  776.         if $password.length >= 15
  777.           return
  778.         end
  779.         $password[@text_index] = "p"
  780.         @textcursor_index += 1
  781.         @text_index += 1
  782.         @login_window.refresh
  783.       end
  784.       # 字母Q
  785.       if Kboard.keyboard($R_Key_Q)
  786.         if $password.length >= 15
  787.           return
  788.         end
  789.         $password[@text_index] = "q"
  790.         @textcursor_index += 1
  791.         @text_index += 1
  792.         @login_window.refresh
  793.       end
  794.       # 字母R
  795.       if Kboard.keyboard($R_Key_R)
  796.         if $password.length >= 15
  797.           return
  798.         end
  799.         $password[@text_index] = "r"
  800.         @textcursor_index += 1
  801.         @text_index += 1
  802.         @login_window.refresh
  803.       end
  804.       # 字母S
  805.       if Kboard.keyboard($R_Key_S)
  806.         if $password.length >= 15
  807.           return
  808.         end
  809.         $password[@text_index] = "s"
  810.         @textcursor_index += 1
  811.         @text_index += 1
  812.         @login_window.refresh
  813.       end
  814.       # 字母T
  815.       if Kboard.keyboard($R_Key_T)
  816.         if $password.length >= 15
  817.           return
  818.         end
  819.         $password[@text_index] = "t"
  820.         @textcursor_index += 1
  821.         @text_index += 1
  822.         @login_window.refresh
  823.       end
  824.       # 字母U
  825.       if Kboard.keyboard($R_Key_U)
  826.         if $password.length >= 15
  827.           return
  828.         end
  829.         $password[@text_index] = "u"
  830.         @textcursor_index += 1
  831.         @text_index += 1
  832.         @login_window.refresh
  833.       end
  834.       # 字母V
  835.       if Kboard.keyboard($R_Key_V)
  836.         if $password.length >= 15
  837.           return
  838.         end
  839.         $password[@text_index] = "v"
  840.         @textcursor_index += 1
  841.         @text_index += 1
  842.         @login_window.refresh
  843.       end
  844.       # 字母W
  845.       if Kboard.keyboard($R_Key_W)
  846.         if $password.length >= 15
  847.           return
  848.         end
  849.         $password[@text_index] = "w"
  850.         @textcursor_index += 1
  851.         @text_index += 1
  852.         @login_window.refresh
  853.       end
  854.       # 字母X
  855.       if Kboard.keyboard($R_Key_X)
  856.         if $password.length >= 15
  857.           return
  858.         end
  859.         $password[@text_index] = "x"
  860.         @textcursor_index += 1
  861.         @text_index += 1
  862.         @login_window.refresh
  863.       end
  864.       # 字母Y
  865.       if Kboard.keyboard($R_Key_Y)
  866.         if $password.length >= 15
  867.           return
  868.         end
  869.         $password[@text_index] = "y"
  870.         @textcursor_index += 1
  871.         @text_index += 1
  872.         @login_window.refresh
  873.       end
  874.       # 字母Z
  875.       if Kboard.keyboard($R_Key_Z)
  876.         if $password.length >= 15
  877.           return
  878.         end
  879.         $password[@text_index] = "z"
  880.         @textcursor_index += 1
  881.         @text_index += 1
  882.         @login_window.refresh
  883.       end
  884.       # 数字0
  885.       if Kboard.keyboard($R_Key_0) or Kboard.keyboard($R_Key_NUMPAD0)
  886.         if $password.length >= 15
  887.           return
  888.         end
  889.         $password[@text_index] = "0"
  890.         @textcursor_index += 1
  891.         @text_index += 1
  892.         @login_window.refresh
  893.       end
  894.       # 数字1
  895.       if Kboard.keyboard($R_Key_1) or Kboard.keyboard($R_Key_NUMPAD1)
  896.         if $password.length >= 15
  897.           return
  898.         end
  899.         $password[@text_index] = "1"
  900.         @textcursor_index += 1
  901.         @text_index += 1
  902.         @login_window.refresh
  903.       end
  904.       # 数字2
  905.       if Kboard.keyboard($R_Key_2) or Kboard.keyboard($R_Key_NUMPAD2)
  906.         if $password.length >= 15
  907.           return
  908.         end
  909.         $password[@text_index] = "2"
  910.         @textcursor_index += 1
  911.         @text_index += 1
  912.         @login_window.refresh
  913.       end
  914.       # 数字3
  915.       if Kboard.keyboard($R_Key_3) or Kboard.keyboard($R_Key_NUMPAD3)
  916.         if $password.length >= 15
  917.           return
  918.         end
  919.         $password[@text_index] = "3"
  920.         @textcursor_index += 1
  921.         @text_index += 1
  922.         @login_window.refresh
  923.       end
  924.       # 数字4
  925.       if Kboard.keyboard($R_Key_4) or Kboard.keyboard($R_Key_NUMPAD4)
  926.         if $password.length >= 15
  927.           return
  928.         end
  929.         $password[@text_index] = "4"
  930.         @textcursor_index += 1
  931.         @text_index += 1
  932.         @login_window.refresh
  933.       end
  934.       # 数字5
  935.       if Kboard.keyboard($R_Key_5) or Kboard.keyboard($R_Key_NUMPAD5)
  936.         if $password.length >= 15
  937.           return
  938.         end
  939.         $password[@text_index] = "5"
  940.         @textcursor_index += 1
  941.         @text_index += 1
  942.         @login_window.refresh
  943.       end
  944.       # 数字6
  945.       if Kboard.keyboard($R_Key_6) or Kboard.keyboard($R_Key_NUMPAD6)
  946.         if $password.length >= 15
  947.           return
  948.         end
  949.         $password[@text_index] = "6"
  950.         @textcursor_index += 1
  951.         @text_index += 1
  952.         @login_window.refresh
  953.       end
  954.       # 数字7
  955.       if Kboard.keyboard($R_Key_7) or Kboard.keyboard($R_Key_NUMPAD7)
  956.         if $password.length >= 15
  957.           return
  958.         end
  959.         $password[@text_index] = "7"
  960.         @textcursor_index += 1
  961.         @text_index += 1
  962.         @login_window.refresh
  963.       end
  964.       # 数字8
  965.       if Kboard.keyboard($R_Key_8) or Kboard.keyboard($R_Key_NUMPAD8)
  966.         if $password.length >= 15
  967.           return
  968.         end
  969.         $password[@text_index] = "8"
  970.         @textcursor_index += 1
  971.         @text_index += 1
  972.         @login_window.refresh
  973.       end
  974.       # 数字9
  975.       if Kboard.keyboard($R_Key_9) or Kboard.keyboard($R_Key_NUMPAD9)
  976.         if $password.length >= 15
  977.           return
  978.         end
  979.         $password[@text_index] = "9"
  980.         @textcursor_index += 1
  981.         @text_index += 1
  982.         @login_window.refresh
  983.       end
  984.       # 删除键
  985.       if Kboard.keyboard($R_Key_BACK)
  986.         if $password.length > 0
  987.           $password.pop
  988.           @textcursor_index -= 1
  989.           @text_index -= 1
  990.           @login_window.refresh
  991.         end
  992.       end
  993.     end
  994.   end
  995. end
复制代码


咩~咩咩~咩咩咩~咩咩咩咩~咩咩咩咩咩!
梦石
3
星屑
73
在线时间
1597 小时
注册时间
2013-2-23
回帖
1595
发表于 2013-7-3 09:39:58 | 显示全部楼层
不需要脚本:设置个事件,事件执行条件改为自动执行,再在事件第2页场所转移,然后再设置暂时消除事件。即可。
(听明白了吗?没明白看截图!↓)
QQ图片20130703093828.jpg

点评

!!这个能解决的话不用发贴求助了!0,0 不过还是谢谢了。  发表于 2013-7-4 04:20

评分

参与人数 1星屑 +5 收起 理由
黄濑凉太 + 5 算是……认可?

查看全部评分

像我这么帅的在自己的游戏里一定是主角!
最近申请了b站直播间:http://live.bilibili.com/31494
鄙人的视频合集:点我
回复

使用道具 举报

梦石
0
星屑
137
在线时间
185 小时
注册时间
2008-2-10
回帖
197
 楼主| 发表于 2013-7-4 04:17:25 | 显示全部楼层
q374435503 发表于 2013-7-3 02:39
不需要脚本:设置个事件,事件执行条件改为自动执行,再在事件第2页场所转移,然后再设置暂时消除事件。即 ...

拜托。。。这个脚本运行结束后自动跳到第一次设定的地图中,(就是我设定了个开头动画,动画结束 开启这个脚本,  登陆成功 又回到开头动画,设置事件移动没用,,)所以说能不能在 这脚本后面加上登陆成功后 场景移动到某张地图中,,,,,
咩~咩咩~咩咩咩~咩咩咩咩~咩咩咩咩咩!
回复

使用道具 举报

梦石
0
星屑
137
在线时间
185 小时
注册时间
2008-2-10
回帖
197
 楼主| 发表于 2013-7-5 04:22:16 | 显示全部楼层
咋就没人回复呢?大大 帮忙下呗
咩~咩咩~咩咩咩~咩咩咩咩~咩咩咩咩咩!
回复

使用道具 举报

梦石
0
星屑
137
在线时间
185 小时
注册时间
2008-2-10
回帖
197
 楼主| 发表于 2013-7-6 05:12:45 | 显示全部楼层
好吧,没人会?{:2_263:}

评分

参与人数 1星屑 -20 收起 理由
怪蜀黍 -20 连帖

查看全部评分

咩~咩咩~咩咩咩~咩咩咩咩~咩咩咩咩咩!
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部