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 7301
1021 메시지 Taylor's Simple Message System 2000 Alkaid 2020.07.05 315
1020 제작도구 [XP/VX/VXA] Doodad's Editor by newold Alkaid 2020.07.12 460
1019 이름입력 한글조합입력기(영어가능) file 조규진1 2019.11.10 585
1018 기타 [All RGSS] FileTest (Unicode) file Cheapmunk 2014.12.29 656
1017 전투 전투중에 장비들 교체하기 file 레이스89 2017.08.19 682
1016 기타 에어리어 설정 by RPG Advocate 백호 2009.02.22 735
1015 기타 Boat Script 백호 2009.02.21 749
1014 기타 Materia System file 백호 2009.02.21 767
1013 기타 Localization by ForeverZer0, KK20 습작 2013.04.26 767
1012 기타 killer님 요청하신 스크립트 두번째입니다. 나뚜루 2009.02.21 770
1011 스킬 SG_Escape Only Skills by sandgolem (SDK호환) 백호 2009.02.22 772
1010 기타 Letter by Letter Message Window by slipknot@rmxp.org (SDK호환) 1 file 백호 2009.02.22 773
1009 맵/타일 맵연결 스크립트 (데모첨부) file 게임애호가 2018.06.15 773
1008 기타 Real-Time Day Night 3 백호 2009.02.22 775
1007 기타 AMS-Advanced Message Script Edited by Dubleax 3 file 백호 2009.02.21 780
1006 스킬 Skill Requirements by SephirothSpawn (SDK호환) file 백호 2009.02.22 780
1005 기타 Sphere Grid System file 백호 2009.02.21 785
1004 기타 Activation_system file 백호 2009.02.22 786
1003 기타 Advanced Gold display by Dubealex 1 백호 2009.02.22 786
1002 전투 전투 관련 횟수 취득 스크립트 백호 2009.02.21 791
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52