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
18 키입력 한글입력스크립트 16 file 아방스 2007.11.09 11823
17 키입력 한글입력기 6 백호 2009.02.22 4286
16 키입력 메세지 입력 스크립트. 25 file Bera 2010.10.18 3582
15 키입력 한글입력기(자음, 모음 분리. 아마 중복일 듯...) 11 캉쿤 2011.09.13 3225
14 키입력 AInput Module 3.10 by vgvgf (전체키, 마우스 입력) 6 file Alkaid 2010.09.01 3029
13 키입력 [xp,vx]마우스 제스쳐 스크립트 2 클로시스 2013.09.26 2294
12 키입력 新전체키 스크립트(그에 따른 그림도 실려있음) 6 file 백호 2009.02.21 2255
11 키입력 Aleworks Input Module 1.21 by vgvgf (SDK호환) 8 WMN 2008.04.06 2145
10 키입력 新전체키 스크립트 예제 - 양키 7 file 백호 2009.02.21 2080
9 키입력 Glitchfinder's Input Modules (XP/VX 공용) 2 Alkaid 2011.03.19 1952
8 키입력 전체키 입력 스크립트 v4 by Cybersam 5 file 백호 2009.02.22 1947
7 키입력 텍스트입력 이벤트명령 2.0 by wachunga@rmxp.org (SDK호환) file 백호 2009.02.22 1825
6 키입력 키보드 입력을 변수에 받아들이기 1 file 백호 2009.02.21 1802
5 키입력 전체 키 사용 스크립트 1 백호 2009.02.21 1423
4 키입력 Key Simulator by Fantasist 4 습작 2013.05.01 1143
3 키입력 Keyboard Input Module v5 by Near Fantastica (SDK호환) 백호 2009.02.22 1075
2 키입력 No F1, F12 and Alt+Return (Kein F1, F12 und Alt+Eingabe) by cremno 습작 2013.04.19 994
» 키입력 Mouse Input Module v5 by Near Fantastica (SDK호환) 2 백호 2009.02.22 962
Board Pagination Prev 1 Next
/ 1