设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
12
返回列表 发新帖
楼主: yangjunyin2002
打印 上一主题 下一主题

[已经解决] 求RMVA的全鼠标操作的脚本

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
191
在线时间
835 小时
注册时间
2012-9-16
帖子
1811
11
 楼主| 发表于 2012-10-18 12:44:54 | 只看该作者
Mic_洛洛 发表于 2012-10-16 21:21
首先,你正确将脚本插入main函数前么?
其次,鼠标的图像文件都复制过去了么?缺少图片可是会报错的!
再 ...

恩,我是用VXace的啊。虽然那个貌似很适合。。。但是%出现下面问题:

——旧坑欢迎戳
回复 支持 反对

使用道具 举报

Lv3.寻梦者

Assassin-K

梦石
0
星屑
3468
在线时间
2281 小时
注册时间
2012-5-23
帖子
4065

贵宾

12
发表于 2012-10-18 13:02:30 | 只看该作者
yangjunyin2002 发表于 2012-10-18 12:44
恩,我是用VXace的啊。虽然那个貌似很适合。。。但是%出现下面问题:

首先,请确认你插入的是完整的脚本。
因为该贴LZ晾晒的是部分的脚本,完整的脚本需要下载工程!
然后打开该工程的脚本编辑器将其复制到你的工程里。

如果确认插件脚本无误。
1.请问你是否有动过编辑器里默认的脚本?(修改了报错肯定是正常的!)
2.请问你是否有从新开始游戏(取用原记录也有报错的可能哦!)
3.请问你是否有外插别的脚本呢?(脚本冲突也是会报错的~)

完毕!

◆ROZONE◆
>洛子又要去流浪地球了……
>如果你看到我在线,又没动静,那只能说明我在挂机……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
56 小时
注册时间
2012-6-23
帖子
156
13
发表于 2012-10-18 17:30:21 | 只看该作者
本帖最后由 约修亚_RK 于 2012-10-18 17:33 编辑

@yangjunyin2002
全鼠标的脚本是有的。
把以下代码Copy到插件栏就可以使用了:
RUBY 代码复制
  1. #==============================================================================
  2. #新鼠标系统 V 1.1  by END66RPG && end55rpg && 灵魂の补给 2012.5
  3. #----------------------------使用必看------------------------------------------
  4. #脚本修改较多,要换素材最好不要改脚本,直接看素材Graphics/Mouse/...文件夹。
  5. #鼠标形状状态的说明:
  6. #1.行走时会变成 wait.png
  7. #2.指向事件会变成 npc.png
  8. #3.指向非事件的character会变成 红色光标
  9. #4.指向名字含有item字样的事件会变成 coach.png、
  10. #5.【注意!】不用鼠标触发の事件请名字带有“no point”
  11. #除上所述,鼠标变成 紫色光标
  12. #备注:要修改鼠标图像,最好别改脚本了,
  13. #      在Graphics\Mouse中:
  14. #      1.png为鼠标图标
  15. #      2.png-4.png是动态普通形状
  16. #      5-10是指向非事件的鼠标图
  17. #      其余自己看着改吧!
  18. #      复制本工程需要3个脚本 /Graphics/(+ Icons + Mouse)图像。
  19. #下面可修改([]中为通常的样子):
  20. 合成方式 = 0  
  21. #@blend_tepe【1  】:0~2
  22. 透明速度 = 10
  23. #@opacity   【10 】:0~255
  24. 下降速度 = 1  
  25. #@jy        【1  】:0~50
  26. X放大率  = 0.1
  27. #@zoom_x    【0.1 or -0.03】:-1~1
  28. Y放大率  = 0.1
  29. #@zoom_y    【0.1 or -0.03】:-1~1
  30. 残影     = true
  31. #shadow 【true / false】
  32. 残光     = false
  33. #show_light 【true / false】
  34. 旋转     = false
  35. #angle   【true、false】
  36. 动态     = true#true
  37. #anima   【true、false】
  38. #由于残光会建立94个图像,内存低就把show_light 给false掉吧~~
  39. #加入鼠标转向专利一个~~我是仿windows显示时间屏保的鼠标制作的~~
  40. #是关于Math的算法,不是只有8方向,而是360个= =!!~
  41. #把【85】行去掉“#”就会掉many FPS 不过很华丽~~(注:先开启旋转,残光功能!)
  42. #-----------------------------------分割线--------------------------------------
  43. #如果需要在游戏中调用修改鼠标各项设置:见204行处的方法调用,不需要改变的量用nil
  44. #表示!
  45. #==============================================================================
  46. module Mouse  
  47.   attr_accessor :count                     #变换动画计数
  48. attr_accessor :npc                       #指向NPC
  49. attr_accessor :wait                      #指针变成角色正在移动
  50. attr_accessor :enemy                     #指针指向敌人
  51. attr_accessor :coach                     #coach icons switch
  52. #======================================================
  53. #change icon!
  54. #======================================================
  55.   def self.npc
  56.     if @npc != true
  57.     @count = 10
  58.     @npc = true
  59.     end
  60.   end
  61.   def self.wait
  62.     if @wait != true
  63.     @count = 10
  64.     @wait = true
  65.     end
  66.   end
  67.   def self.enemy
  68.     if @enemy != true
  69.     @count = 10
  70.     @enemy = true
  71.     end
  72.   end
  73.   def self.coach
  74.     if @coach != true
  75.       @count = 10
  76.       @coach = true
  77.     end
  78.   end
  79. #======================================================
  80. #end
  81. #======================================================
  82.   def self.text
  83.  
  84.   end
  85.   def self.into_menu
  86.     Sound.play_ok
  87.     SceneManager.call(Scene_Menu)
  88.     Window_MenuCommand::init_command_position
  89.   end
  90.   def self.init2
  91.     #Directions
  92.     @dir = 0
  93.     @old_x, @old_y = 0, 0
  94.     #Animations
  95.     @light_id = 1
  96.     @mouse_sprite1 = Sprite.new;
  97.     @mouse_sprite1.z = 9999;
  98.     @mouse_sprite1.bitmap = Bitmap.new("Graphics/Icons/#{@light_id}");
  99.     @light_id = 1
  100.     @canyin = []
  101.     @rmenu = nil#右键菜单
  102.     @rightmenu = false
  103.     @mouse_touch = false
  104.     @count = 0
  105.     @npc,@wait,@coach = false
  106.   end
  107.   def self.setbb(a,b,c,d,e,f,g,h,i)
  108.     @blend_tepe = a if a != nil
  109.     @opacity    = b if b != nil   
  110.     @jy         = c if c != nil        
  111.     @zoom_x     = d if d != nil   
  112.     @zoom_y     = e if e != nil   
  113.     @light      = f if f != nil     
  114.     @shadow     = g if g != nil   
  115.     @angle      = h if h != nil     
  116.     @anima      = i if i != nil     
  117.   end
  118.   def self.show_light(mx, my)
  119.     @canyin.each{|s|s.opacity <= 0 ? (s.visible = false ; @canyin.delete(s)) : s.opacity -= 25}
  120.     if @light
  121.     @light_id < 94 ? @light_id += 1 : @light_id = 1
  122.     i = @light_id
  123.     eval("@mouse_sprite#{i} = Sprite.new")
  124.     eval("@mouse_sprite#{i}.x = #{mx}")
  125.     eval("@mouse_sprite#{i}").y = my
  126.     eval("@mouse_sprite#{i}").blend_type = @blend_tepe
  127.     eval("@mouse_sprite#{i}").z = 9999;
  128.    #eval("@mouse_sprite#{i}").angle = @mouse_sprite.angle
  129.     eval("@mouse_sprite#{i}").bitmap = Bitmap.new("Graphics/Icons/#{@light_id}")
  130.     for i in 1..94
  131.       begin
  132.       eval("@mouse_sprite#{i}").opacity -= @opacity #10
  133.       eval("@mouse_sprite#{i}").y += @jy#1
  134.       eval("@mouse_sprite#{i}").zoom_x += @zoom_x#0.105
  135.       eval("@mouse_sprite#{i}").zoom_y += @zoom_y#0.105
  136.       eval("@mouse_sprite#{i}").dispose if eval("@mouse_sprite#{i}").opacity <= 0
  137.       rescue
  138.       end
  139.     end
  140.     if @plight == true
  141.       self.update_light
  142.     end
  143.     end
  144.     return if !@angle
  145.     a = 0
  146.     #被废掉的朝向
  147.     hu = [(@old_x - mx), (@old_y - my)]
  148.  
  149.     return if hu[0] == 0 or hu[1] == 0
  150.     math = 135 - self.atoa(Math.atan(hu[1]/hu[0]))
  151.     if hu[0] > 0
  152.       @mouse_sprite.angle = math - 90
  153.     else
  154.       @mouse_sprite.angle = math + 90
  155.     end
  156.     #p math
  157.     @old_x, @old_y = mx, my
  158.  
  159.  
  160.   end
  161.   def self.plight
  162.     return unless @light
  163.     @l = Sprite.new
  164.     @l.z = 999999
  165.     @pcount = 30
  166.     @l.blend_type = 1
  167.     @l.bitmap = Bitmap.new("Graphics/Icons/#{@pcount}");
  168.     @l.ox = @l.bitmap.width / 2
  169.     @l.oy = @l.bitmap.height / 2
  170.     @l.x, @l.y = @mouse_sprite.x, @mouse_sprite.y
  171.     @plight = true
  172.  
  173.   end
  174.   def self.update_light
  175.     @pcount += 1
  176.     @l.bitmap = Bitmap.new("Graphics/Icons/#{@pcount}")
  177.     @l.zoom_x += 0.1
  178.     @l.zoom_y += 0.1
  179.     @l.opacity -= 10
  180.     if @pcount >= 70
  181.       @l.dispose
  182.       @pcount = 0
  183.       @plight = false
  184.     end
  185.   end
  186.   def self.atoa(hu)#弧度转角度
  187.     return (hu * 180) / Math::PI
  188.     #
  189.   end
  190. #==============================================================================
  191. #New Part!
  192. #==============================================================================
  193.   def self.moving(x,y)
  194.     return if !@shadow == true
  195.     sprite = Sprite.new
  196.     sprite.z = 999
  197.     sprite.bitmap = @mouse_sprite.bitmap if !@mouse_sprite.disposed?#Bitmap.new("Graphics/Mouse/1.png")
  198.     sprite.x = x
  199.     sprite.y = y
  200.     sprite.opacity = 200
  201.     sprite.angle = @mouse_sprite.angle
  202.     @canyin.push sprite
  203.   end
  204.   def self.canyin
  205.     return @canyin.size
  206.   end
  207.   def self.right_menu(x,y)
  208.  
  209.     @rmenu.dispose if @rmenu != nil
  210.     @rmenu = Sprite.new
  211.     @rmenu.z = 1000
  212.  
  213. #    @rmenu.bitmap.fill_rect(0, 0, 150, 32*n, Color.new(255,255,255))
  214. #    @rmenu.bitmap.font.color = Color.new(68,34,255)
  215. #    n.times{|i|
  216. #    @rmenu.bitmap.fill_rect(0, i*32, 150, 1, Color.new(0,0,0))
  217. #    @rmenu.bitmap.draw_text(0, i*32, 150, 32,text[i][0])
  218.  
  219. #    }
  220.     @rmenu.x,@rmenu.y = x,y
  221.     @rmenu.opacity = 200
  222.     @rightmenu = true
  223.   end
  224.   def self.mouse_touch=(bar)
  225.     @mouse_touch = bar
  226.   end
  227.   def self.mouse_touch
  228.     return @mouse_touch
  229.   end
  230.   def self.check
  231.     if Mouse.trigger?(Mouse::LEFT)
  232.     if @rightmenu
  233.       mx,my = Mouse.get_mouse_pos
  234.       lx = @rmenu.x - @rmenu.ox
  235.       rx = lx + @rmenu.bitmap.width
  236.       ty = @rmenu.y - @rmenu.oy
  237.       by = ty + @rmenu.bitmap.height
  238.       if mx < lx or mx > rx or my < ty or my > by or
  239.         @rmenu.bitmap.get_pixel(mx-lx,my-ty).alpha == 0
  240.  
  241.       else
  242.         a = []
  243.         text.size.times{|t|a << [t*32 , ([email]my-@rmenu.y[/email]).abs].min}
  244.         eval(text[(a.max/32).to_i][1])
  245.       end
  246.       @rightmenu = false
  247.       @rmenu.dispose
  248.         @rmenu = nil
  249.         return
  250.     end
  251.     end
  252.   end      
  253. end
  254. Mouse.init2
  255. Mouse.setbb(合成方式,
  256. 透明速度,
  257. 下降速度,
  258. X放大率,
  259. Y放大率,残光,残影,旋转,动态)


接下来是第二个脚本:
RUBY 代码复制
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================
  4.  
  5. #=================以下两个用来调整战斗时的手感问题,可以自己试试。
  6. $敌人选框扩大 = 30
  7. $角色选框扩大 = 20
  8.  
  9.  
  10. #==============================================================================
  11. # API调用
  12. #==============================================================================
  13. $ShowCursor = Win32API.new("user32", "ShowCursor", 'i', 'l')
  14. $GetCursorPos = Win32API.new("user32", "GetCursorPos", 'p', 'i')
  15. $ScreenToClient = Win32API.new("user32", "ScreenToClient", 'ip', 'i')
  16. $GetActiveWindow = Win32API.new("user32", "GetActiveWindow", nil, 'l')
  17. $Window_HWND = $GetActiveWindow.call
  18. $GetKeyState = Win32API.new("user32", "GetKeyState", 'i', 'i')
  19. #$FindWindow = Win32API.new("user32", "FindWindow", 'pp', 'i')
  20. #$HookStart  = Win32API.new("mouse_hook.dll", "HookStart", 'i', nil)
  21. #$HookEnd  = Win32API.new("mouse_hook.dll", "HookEnd", nil, nil)
  22. #$GetMouseStatus  = Win32API.new("mouse_hook.dll", "GetMouseStatus", 'i', 'i')
  23. #$Window_HWND = $FindWindow.call(nil, 'mousetry')
  24.  
  25. module Mouse  
  26.   LEFT = 0x01
  27.   RIGHT = 0x02
  28.  
  29.   def self.init(sprite = nil)
  30. #   $HookStart.call($Window_HWND)
  31.     $ShowCursor.call(0)
  32.  
  33.     @show_cursor = false
  34.  
  35.     @mouse_sprite = Sprite.new
  36.     @mouse_sprite.z = 99999
  37.     @mouse_sprite.bitmap = Bitmap.new('Graphics/Mouse/1')
  38.     #@mouse_sprite.bitmap.fill_rect(Rect.new(0, 0, 32, 32), Color.new(0, 0, 0))
  39.  
  40.     @left_press = false
  41.     @right_press = false
  42.     @left_trigger = false
  43.     @right_trigger = false
  44.     @left_repeat = false
  45.     @right_repeat = false
  46.     @click_lock = false
  47.     @mouse_x, @mouse_y = self.get_mouse_pos
  48.     update
  49.   end
  50.   def self.exit
  51.     @mouse_sprite.bitmap.dispose
  52.     @mouse_sprite.dispose
  53.     @show_cursor = true
  54. #    $HookEnd.call
  55.     $ShowCursor.call(1)
  56.   end
  57.   def self.mouse_debug
  58.     return @mouse_debug.bitmap
  59.   end
  60.   def self.update
  61.     left_down = $GetKeyState.call(0x01)
  62.     right_down = $GetKeyState.call(0x02)
  63.  
  64.     @click_lock = false
  65.     mouse_x, mouse_y = self.get_mouse_pos
  66.     if @mouse_x != mouse_x or @mouse_y != mouse_y
  67.       moving(@mouse_x, @mouse_y)
  68.       @mouse_x, @mouse_y = mouse_x,mouse_y
  69.     end
  70.     if @mouse_sprite != nil
  71.       @mouse_sprite.x = mouse_x
  72.       @mouse_sprite.y = mouse_y
  73.     end
  74.     if @anima == true
  75.     if @npc == true
  76.       if @count == 80
  77.         @count = 0
  78.         @npc = false
  79.       else
  80.         @count += 1
  81.         end
  82.       if FileTest.exist?("Graphics/Mouse/npc_#{@count/10}.png")
  83.         @mouse_sprite.bitmap = Bitmap.new("Graphics/Mouse/npc_#{@count/10}.png")
  84.       end
  85.     elsif @coach == true
  86.       if @count == 60
  87.         @count = 0
  88.         @coach = false
  89.       else
  90.         @count += 1
  91.         end
  92.       if FileTest.exist?("Graphics/Mouse/coach_#{@count/10}.png")
  93.         @mouse_sprite.bitmap = Bitmap.new("Graphics/Mouse/coach_#{@count/10}.png")
  94.       end
  95.     elsif @enemy == true
  96.       if @count == 60
  97.         @count = 0
  98.         @enemy= false
  99.       else
  100.         @count += 1
  101.         end
  102.         if FileTest.exist?("Graphics/Mouse/#{@count/10 + 4}.png")
  103.         @mouse_sprite.bitmap = Bitmap.new("Graphics/Mouse/#{@count/10 + 4}.png")
  104.       end
  105.       elsif @wait == true
  106.       if @count == 60
  107.         @count = 0
  108.         @wait = false
  109.       else
  110.         @count += 1
  111.         end
  112.         if FileTest.exist?("Graphics/Mouse/wait_#{@count/10}.png")
  113.         @mouse_sprite.bitmap = Bitmap.new("Graphics/Mouse/wait_#{@count/10}.png")
  114.       end
  115.  
  116.       else
  117.       @count == 40 ? @count = 0 : @count += 1
  118.     if FileTest.exist?("Graphics/Mouse/#{@count/10}.png")
  119.        @mouse_sprite.bitmap = Bitmap.new("Graphics/Mouse/#{@count/10}.png")
  120.     end
  121.   end
  122. end
  123. self.show_light(@mouse_sprite.x, mouse_y)
  124.     self.check
  125.     if left_down[7] == 1
  126.       @left_repeat = (not @left_repeat)
  127.       @left_trigger = (not @left_press)
  128.       @left_press = true
  129.     else
  130.       @left_press = false
  131.       @left_trigger = false
  132.       @left_repeat = false
  133.     end
  134.     if right_down[7] == 1
  135.       @right_repeat = (not @right_repeat)
  136.       @right_trigger = (not @right_press)
  137.       @right_press = true
  138.     else
  139.       @right_press = false
  140.       @right_trigger = false
  141.       @right_repeat = false
  142.     end
  143.   end
  144.   def self.get_mouse_pos
  145.     point_var = [0, 0].pack('ll')
  146.     if $GetCursorPos.call(point_var) != 0
  147.       if $ScreenToClient.call($Window_HWND, point_var) != 0
  148.         x, y = point_var.unpack('ll')
  149.         if (x < 0) or (x > 10000) then x = 0 end
  150.         if (y < 0) or (y > 10000) then y = 0 end
  151.         if x > Graphics.width then x = Graphics.width end
  152.         if y > Graphics.height then y = Graphics.height end
  153.         return x, y
  154.       else
  155.         return 0, 0
  156.       end
  157.     else
  158.       return 0, 0
  159.     end
  160.   end
  161.   def self.press?(mouse_code)
  162.     if mouse_code == LEFT
  163.       if @click_lock
  164.         return false
  165.       else
  166.         return @left_press
  167.       end
  168.     elsif mouse_code == RIGHT
  169.       return @right_press
  170.     else
  171.       return false
  172.     end
  173.   end
  174.   def self.trigger?(mouse_code)
  175.     if mouse_code == LEFT
  176.       if @click_lock
  177.         return false
  178.       else
  179.         return @left_trigger
  180.       end
  181.     elsif mouse_code == RIGHT
  182.       return @right_trigger
  183.     else
  184.       return false
  185.     end
  186.   end
  187.   def self.repeat?(mouse_code)
  188.     if mouse_code == LEFT
  189.       if @click_lock
  190.         return false
  191.       else
  192.         return @left_repeat
  193.       end
  194.     elsif mouse_code == RIGHT
  195.       return @right_repeat
  196.     else
  197.       return false
  198.     end
  199.   end
  200.   def self.click_lock?
  201.     return @click_lock
  202.   end
  203.   def self.click_lock
  204.     @click_lock = true
  205.   end
  206.   def self.click_unlock
  207.     @click_lock = false
  208.   end
  209. end
  210. module Input
  211.   if @self_update == nil
  212.     @self_update = method('update')
  213.     @self_press = method('press?')
  214.     @self_trigger = method('trigger?')
  215.     @self_repeat = method('repeat?')
  216.   end
  217.   def self.update
  218.     @self_update.call
  219.     Mouse.update
  220.   end
  221.   def self.press?(key_code)
  222.     if @self_press.call(key_code)
  223.       return true
  224.     end
  225.     if key_code == C
  226.       return Mouse.press?(Mouse::LEFT)
  227.     elsif key_code == B
  228.       return Mouse.press?(Mouse::RIGHT)if !SceneManager.scene_is?(Scene_Map)
  229.     else
  230.       return @self_press.call(key_code)
  231.     end
  232.   end
  233.   def self.trigger?(key_code)
  234.     if @self_trigger.call(key_code)
  235.       return true
  236.     end
  237.     if key_code == C
  238.       return Mouse.trigger?(Mouse::LEFT)
  239.     elsif key_code == B
  240.  
  241.       return Mouse.trigger?(Mouse::RIGHT) if !SceneManager.scene_is?(Scene_Map)
  242.     else
  243.       return @self_trigger.call(key_code)
  244.     end
  245.   end
  246.   def self.repeat?(key_code)
  247.     if @self_repeat.call(key_code)
  248.       return true
  249.     end
  250.     if key_code == C
  251.       return Mouse.repeat?(Mouse::LEFT)
  252.     elsif key_code == B
  253.       return Mouse.repeat?(Mouse::RIGHT)if !SceneManager.scene_is?(Scene_Map)
  254.     else
  255.       return @self_repeat.call(key_code)
  256.     end
  257.   end
  258. end
  259.  
  260. class Window_Selectable
  261.   if @self_alias == nil
  262.     alias self_update update
  263.     @self_alias = true
  264.   end
  265.   def update
  266.     #self.cursor_rect.empty
  267.     self_update
  268.     if self.active and item_max > 0
  269.       index_var = @index
  270.       tp_index = @index
  271.       mouse_x, mouse_y = Mouse.get_mouse_pos
  272.       mouse_not_in_rect = true
  273.       for i in 0...item_max
  274.         @index = i
  275.         update_cursor
  276.         top_x = self.cursor_rect.x + self.x + 16
  277.         top_y = self.cursor_rect.y + self.y + 16
  278.         bottom_x = top_x + self.cursor_rect.width
  279.         bottom_y = top_y + self.cursor_rect.height
  280.  
  281.           top_x += self.x_mod
  282.           top_y += self.y_mod
  283.           bottom_x += self.x_mod
  284.           bottom_y += self.y_mod
  285.  
  286.         if (mouse_x > top_x) and (mouse_y > top_y) and
  287.            (mouse_x < bottom_x) and (mouse_y < bottom_y)
  288.           mouse_not_in_rect = false
  289.           if tp_index != @index
  290.             tp_index = @index
  291.             $data_system.sounds[0].play
  292.           end
  293.           break
  294.         end
  295.       end
  296.     if Input.trigger?(Input::F9)
  297.     p top_x,top_y,Mouse.get_mouse_pos
  298.     end
  299.       if mouse_not_in_rect
  300.         @index = index_var
  301.         update_cursor
  302.         Mouse.click_lock
  303.       else
  304.         Mouse.click_unlock               
  305.       end
  306.     end
  307.   end
  308. end
  309.  
  310.  
  311.  
  312.  
  313. class Window_NameInput
  314.   if @self_alias == nil
  315.     alias self_update update
  316.     @self_alias = true
  317.   end
  318.   def update
  319.     #self.cursor_rect.empty
  320.     self_update
  321.     if self.active
  322.       index_var = @index
  323.       mouse_x, mouse_y = Mouse.get_mouse_pos
  324.       mouse_not_in_rect = true
  325.       for i in (0...HIRAGANA.size).to_a.push(180)
  326.         @index = i
  327.         update_cursor
  328.         top_x = self.cursor_rect.x + self.x + 16
  329.         top_y = self.cursor_rect.y + self.y + 16
  330.         bottom_x = top_x + self.cursor_rect.width
  331.         bottom_y = top_y + self.cursor_rect.height
  332.         #
  333.         if (mouse_x > top_x) and (mouse_y > top_y) and
  334.            (mouse_x < bottom_x) and (mouse_y < bottom_y)
  335.           mouse_not_in_rect = false
  336.           break
  337.         end
  338.       end
  339.       if mouse_not_in_rect
  340.         @index = index_var
  341.         update_cursor
  342.         Mouse.click_lock
  343.       else
  344.         Mouse.click_unlock
  345.       end
  346.     end
  347.   end
  348. end
  349. =begin
  350.  
  351. class Window_InputNumber
  352.   if @self_alias == nil
  353.     alias self_update update
  354.     @self_alias = true
  355.   end
  356.   def update
  357.     #self.cursor_rect.empty
  358.     self_update
  359.     mouse_x, mouse_y = Mouse.get_mouse_pos
  360.     if self.active and @digits_max > 0
  361.       index_var = @index
  362.       mouse_not_in_rect = true
  363.       for i in 0...@digits_max
  364.         @index = i
  365.         #update_cursor
  366.         top_x = self.cursor_rect.x + self.x + 16
  367.         bottom_x = top_x + self.cursor_rect.width
  368.         #
  369.         if (mouse_x > top_x) and (mouse_x < bottom_x)
  370.           mouse_not_in_rect = false
  371.           break
  372.         end
  373.       end
  374.       if mouse_not_in_rect
  375.         @index = index_var
  376.         #update_cursor
  377.         Mouse.click_lock
  378.       else
  379.         Mouse.click_unlock
  380.       end
  381.     end
  382.     if @last_mouse_y == nil
  383.       @last_mouse_y = mouse_y
  384.     end
  385.     check_pos = (@last_mouse_y - mouse_y).abs
  386.     if check_pos > 10
  387.       #$game_system.se_play($data_system.cursor_se)
  388.       place = 10 ** (@digits_max - 1 - @index)
  389.       n = @number / place % 10
  390.       @number -= n * place
  391.       n = (n + 1) % 10 if mouse_y < @last_mouse_y
  392.       n = (n + 9) % 10 if mouse_y > @last_mouse_y
  393.       @number += n * place
  394.       refresh
  395.       @last_mouse_y = mouse_y
  396.     end
  397.   end
  398. end
  399. =end
  400.  
  401. class Scene_File
  402.   if @self_alias == nil
  403.     alias self_update update
  404.     @self_alias = true
  405.   end
  406.   def update
  407.     mouse_x, mouse_y = Mouse.get_mouse_pos
  408.     Mouse.click_lock
  409.     idx = 0
  410.     for i in @savefile_windows
  411.       top_x = i.x + 16
  412.       top_y = i.y + 16
  413.       bottom_x = top_x + i.width
  414.       bottom_y = top_y + i.height
  415.       if (mouse_x > top_x) and (mouse_y > top_y) and
  416.          (mouse_x < bottom_x) and (mouse_y < bottom_y)
  417.         i.selected = true
  418.         if @file_index != idx
  419.           @file_index = idx
  420.           $data_system.sounds[0].play
  421.         end            
  422.         Mouse.click_unlock
  423.       else
  424.         i.selected = false
  425.       end
  426.       idx += 1
  427.     end
  428.     self_update
  429.   end
  430. end
  431.  
  432. class Game_Player
  433.   if @self_alias == nil
  434.     alias self_update update
  435.     @self_alias = true
  436.   end
  437.   def update
  438.     mouse_x, mouse_y = Mouse.get_mouse_pos
  439.     if @last_move_x == nil
  440.       @last_move_x = false
  441.     end
  442.     if Mouse.trigger?(Mouse::RIGHT)
  443.       Mouse.right_menu(mouse_x, mouse_y)
  444.       Graphics.update
  445.     elsif Mouse.press?(Mouse::LEFT)
  446.       if Mouse.mouse_touch == true
  447.         Mouse.mouse_touch = false
  448.         return
  449.       end
  450.       Mouse.plight
  451.       Mouse.wait
  452.       last_moving = moving?
  453.       last_direction = @direction
  454.     #  return unless movable?
  455.     #  return if $game_map.interpreter.running?
  456.       unless moving? or $game_map.interpreter.running?
  457.       last_x = @x
  458.         if @last_move_x
  459.           @last_move_x = false
  460.         elsif mouse_x > screen_x + 16
  461.           move_straight(6)
  462.         elsif mouse_x < screen_x - 16
  463.           move_straight(4)
  464.         end
  465.         last_y = @y
  466.         if last_x != @x
  467.           @last_move_x = true
  468.         elsif mouse_y > screen_y
  469.           move_straight(2)
  470.         elsif mouse_y < screen_y - 32
  471.           move_straight(8)
  472.         end
  473. =begin        
  474.         if last_y != @y
  475.           @last_move_x = false
  476.         elsif not @last_move_x
  477.           case last_direction
  478.           when 2
  479.             turn_down
  480.           when 4
  481.             turn_left
  482.           when 6
  483.             turn_right
  484.           when 8
  485.             turn_up
  486.           end        
  487.         end
  488. =end         
  489.       end
  490.     end
  491.     self_update
  492.   end
  493. end
  494.  
  495. Mouse.init
  496. END { Mouse.exit }
  497.  
  498.  
  499. class Window_Base < Window
  500.   attr_accessor :x_mod
  501.   attr_accessor :y_mod
  502.   alias ka_initialize initialize
  503.   def initialize(x, y, width, height)
  504.     ka_initialize(x, y, width, height)
  505.     self.x_mod = 0
  506.     self.y_mod = 0
  507.   end
  508. end
  509. class Window_PartyCommand < Window_Command
  510.  
  511.   alias ka1_initialize initialize
  512.   def initialize
  513.     ka1_initialize
  514.     self.y_mod = Graphics.height-128
  515.   end
  516.  
  517. end
  518. class Window_ActorCommand < Window_Command
  519.  
  520.   alias ka2_initialize initialize
  521.   def initialize
  522.     ka2_initialize
  523.     self.x_mod = -128
  524.     self.y_mod = Graphics.height-128
  525.   end
  526.  
  527. end
  528.  
  529. #==============================================================================
  530. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  531. #==============================================================================

然后是第三个脚本:
RUBY 代码复制
  1. #==============================================================================
  2. # ■ Sprite_Character
  3. #------------------------------------------------------------------------------
  4. #check the mouse 's event and start.                       by End66rpg
  5. #==============================================================================
  6. class Sprite_Character < Sprite_Base
  7.   def inside?
  8.     mx,my = Mouse.get_mouse_pos
  9.     lx = self.x - self.ox
  10.     rx = lx + @cw
  11.     ty = self.y - self.oy
  12.     by = ty + @ch
  13.     if mx < lx or mx > rx or my < ty or my > by or
  14.       self.bitmap.get_pixel(mx-lx,my-ty).alpha == 0
  15.       return false
  16.     end
  17.     return true
  18.    end
  19.   alias update_old update
  20.   def update
  21.    update_old
  22.    self.tone = Tone.new(0,0,0)
  23.    self.zoom_y = 1
  24.    return if @character.is_a?(Game_Event) and @character.name.index('no point')
  25.    return if !inside?
  26.    Mouse.mouse_touch=true
  27.    if Mouse.trigger?(Mouse::LEFT)
  28.      Mouse.plight
  29.     return false if $game_message.busy? || $game_message.visible
  30.     return if @character == $game_player or @character.trigger == 4
  31.     sx = ($[email]game_player.x-@character.x[/email]).abs
  32.     sy = ($[email]game_player.y-@character.y[/email]).abs
  33.      return unless sx < 2 and sy < 2#这里的5是触发范围,即坐标差
  34.      @character.start
  35.    end
  36.  
  37.    if @character != $game_player
  38.      if @character.is_a?(Game_Event)
  39.        if @character.name.index('item')
  40.          Mouse.coach
  41.          return
  42.        elsif @character.name.index('heigh')
  43.          Mouse.coach
  44.          self.zoom_y = 1.5
  45.          return
  46.        end
  47.  
  48.      end
  49.     Mouse.npc
  50.   end
  51.    Mouse.enemy if @character != $game_map.events
  52.    self.tone = Tone.new(122,122,122)
  53.   end
  54. end
  55. class Game_Event < Game_Character
  56. #——————————————————————————————————————
  57. # 用来返回名称
  58. #——————————————————————————————————————
  59. def name
  60.    return @event.name
  61. end  
  62. def name=(newname)
  63.    @event.name = newname
  64. end
  65. end


注意:这三个脚本是一起的,要同时使用。

然后是这个脚本所需素材——
Mouse.zip (49.66 KB, 下载次数: 70)
把它Copy到Graphics目录下即可使用。

http://SRKF.tk 暗影の森,只属于自己的一片森林。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
191
在线时间
835 小时
注册时间
2012-9-16
帖子
1811
14
 楼主| 发表于 2012-10-18 19:24:55 | 只看该作者
约修亚_RK 发表于 2012-10-18 17:30
@yangjunyin2002
全鼠标的脚本是有的。
把以下代码Copy到插件栏就可以使用了:

出现错误了……


‘‘──yangjunyin2002于2012-10-18 19:26补充以下内容:

表示用了很多脚本,请问这个全鼠标操作的脚本和哪些脚本有冲突?
’’

——旧坑欢迎戳
回复 支持 反对

使用道具 举报

Lv4.逐梦者 (管理员)

砂上描绘的愿想

梦石
15
星屑
4019
在线时间
5070 小时
注册时间
2012-1-15
帖子
4617

开拓者贵宾短篇七成年组亚军剧作品鉴家

15
发表于 2012-10-18 21:29:29 | 只看该作者
yangjunyin2002 发表于 2012-10-18 19:24
出现错误了……

脚本兼容性的问题请在原发布帖和脚本原作者沟通吧,本帖结贴。
若后退就皆成谎言。
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-29 13:03

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表