XP 스크립트

Near Fantastica씨의 마우스 스크립트입니다.  일부 스크립트에서 이 것을 필요로 합니다.  물론 다른 마우스 입력 스크립트와 혼용불가입니다. 


#==============================================================================
# ** Mouse Input Module
#------------------------------------------------------------------------------
# Near Fantastica
# Version 5
# 01.03.06
#------------------------------------------------------------------------------
# This module defines mouse input
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log("Mouse Input", "Near Fantastica", 5, "01.03.06")

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state("Mouse Input") == true

module Mouse
  @position
  GSM = Win32API.new('user32', 'GetSystemMetrics', 'i', 'i')
  Cursor_Pos= Win32API.new('user32', 'GetCursorPos', 'p', 'i')
  Scr2cli = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i')
  Client_rect = Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
  Readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l')
  Findwindow = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')
  #-------------------------------------------------------------------------- 
  def Mouse.grid
    return nil if @pos == nil
    offsetx = $game_map.display_x / 4
    offsety = $game_map.display_y / 4
    x = (@pos[0] + offsetx) / 32
    y = (@pos[1] + offsety) / 32
    return [x, y]
  end
  #-------------------------------------------------------------------------- 
  def Mouse.position
    return @pos == nil ? [0, 0] : @pos
  end
  #-------------------------------------------------------------------------- 
  def Mouse.global_pos
    pos = [0, 0].pack('ll')
    if Cursor_Pos.call(pos) != 0
      return pos.unpack('ll')
    else
      return nil
    end
  end
  #-------------------------------------------------------------------------- 
  def Mouse.pos
    x, y = Mouse.screen_to_client(*Mouse.global_pos)
    width, height = Mouse.client_size
    begin
      if (x >= 0 and y >= 0 and x < width and y < height)
        return x, y
      else
        return nil
      end
    rescue
      return nil
    end
  end
  #-------------------------------------------------------------------------- 
  def Mouse.update
    @pos = Mouse.pos
  end
  #-------------------------------------------------------------------------- 
  def Mouse.screen_to_client(x, y)
    return nil unless x and y
    pos = [x, y].pack('ll')
    if Scr2cli.call(Mouse.hwnd, pos) != 0
      return pos.unpack('ll')
    else
      return nil
    end
  end
  #-------------------------------------------------------------------------- 
  def Mouse.hwnd
    game_name = "" * 256
    Readini.call('Game','Title','',game_name,255,".\Game.ini")
    game_name.delete!("")
    return Findwindow.call('RGSS Player',game_name)
  end
  #-------------------------------------------------------------------------- 
  def Mouse.client_size
    rect = [0, 0, 0, 0].pack('l4')
    Client_rect.call(Mouse.hwnd, rect)
    right, bottom = rect.unpack('l4')[2..3]
    return right, bottom
  end
end

#------------------------------------------------------------------------------
# * End SDK Enable Test
#------------------------------------------------------------------------------
end

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '2'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
801 스킬 Miriam's Handicrafts! 1.3 by DerVVulfman Alkaid 2012.08.26 1204
800 맵/타일 Mode07 0.5 by mewsterus 3 백호 2009.02.22 1149
799 메뉴 MOG - Scroll Bar for XP file 습작 2014.07.06 1532
798 상점 Mog- 상점업그레이드 ps인간 2009.01.23 2682
797 메뉴 Mog-메뉴업그레이드? ps인간 2009.01.23 2948
796 기타 mog-스테이터스 업그레이드? ps인간 2009.01.23 1904
795 아이템 mog-아이템창업그레이드? ps인간 2009.01.23 2555
794 HUD MOG_Active_Hud 3 file Bera 2010.09.11 2468
793 HUD MOG_C_HUD. 6 file Bera 2010.09.11 2329
792 기타 Monster Arena by trickster file 백호 2009.02.22 812
» 키입력 Mouse Input Module v5 by Near Fantastica (SDK호환) 2 백호 2009.02.22 962
790 이동 및 탈것 Mouse_move file 백호 2009.02.21 922
789 이동 및 탈것 Mouse_move 호환 100%강화버전 4 file 백호 2009.02.21 1512
788 이동 및 탈것 Mouse_move 호환버전 1 file 백호 2009.02.21 1059
787 전투 Mr Mo DVV Addon #14~#17 3 Alkaid 2011.05.23 1285
786 전투 Mr Mo DVV Addon #18~#19 Alkaid 2011.07.13 1266
785 전투 Mr Mo DVV Addon #20~#21 Alkaid 2011.09.05 1432
784 전투 Mr. Mo's ABS 5.5 13 Alkaid 2010.09.10 3459
783 전투 Mr. Mo's ABS Ultimate 1.2 by DerVVulfman Alkaid 2011.11.13 1640
782 전투 Mr. Mo's ABS Ultimate 1.9 by DerVVulfman 2 Alkaid 2011.12.01 1900
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ... 52 Next
/ 52