Więc mój problem polega na tym że w netplay jest wgrany skrypt autorstwa "Cybersam''
wszystko działa ładnie ale jak dogram skrypt np. dozorca lub coś w tym stylu to myszka automatycznie działa w dogranych skryptach lecz jest nie wy kalibrowana i przez to nie można obsługiwać innych skryptów,więc szukam pomocy osób znających się na ruby który mogły by pomóc wyłączyć myszkę w innych skryptach lub wy kalibrować ją.
Niżej podaje dwa skrypty
Mouse
Kod:
#===============================================================================
# ** Mouse Script v1 - Thank you to Cybersam who decoded Windows in order to make
# this work. of the credit, all I did was add a few functions.
# Without this script my entire system would not work. Thank you!
# I would not edit this, because it could easily be messed up. (Astro_Mech says)
#-------------------------------------------------------------------------------
# Author Cybersam
# Modified Valentine
# Version 2.0
# Date 11-04-06
# Edit Astro_mech
#===============================================================================
#--------------------------------------------------------------------------
# * Attributes
#--------------------------------------------------------------------------
attr_accessor :icon
attr_accessor :x
attr_accessor :y
#--------------------------------------------------------------------------
# * Starts up the class, and creates the cursor icon
#--------------------------------------------------------------------------
def initialize
@x = 0
@y = 0
$icon = RPG::Cache.icon(MOUSE_ICON["Default"])
@icon_name = MOUSE_ICON["Default"]
@sprite = Sprite.new
#@sprite.bitmap = $icon
@sprite.opacity = 0
@sprite.z = 999999999
@draw = false
end
#--------------------------------------------------------------------------
# * Reset
#--------------------------------------------------------------------------
def reset
$icon = RPG::Cache.icon(MOUSE_ICON["Default"])
@icon_name = MOUSE_ICON["Default"]
@sprite.dispose if @sprite.bitmap != nil
@sprite = Sprite.new
@sprite.bitmap = $icon
@draw = false
# Updates the co-ordinates of the icon
@x, @y = Mouse.mouse_pos
@sprite.x = @x
@sprite.y = @y
@sprite.z = 999999999
end
#--------------------------------------------------------------------------
# * Reset 2
#--------------------------------------------------------------------------
def reset2
$icon = RPG::Cache.icon($mouse_iconfor)
@icon_name = MOUSE_ICON["Default"]
@sprite.dispose if @sprite.bitmap != nil
@sprite = Sprite.new
@sprite.bitmap = $icon
@draw = false
# Updates the co-ordinates of the icon
@old_x = @x # prevent the F2 bug
@old_y = @y # prevent the F2 bug
@x, @y = Mouse.mouse_pos
@x = @old_x if @x==nil # prevent the F2 bug
@y = @old_y if @y==nil # Prevent the F2 Bug
@sprite.x = @x
@sprite.y = @y
@sprite.z = 999999999
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
# Updates the co-ordinates of the icon
@old_x = @x # prevent the F2 bug
@old_y = @y # prevent the F2 bug
@x, @y = Mouse.mouse_pos
@x = @old_x if @x==nil # prevent the F2 bug
@y = @old_y if @y==nil # Prevent the F2 Bug
@sprite.x = @x
@sprite.y = @y
if $scene.is_a?(Scene_Map)
#Check if the mouse is clicked
if Input.pressed?(Input::Mouse_Left)
mouse_interactive
end
mouse_netinteractive if Input.pressed?(Input::Mouse_Right)
#$game_player.clear_path if Input.trigger(Input::Mouse_Right) or $game_temp.message_window_showing or $game_netplay.chat_active
#Check for mouse over
check_icon_to_icon
end
if $game_temp.atualizar_mouse == true
$game_temp.atualizar_mouse = false
reset2
end
end
#--------------------------------------------------------------------------
# * Change Icon according to the Icon List
#--------------------------------------------------------------------------
def check_icon_to_icon
object = get_allobject
if object[0]
if object[1].is_a?(Game_Event)
list = comment_include(object[1], "Mouse")
return if list == nil
#Check what the list is
for key in MOUSE_ICON.keys
next if !list.include?(key)
next if @icon_name == MOUSE_ICON[key]
return if can_mouse_pos? == false
$icon = RPG::Cache.icon(MOUSE_ICON[key])
@icon_name = MOUSE_ICON[key]
@sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
@sprite.bitmap = $icon
end
elsif object[1].is_a?(Game_NetPlayer)
#Check what the list is
if @icon_name != MOUSE_ICON["NETPLAYER"]
$icon = RPG::Cache.icon(MOUSE_ICON["NETPLAYER"])
@icon_name = MOUSE_ICON["NETPLAYER"]
@sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
@sprite.bitmap = $icon
end
end
elsif @icon_name != MOUSE_ICON["Default"]
$icon = RPG::Cache.icon(MOUSE_ICON["Default"])
@icon_name = MOUSE_ICON["Default"]
@sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
@sprite.bitmap = $icon
end
end
#--------------------------------------------------------------------------
# * Can Mouse Position
#--------------------------------------------------------------------------
def can_mouse_pos?
return false if $pegando_item == true
return false if $pegando_item_loja == true
return false if $pegando_skill == true
return false if $pegando_item_trade == true
return false if $desequipar_arma == true
return false if $desequipar_armadura== true
return false if $desequipar_escudo == true
return false if $desequipar_helmet== true
return false if $desequipar_acessorio == true
return false if $desequipar_capa == true
return false if $desequipar_luva == true
return false if $desequipar_bota == true
return false if $desequipar_amuleto == true
return true
end
#--------------------------------------------------------------------------
# * Interactive System
#--------------------------------------------------------------------------
def mouse_interactive
#Check if there is something on that pos.
object = get_object
if object[0] and object[1].is_a?(Game_Event)
#Get the correct pos
pos = get_pos(object[1])
#return if there is no pos
return if pos == nil
#Move to pos
return if can_mouse_pos? == false
return if $equip_w.in_area? and $equip_w.visible
return if $member_list.in_area? and $member_list.visible
return if $item_w.in_area? and $item_w.visible
return if $painel_adm.in_area? and $painel_adm.visible
return if $teleport.in_area? and $teleport.visible
return if $skill.in_area? and $skill.visible
return if $guild_w.in_area? and $guild_w.visible
return if $guild_created.in_area? and $guild_created.visible
return if $janela_base.in_area?
$game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
#Activate event if facing event and next to event.
#start event
list = comment_include(object[1], "ABS")
if $game_map.events[object[1].id].opacity == 150
return if $fechando_ativar == true
$game_map.events[object[1].id].opacity = 255
$fechando_ativar = true
else
return if $fechando_ativar == true
$game_map.events[object[1].id].opacity = 150
#if $event_opa != $game_map.events[object[1].id] and $event_opa != nil
#$game_map.events[$event_opa].opacity = 255
#end
$player_opa = nil
$player_leva = nil
$event_opa = object[1].id
$event_leva = object[1]
if $ABS.enemies[$event_leva.id] != nil
else
$event_leva = nil
end
$fechando_ativar = true
end
if list != nil
#Network::Main.socket.send("5|@pvp_target = 'NPC'|<->")
# $game_party.actors[0].pvp_target = [$game_map.events[object[1].id],$ABS.enemies[object[1].id]]
return
end
end
#Check if there is something on that pos.
object = get_netobj
if object[0] and object[1].is_a?(Game_NetPlayer)
#Get the correct pos
pos = get_pos(object[1])
#return if there is no pos
return if pos == nil
#Move to pos
$game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
#Activate event if facing event and next to event.
return if !in_range?($game_player, object[1], 20)
return if $fechando_ativar == true
if object[1].opacity == 150
return if $fechando_ativar == true
object[1].opacity = 255
$fechando_ativar = true
else
return if $fechando_ativar == true
object[1].opacity = 150
$event_opa = nil
$event_leva = nil
$player_opa = object[1].id
$player_leva = object[1]
$fechando_ativar = true
end
if object[0] and object[1].is_a?(Game_Event)
list = comment_include(object[1], "Mouse")
return if list == nil
#Get the correct pos
pos = get_pos(object[1])
#return if there is no pos
return if pos == nil
#if list.include?("Start") and !in_range?($game_player, object[1], 1)
#Move to pos
return $game_player.find_path(pos[0], pos[1]) if list.include?("Cursor") and !in_range?($game_player, object[1], 1)
$game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
#Activate event if facing event and next to event.
return if !in_direction?($game_player,object[1]) or !in_range?($game_player, object[1], 1)
#start event
object[1].start if list.include?("Cursor")
return
end
#If there is nothing than move
return if !$game_map.passable?(tile_x, tile_y, 0, $game_player)
if $item_w.in_area? or $equip_w.in_area? and $item_w.visible == true
elsif $skill.in_area? and $skill.visible == true
elsif $trade_a == true
if $trade_w.in_area? and $trade_w.visible == true or $trade_w_2.in_area? and $trade_w_2.visible == true or $trade_w_3.in_area? and $trade_w_3.visible == true
else
if $pegando_item == false and $pegando_item_trade == false and $pegando_item_loja == false
$game_player.find_path(tile_x, tile_y) if User_Edit::PATHFIND_ACTIVE
end
end
elsif $loja == true
if $loja_w.in_area? and $loja_w.visible == true
else
if $pegando_item == false and $pegando_item_trade == false and $pegando_item_loja == false
$game_player.find_path(tile_x, tile_y) if User_Edit::PATHFIND_ACTIVE
end
end
elsif $status.in_area? and $status.visible == true
elsif $member_list.in_area? and $member_list.visible == true
elsif $guild_created.in_area? and $guild_created.visible == true
elsif $msg.in_area? and $msg.visible == true
elsif $janela_base.in_area? and $janela_base.visible == true
elsif $chat.in_area? and $chat.visible == true
elsif $painel_adm.in_area? and $painel_adm.visible == true
elsif $pegando_item_trade == true
elsif $pegando_item_loja == true
elsif $fechando_ativar == true
elsif $pegando_skill == true
elsif $pegando_item == true
elsif $arrastando_poxa == true
elsif $desequipar_arma == true
elsif $desequipar_armadura== true
elsif $desequipar_escudo == true
elsif $desequipar_helmet== true
elsif $desequipar_acessorio == true
elsif $desequipar_capa == true
elsif $desequipar_luva == true
elsif $desequipar_bota == true
elsif $desequipar_amuleto == true
elsif $chat_textinho.in_area? and $chat_textinho.visible == true
elsif $teleport.in_area? and $teleport.visible == true
elsif $guild_w.in_area? and $guild_w.visible == true
elsif $quest_list.in_area? and $quest_list.visible == true
elsif $quest_w.in_area? and $quest_w.visible == true
else
$game_player.find_path(tile_x, tile_y) if User_Edit::PATHFIND_ACTIVE
end
end
def mouse_netinteractive
#Check if there is something on that pos.
object = get_netobj
if object[0] and object[1].is_a?(Game_NetPlayer)
#Get the correct pos
pos = get_pos(object[1])
#return if there is no pos
return if pos == nil
#Move to pos
$game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
#Activate event if facing event and next to event.
return if !in_range?($game_player, object[1], 20)
#start event
$scene.active_netcommand(@x,@y,object[1].netid)
return
end
# $game_player.find_path(tile_x, tile_y)
end
#--------------------------------------------------------------------------
# * Get Pos
#--------------------------------------------------------------------------
def get_pos(object)
return [tile_x-1,tile_y] if $game_map.passable?(tile_x-1, tile_y, 0, object)
return [tile_x,tile_y-1] if $game_map.passable?(tile_x, tile_y-1, 0, object)
return [tile_x+1,tile_y] if $game_map.passable?(tile_x+1, tile_y, 0, object)
return [tile_x,tile_y+1] if $game_map.passable?(tile_x, tile_y+1, 0, object)
return nil
end
#--------------------------------------------------------------------------
# * Get Object
#--------------------------------------------------------------------------
def get_object
for event in $game_map.events.values
return [true,event] if event.x == tile_x and event.y == tile_y
end
return [false,nil]
end
def get_netobj
for player in Network::Main.mapplayers.values
return [true,player] if player.x == tile_x and player.y == tile_y
end
return [false,nil]
end
def get_allobject
for player in Network::Main.mapplayers.values
return [true,player] if player.x == tile_x and player.y == tile_y
end
for event in $game_map.events.values
return [true,event] if event.x == tile_x and event.y == tile_y
end
return [false,nil]
end
#--------------------------------------------------------------------------
# * Get Comments
#--------------------------------------------------------------------------
def comment_include(*args)
list = *args[0].list
trigger = *args[1]
return nil if list == nil
return nil unless list.is_a?(Array)
for item in list
next if item.code != 108
par = item.parameters[0].split(' ')
return item.parameters[0] if par[0] == trigger
end
return nil
end
#--------------------------------------------------------------------------
# * In Range?(Element, Object, Range) - Near Fantastica
#--------------------------------------------------------------------------
def in_range?(element, object, range)
x = (element.x - object.x) * (element.x - object.x)
y = (element.y - object.y) * (element.y - object.y)
r = x + y
return true if r <= (range * range)
return false
end
#--------------------------------------------------------------------------
# * In Direction?(Element, Object) - Near Fantastica
#--------------------------------------------------------------------------
def in_direction?(element, object)
return true if element.direction == 2 and object.y >= element.y and object.x == element.x
return true if element.direction == 4 and object.x <= element.x and object.y == element.y
return true if element.direction == 6 and object.x >= element.x and object.y == element.y
return true if element.direction == 8 and object.y <= element.y and object.x == element.x
return false
end
#--------------------------------------------------------------------------
# * Returns the current x-coordinate of the tile the mouse is over on the map
#--------------------------------------------------------------------------
def tile_x
return ((($game_map.display_x.to_f/4.0).floor + @x.to_f)/32.0).floor
end
#--------------------------------------------------------------------------
# * Returns the current y-coordinate of the tile the mouse is over on the map
#--------------------------------------------------------------------------
def tile_y
return ((($game_map.display_y.to_f/4.0).floor + @y.to_f)/32.0).floor
end
#--------------------------------------------------------------------------
# * Makes the mouse sprite disappear
#--------------------------------------------------------------------------
def invisible
@sprite.opacity = 0
#Win32API.new('user32', 'ShowCursor', 'l', 'l').call(1)
end
#--------------------------------------------------------------------------
# * Makes the mouse sprite visible
#--------------------------------------------------------------------------
def visible
@sprite.opacity = 255
#Win32API.new('user32', 'ShowCursor', 'l', 'l').call(0)
end
#--------------------------------------------------------------------------
# * Disposes the sprite
#--------------------------------------------------------------------------
def dispose
@sprite.dispose
end
end
end
#-------------------------------------------------------------------------------
# End SDK Enabled Check
#-------------------------------------------------------------------------------
class Window_Message
#--------------------------------------------------------------------------
alias mrmo_mouse_window_message_initialize initialize
#--------------------------------------------------------------------------
def initialize
mrmo_mouse_window_message_initialize
@closable = true
end
#--------------------------------------------------------------------------
# * On Close Event.
#--------------------------------------------------------------------------
def on_close
self.active=true
self.visible=true
if $game_temp.message_window_showing
if $game_temp.choice_max > 0
$game_system.se_play($data_system.decision_se)
$game_temp.choice_proc.call(self.index)
end
terminate_message
end
end
end
#==============================================================================
# ** Game_Character (part 1)
#------------------------------------------------------------------------------
# This class deals with characters. It's used as a superclass for the
# Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Turn Towards B
#--------------------------------------------------------------------------
def turn_to(b)
# Get difference in player coordinates
sx = @x - b.x
sy = @y - b.y
# If coordinates are equal
if sx == 0 and sy == 0
return
end
end
end
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum