XP 스크립트

Near Fantastica씨의 키보드 입력 스크립트입니다.  몇몇 스크립트(가령 wachunga씨의 텍스트 입력 이벤트 명령)에서 이 스크립트를 필요로 합니다.  물론 다른 키보드 입력스크립트와 함께 사용할 수 없습니다.


#==============================================================================
# ** Keyboard Input Module
#==============================================================================
# Near Fantastica
# Version 5
# 29.11.05
#==============================================================================
# The Keyboard Input Module is designed to function as the default Input module
# dose. It is better then other methods keyboard input because as a key is
# tested it is not removed form the list. so you can test the same key multiple
# times the same loop.
#==============================================================================

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

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state("Keyboard Input") == true
 
  module Keyboard
    #--------------------------------------------------------------------------
    @keys = []
    @pressed = []
    Mouse_Left = 1
    Mouse_Right = 2
    Back= 8
    Tab = 9
    Enter = 13
    Shift = 16
    Ctrl = 17
    Alt = 18
    Esc = 27
    Space = 32
    Numberkeys = {}
    Numberkeys[0] = 48
    Numberkeys[1] = 49
    Numberkeys[2] = 50
    Numberkeys[3] = 51
    Numberkeys[4] = 52
    Numberkeys[5] = 53
    Numberkeys[6] = 54
    Numberkeys[7] = 55
    Numberkeys[8] = 56
    Numberkeys[9] = 57
    Numberpad = {}
    Numberpad[0] = 45
    Numberpad[1] = 35
    Numberpad[2] = 40
    Numberpad[3] = 34
    Numberpad[4] = 37
    Numberpad[5] = 12
    Numberpad[6] = 39
    Numberpad[7] = 36
    Numberpad[8] = 38
    Numberpad[9] = 33
    Letters = {}
    Letters["A"] = 65
    Letters["B"] = 66
    Letters["C"] = 67
    Letters["D"] = 68
    Letters["E"] = 69
    Letters["F"] = 70
    Letters["G"] = 71
    Letters["H"] = 72
    Letters["I"] = 73
    Letters["J"] = 74
    Letters["K"] = 75
    Letters["L"] = 76
    Letters["M"] = 77
    Letters["N"] = 78
    Letters["O"] = 79
    Letters["P"] = 80
    Letters["Q"] = 81
    Letters["R"] = 82
    Letters["S"] = 83
    Letters["T"] = 84
    Letters["U"] = 85
    Letters["V"] = 86
    Letters["W"] = 87
    Letters["X"] = 88
    Letters["Y"] = 89
    Letters["Z"] = 90
    Fkeys = {}
    Fkeys[1] = 112
    Fkeys[2] = 113
    Fkeys[3] = 114
    Fkeys[4] = 115
    Fkeys[5] = 116
    Fkeys[6] = 117
    Fkeys[7] = 118
    Fkeys[8] = 119
    Fkeys[9] = 120
    Fkeys[10] = 121
    Fkeys[11] = 122
    Fkeys[12] = 123
    Collon = 186
    Equal = 187
    Comma = 188
    Underscore = 189
    Dot = 190
    Backslash = 191
    Lb = 219
    Rb = 221
    Quote = 222
    State = Win32API.new("user32","GetKeyState",['i'],'i')
    Key = Win32API.new("user32","GetAsyncKeyState",['i'],'i')
    #-------------------------------------------------------------------------- 
    def Keyboard.getstate(key)
      return true unless State.call(key).between?(0, 1)
      return false
    end
    #--------------------------------------------------------------------------
    def Keyboard.testkey(key)
      Key.call(key) & 0x01 == 1
    end
    #--------------------------------------------------------------------------
    def Keyboard.update
      @keys = []
      @keys.push(Keyboard::Mouse_Left) if Keyboard.testkey(Keyboard::Mouse_Left)
      @keys.push(Keyboard::Mouse_Right) if Keyboard.testkey(Keyboard::Mouse_Right)
      @keys.push(Keyboard::Back) if Keyboard.testkey(Keyboard::Back)
      @keys.push(Keyboard::Tab) if Keyboard.testkey(Keyboard::Tab)
      @keys.push(Keyboard::Enter) if Keyboard.testkey(Keyboard::Enter)
      @keys.push(Keyboard::Shift) if Keyboard.testkey(Keyboard::Shift)
      @keys.push(Keyboard::Ctrl) if Keyboard.testkey(Keyboard::Ctrl)
      @keys.push(Keyboard::Alt) if Keyboard.testkey(Keyboard::Alt)
      @keys.push(Keyboard::Esc) if Keyboard.testkey(Keyboard::Esc)
      @keys.push(Keyboard::Space) if Keyboard.testkey(Keyboard::Space)
      for key in Keyboard::Numberkeys.values
        @keys.push(key) if Keyboard.testkey(key)
      end
      for key in Keyboard::Numberpad.values
        @keys.push(key) if Keyboard.testkey(key)
      end
      for key in Keyboard::Letters.values
        @keys.push(key) if Keyboard.testkey(key)
      end
      for key in Keyboard::Fkeys.values
        @keys.push(key) if Keyboard.testkey(key)
      end
      @keys.push(Keyboard::Collon) if Keyboard.testkey(Keyboard::Collon)
      @keys.push(Keyboard::Equal) if Keyboard.testkey(Keyboard::Equal)
      @keys.push(Keyboard::Comma) if Keyboard.testkey(Keyboard::Comma)
      @keys.push(Keyboard::Underscore) if Keyboard.testkey(Keyboard::Underscore)
      @keys.push(Keyboard::Dot) if Keyboard.testkey(Keyboard::Dot)
      @keys.push(Keyboard::Backslash) if Keyboard.testkey(Keyboard::Backslash)
      @keys.push(Keyboard::Lb) if Keyboard.testkey(Keyboard::Lb)
      @keys.push(Keyboard::Rb) if Keyboard.testkey(Keyboard::Rb)
      @keys.push(Keyboard::Quote) if Keyboard.testkey(Keyboard::Quote)
      @pressed = []
      @pressed.push(Keyboard::Mouse_Left) if Keyboard.getstate(Keyboard::Mouse_Left)
      @pressed.push(Keyboard::Mouse_Right) if Keyboard.getstate(Keyboard::Mouse_Right)
      @pressed.push(Keyboard::Back) if Keyboard.getstate(Keyboard::Back)
      @pressed.push(Keyboard::Tab) if Keyboard.getstate(Keyboard::Tab)
      @pressed.push(Keyboard::Enter) if Keyboard.getstate(Keyboard::Enter)
      @pressed.push(Keyboard::Shift) if Keyboard.getstate(Keyboard::Shift)
      @pressed.push(Keyboard::Ctrl) if Keyboard.getstate(Keyboard::Ctrl)
      @pressed.push(Keyboard::Alt) if Keyboard.getstate(Keyboard::Alt)
      @pressed.push(Keyboard::Esc) if Keyboard.getstate(Keyboard::Esc)
      @pressed.push(Keyboard::Space) if Keyboard.getstate(Keyboard::Space)
      for key in Keyboard::Numberkeys.values
        @pressed.push(key) if Keyboard.getstate(key)
      end
      for key in Keyboard::Numberpad.values
        @pressed.push(key) if Keyboard.getstate(key)
      end
      for key in Keyboard::Letters.values
        @pressed.push(key) if Keyboard.getstate(key)
      end
      for key in Keyboard::Fkeys.values
        @pressed.push(key) if Keyboard.getstate(key)
      end
      @pressed.push(Keyboard::Collon) if Keyboard.getstate(Keyboard::Collon)
      @pressed.push(Keyboard::Equal) if Keyboard.getstate(Keyboard::Equal)
      @pressed.push(Keyboard::Comma) if Keyboard.getstate(Keyboard::Comma)
      @pressed.push(Keyboard::Underscore) if Keyboard.getstate(Keyboard::Underscore)
      @pressed.push(Keyboard::Dot) if Keyboard.getstate(Keyboard::Dot)
      @pressed.push(Keyboard::Backslash) if Keyboard.getstate(Keyboard::Backslash)
      @pressed.push(Keyboard::Lb) if Keyboard.getstate(Keyboard::Lb)
      @pressed.push(Keyboard::Rb) if Keyboard.getstate(Keyboard::Rb)
      @pressed.push(Keyboard::Quote) if Keyboard.getstate(Keyboard::Quote) 
    end
    #--------------------------------------------------------------------------
    def Keyboard.trigger?(key)
      return true if @keys.include?(key)
      return false
    end
    #--------------------------------------------------------------------------
    def Keyboard.pressed?(key)
      return true if @pressed.include?(key)
      return false
    end
  end

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

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6313
561 기타 [신기술 체험] 오투잼 스크립트 7 file 백호 2009.02.22 1960
560 파티 [신기술 체험] 2p파티시스템(액알) 8 file 백호 2009.02.22 3198
559 기타 [신기술 체험] 솔로채팅창 17 file 백호 2009.02.22 2188
558 기타 [신기술 체험] RPGXP 3D 9 file 백호 2009.02.22 3639
557 전투 [신기술 체험]액션배틀1탄 6 file 백호 2009.02.22 2767
556 메뉴 Advanced Command Windows by Tsunokiette file 백호 2009.02.22 1308
555 기타 RM2K Facesets, Inn & Windowskin Colors by DerVVulfman@rmxp.org 1 file 백호 2009.02.22 866
554 스킬 SG_Skill Break by sandgolem (SDK호환) 백호 2009.02.22 776
553 아이템 SG_Item Break by sandgolem (SDK호환) 백호 2009.02.22 898
552 전투 SG_Attack Break by sandgolem (SDK호환) 백호 2009.02.22 814
551 메뉴 혹시있나해서-_-.. 대화창에 테두리치기 스크립트 7 백호 2009.02.22 2597
550 스킬 Skill Requirements by SephirothSpawn (SDK호환) file 백호 2009.02.22 765
549 저장 Inn & Save Point System by SephirothSpawn (SDK호환) 1 file 백호 2009.02.22 812
548 전투 Stealing/Mugging/Scanning 6.0 Final by Trickster (SDK호환) file 백호 2009.02.22 886
547 키입력 Mouse Input Module v5 by Near Fantastica (SDK호환) 2 백호 2009.02.22 962
» 키입력 Keyboard Input Module v5 by Near Fantastica (SDK호환) 백호 2009.02.22 1075
545 키입력 전체키 입력 스크립트 v4 by Cybersam 5 file 백호 2009.02.22 1948
544 기타 Tetris Attack by trickster 1 file 백호 2009.02.22 986
543 기타 Monster Arena by trickster file 백호 2009.02.22 812
542 기타 Minesweeper(지뢰찾기) by SephirothSpawn (SDK호환) 3 file 백호 2009.02.22 1363
Board Pagination Prev 1 ... 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ... 52 Next
/ 52