Wie kann ich aus diesem Menu script das Save entnehmen???
=begin
Script Criado por DouglasMF das comunidades VilaMakers Online e RPG Maker Brasil
Com base no script Ring Menu feito por XRXS, Dubealex e Hypershadow180
-- Instru??es --
Para instalar este script coloque ele entre os scripts Main e Scene_Cameover
=end
#==============================================================================
# Scene_Menu
#------------------------------------------------------------------------------
# Esta classe controla o conjunto de objetos que forma o RingMenu
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# Inicializa
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# Inicia os objetos do menu
#--------------------------------------------------------------------------
def start
super
@spriteset = Spriteset_Map.new
@gold_window = Window_Gold.new(0, 360)
@win_local = Window_Local.new(0,0)
@status_window = Window_MenuStatus.new(160, 0)
px = $game_player.screen_x - 16
py = $game_player.screen_y - 28
@ring_menu = Window_RingMenu_Comando.new(px,py)
@status_window.z = @ring_menu.z + 20
@status_window.visible = false
end
#--------------------------------------------------------------------------
# Fexa os objetos do menu
#--------------------------------------------------------------------------
def terminate
super
@spriteset.dispose
@ring_menu.dispose
@gold_window.dispose
@win_local.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# Atualiza os objetos do menu
#--------------------------------------------------------------------------
def update
super
@ring_menu.update
@gold_window.update
@win_local.update
@spriteset.update
@status_window.update
if @ring_menu.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# Atualiza o comando e a sele??o do menu
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @ring_menu.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @ring_menu.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @ring_menu.indice
when 0
$scene = Scene_Item.new
when 1,2,3
start_actor_selection
when 4
$scene = Scene_File.new(true, false, false)
when 5
$scene = Scene_End.new
end
end
if Input.trigger?(Input::UP) or Input.trigger?(Input::LEFT)
Sound.play_cursor
@ring_menu.girar(3)
return
end
if Input.trigger?(Input::DOWN) or Input.trigger?(Input::RIGHT)
Sound.play_cursor
@ring_menu.girar(4)
return
end
end
#--------------------------------------------------------------------------
# Inicia a sele??o de personagem
#--------------------------------------------------------------------------
def start_actor_selection
@ring_menu.active = false
@status_window.visible = true
@status_window.active = true
if $game_party.last_actor_index < @status_window.item_max
@status_window.index = $game_party.last_actor_index
else
@status_window.index = 0
end
end
#--------------------------------------------------------------------------
# Finaliza a sele??o de personagens
#--------------------------------------------------------------------------
def end_actor_selection
@ring_menu.active = true
@status_window.active = false
@status_window.visible = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# Atualiza a sele??o de personagens
#--------------------------------------------------------------------------
def update_actor_selection
if Input.trigger?(Input::B)
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @ring_menu.indice
when 1
$scene = Scene_Skill.new(@status_window.index)
when 2
$scene = Scene_Equip.new(@status_window.index)
when 3
$scene = Scene_Status.new(@status_window.index)
end
end
end
end
#==============================================================================
# Window_RingMenu_Comando
#------------------------------------------------------------------------------
# Esta classe cria o ring menu.
#==============================================================================
class Window_RingMenu_Comando < Window_Base
DurIni = 30
DurMov = 15
RaioAnel = 64
ModoIni = 1
ModoEsp = 2
ModoMD = 3
ModoME = 4
SE_Inicio = ""
attr_accessor :indice
#--------------------------------------------------------------------------
# Inicia o objeto
#--------------------------------------------------------------------------
def initialize(centro_x,centro_y)
super(0, 0, 544, 416)
self.opacity = 0
self.contents.font.size = 16
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
@item_name = [s1,s2,s3,s4,s5,s6]
@item_max = 6
@item_icon = [144,128,40,137,149,112]
@item_hab = [true,true,true,true,true,true]
@indice = 0
@cx = centro_x - 12
@cy = centro_y - 12
inicia_menu
refresh
end
#--------------------------------------------------------------------------
# Atualiza o objeto
#--------------------------------------------------------------------------
def update
super
refresh
end
#--------------------------------------------------------------------------
# Atualiza o objeto
#--------------------------------------------------------------------------
def refresh
self.contents.clear
case @modo
when ModoIni
refresh_inicio
when ModoEsp
refresh_espera
when ModoMD
refresh_mover(1)
when ModoME
refresh_mover(0)
end
sw = self.contents.width
rect = Rect.new((@cx - ((sw-32)/2))+12, @cy - 40, sw-32, 32)
self.contents.draw_text(rect, @item_name[@indice],1)
end
#--------------------------------------------------------------------------
# Abre o menu
#--------------------------------------------------------------------------
def refresh_inicio
d1 = 2.0 * Math::PI / @item_max
d2 = 1.0 * Math::PI / DurIni
r = RaioAnel - 1.0 * RaioAnel * @passos / DurIni
for i in 0...@item_max
j = i - @indice
d = d1 * j + d2 * @passos
x = @cx + ( r * Math.sin( d ) ).to_i
y = @cy - ( r * Math.cos( d ) ).to_i
desenha_item(x, y, i)
end
@passos -= 1
if @passos < 1
@modo = ModoEsp
end
end
#--------------------------------------------------------------------------
# Atualiza o menu
#--------------------------------------------------------------------------
def refresh_espera
d = 2.0 * Math::PI / @item_max
for i in 0...@item_max
j = i - @indice
x = @cx + ( RaioAnel * Math.sin( d * j ) ).to_i
y = @cy - ( RaioAnel * Math.cos( d * j ) ).to_i
desenha_item(x, y, i)
end
end
#--------------------------------------------------------------------------
# Movimenta o menu
#--------------------------------------------------------------------------
def refresh_mover(modo)
d1 = 2.0 * Math::PI / @item_max
d2 = d1 / DurMov
d2 *= -1 if modo != 0
for i in 0...@item_max
j = i - @indice
d = d1 * j + d2 * @passos
x = @cx + ( RaioAnel * Math.sin( d ) ).to_i
y = @cy - ( RaioAnel * Math.cos( d ) ).to_i
desenha_item(x, y, i)
end
@passos -= 1
if @passos < 1
@modo = ModoEsp
end
end
#--------------------------------------------------------------------------
# Desenha o icone
#--------------------------------------------------------------------------
def desenha_item(x, y, i)
if @indice == i
self.cursor_rect.set(x-4, y-4, 32, 32)
draw_icon(@item_icon, x, y, @item_hab)
else
draw_icon(@item_icon, x, y, @item_hab)
end
end
#--------------------------------------------------------------------------
# Inicia o menu
#--------------------------------------------------------------------------
def inicia_menu
@modo = ModoIni
@passos = DurIni
if SE_Inicio != nil and SE_Inicio != ""
Audio.se_play("Audio/SE/" + SE_Inicio, 80, 100)
end
end
#--------------------------------------------------------------------------
# Gira o menu
#--------------------------------------------------------------------------
def girar(modo)
if modo == ModoMD
@indice -= 1
@indice = @item_hab.size - 1 if @indice < 0
elsif modo == ModoME
@indice += 1
@indice = 0 if @indice >= @item_hab.size
else
return
end
@modo = modo
@passos = DurMov
end
end
#==============================================================================
# Scene_Title
#------------------------------------------------------------------------------
# Faz modifica??es nescessarias para a exibi??o do nome do mapa
#==============================================================================
class Scene_Title
alias load_database_old load_database
def load_database
load_database_old
$data_mapinfo = load_data("Data/MapInfos.rvdata")
end
end
#==============================================================================
# Window_Local
#------------------------------------------------------------------------------
# Cria a janela responsavel pela exibi??o do nome do mapa
#==============================================================================
class Window_Local < Window_Base
#--------------------------------------------------------------------------
# Inicia o objeto
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 160, 96)
refresh
end
#--------------------------------------------------------------------------
# Atualiza o objeto
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, "Local:")
self.contents.font.color = system_color
self.contents.draw_text(4, 32, 120, 32, $data_mapinfo[$game_map.map_id].name, 2)
end
end
MFG TheBoy
Edit...
Das andere funktioniert super :D
Nur noch eine frage... Wie kann ich andere tasten als bedingung nehmen...
BSP... die taste S soll das fenster öffnen wie mache ich das nun?
es gibt ja keine konfiguration dafür
Keine Antworten mehr???
Zu den Ungeklärten fragen
1. Wie entnehme ich da die Speichern option
=begin
Script Criado por DouglasMF das comunidades VilaMakers Online e RPG Maker Brasil
Com base no script Ring Menu feito por XRXS, Dubealex e Hypershadow180
-- Instru??es --
Para instalar este script coloque ele entre os scripts Main e Scene_Cameover
=end
#==============================================================================
# Scene_Menu
#------------------------------------------------------------------------------
# Esta classe controla o conjunto de objetos que forma o RingMenu
#==============================================================================
class Scene_Menu < Scene_Base
#--------------------------------------------------------------------------
# Inicializa
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------------------------------------------------
# Inicia os objetos do menu
#--------------------------------------------------------------------------
def start
super
@spriteset = Spriteset_Map.new
@gold_window = Window_Gold.new(0, 360)
@win_local = Window_Local.new(0,0)
@status_window = Window_MenuStatus.new(160, 0)
px = $game_player.screen_x - 16
py = $game_player.screen_y - 28
@ring_menu = Window_RingMenu_Comando.new(px,py)
@status_window.z = @ring_menu.z + 20
@status_window.visible = false
end
#--------------------------------------------------------------------------
# Fexa os objetos do menu
#--------------------------------------------------------------------------
def terminate
super
@spriteset.dispose
@ring_menu.dispose
@gold_window.dispose
@win_local.dispose
@status_window.dispose
end
#--------------------------------------------------------------------------
# Atualiza os objetos do menu
#--------------------------------------------------------------------------
def update
super
@ring_menu.update
@gold_window.update
@win_local.update
@spriteset.update
@status_window.update
if @ring_menu.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
#--------------------------------------------------------------------------
# Atualiza o comando e a sele??o do menu
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
if $game_party.members.size == 0 and @ring_menu.index < 4
Sound.play_buzzer
return
elsif $game_system.save_disabled and @ring_menu.index == 4
Sound.play_buzzer
return
end
Sound.play_decision
case @ring_menu.indice
when 0
$scene = Scene_Item.new
when 1,2,3
start_actor_selection
when 4
$scene = Scene_File.new(true, false, false)
when 5
$scene = Scene_End.new
end
end
if Input.trigger?(Input::UP) or Input.trigger?(Input::LEFT)
Sound.play_cursor
@ring_menu.girar(3)
return
end
if Input.trigger?(Input::DOWN) or Input.trigger?(Input::RIGHT)
Sound.play_cursor
@ring_menu.girar(4)
return
end
end
#--------------------------------------------------------------------------
# Inicia a sele??o de personagem
#--------------------------------------------------------------------------
def start_actor_selection
@ring_menu.active = false
@status_window.visible = true
@status_window.active = true
if $game_party.last_actor_index < @status_window.item_max
@status_window.index = $game_party.last_actor_index
else
@status_window.index = 0
end
end
#--------------------------------------------------------------------------
# Finaliza a sele??o de personagens
#--------------------------------------------------------------------------
def end_actor_selection
@ring_menu.active = true
@status_window.active = false
@status_window.visible = false
@status_window.index = -1
end
#--------------------------------------------------------------------------
# Atualiza a sele??o de personagens
#--------------------------------------------------------------------------
def update_actor_selection
if Input.trigger?(Input::
Sound.play_cancel
end_actor_selection
elsif Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @ring_menu.indice
when 1
$scene = Scene_Skill.new(@status_window.index)
when 2
$scene = Scene_Equip.new(@status_window.index)
when 3
$scene = Scene_Status.new(@status_window.index)
end
end
end
end
#==============================================================================
# Window_RingMenu_Comando
#------------------------------------------------------------------------------
# Esta classe cria o ring menu.
#==============================================================================
class Window_RingMenu_Comando < Window_Base
DurIni = 30
DurMov = 15
RaioAnel = 64
ModoIni = 1
ModoEsp = 2
ModoMD = 3
ModoME = 4
SE_Inicio = ""
attr_accessor :indice
#--------------------------------------------------------------------------
# Inicia o objeto
#--------------------------------------------------------------------------
def initialize(centro_x,centro_y)
super(0, 0, 544, 416)
self.opacity = 0
self.contents.font.size = 16
s1 = Vocab::item
s2 = Vocab::skill
s3 = Vocab::equip
s4 = Vocab::status
s5 = Vocab::save
s6 = Vocab::game_end
@item_name = [s1,s2,s3,s4,s5,s6]
@item_max = 6
@item_icon = [144,128,40,137,149,112]
@item_hab = [true,true,true,true,true,true]
@indice = 0
@cx = centro_x - 12
@cy = centro_y - 12
inicia_menu
refresh
end
#--------------------------------------------------------------------------
# Atualiza o objeto
#--------------------------------------------------------------------------
def update
super
refresh
end
#--------------------------------------------------------------------------
# Atualiza o objeto
#--------------------------------------------------------------------------
def refresh
self.contents.clear
case @modo
when ModoIni
refresh_inicio
when ModoEsp
refresh_espera
when ModoMD
refresh_mover(1)
when ModoME
refresh_mover(0)
end
sw = self.contents.width
rect = Rect.new((@cx - ((sw-32)/2))+12, @cy - 40, sw-32, 32)
self.contents.draw_text(rect, @item_name[@indice],1)
end
#--------------------------------------------------------------------------
# Abre o menu
#--------------------------------------------------------------------------
def refresh_inicio
d1 = 2.0 * Math::PI / @item_max
d2 = 1.0 * Math::PI / DurIni
r = RaioAnel - 1.0 * RaioAnel * @passos / DurIni
for i in 0...@item_max
j = i - @indice
d = d1 * j + d2 * @passos
x = @cx + ( r * Math.sin( d ) ).to_i
y = @cy - ( r * Math.cos( d ) ).to_i
desenha_item(x, y, i)
end
@passos -= 1
if @passos < 1
@modo = ModoEsp
end
end
#--------------------------------------------------------------------------
# Atualiza o menu
#--------------------------------------------------------------------------
def refresh_espera
d = 2.0 * Math::PI / @item_max
for i in 0...@item_max
j = i - @indice
x = @cx + ( RaioAnel * Math.sin( d * j ) ).to_i
y = @cy - ( RaioAnel * Math.cos( d * j ) ).to_i
desenha_item(x, y, i)
end
end
#--------------------------------------------------------------------------
# Movimenta o menu
#--------------------------------------------------------------------------
def refresh_mover(modo)
d1 = 2.0 * Math::PI / @item_max
d2 = d1 / DurMov
d2 *= -1 if modo != 0
for i in 0...@item_max
j = i - @indice
d = d1 * j + d2 * @passos
x = @cx + ( RaioAnel * Math.sin( d ) ).to_i
y = @cy - ( RaioAnel * Math.cos( d ) ).to_i
desenha_item(x, y, i)
end
@passos -= 1
if @passos < 1
@modo = ModoEsp
end
end
#--------------------------------------------------------------------------
# Desenha o icone
#--------------------------------------------------------------------------
def desenha_item(x, y, i)
if @indice == i
self.cursor_rect.set(x-4, y-4, 32, 32)
draw_icon(@item_icon, x, y, @item_hab)
else
draw_icon(@item_icon, x, y, @item_hab)
end
end
#--------------------------------------------------------------------------
# Inicia o menu
#--------------------------------------------------------------------------
def inicia_menu
@modo = ModoIni
@passos = DurIni
if SE_Inicio != nil and SE_Inicio != ""
Audio.se_play("Audio/SE/" + SE_Inicio, 80, 100)
end
end
#--------------------------------------------------------------------------
# Gira o menu
#--------------------------------------------------------------------------
def girar(modo)
if modo == ModoMD
@indice -= 1
@indice = @item_hab.size - 1 if @indice < 0
elsif modo == ModoME
@indice += 1
@indice = 0 if @indice >= @item_hab.size
else
return
end
@modo = modo
@passos = DurMov
end
end
#==============================================================================
# Scene_Title
#------------------------------------------------------------------------------
# Faz modifica??es nescessarias para a exibi??o do nome do mapa
#==============================================================================
class Scene_Title
alias load_database_old load_database
def load_database
load_database_old
$data_mapinfo = load_data("Data/MapInfos.rvdata")
end
end
#==============================================================================
# Window_Local
#------------------------------------------------------------------------------
# Cria a janela responsavel pela exibi??o do nome do mapa
#==============================================================================
class Window_Local < Window_Base
#--------------------------------------------------------------------------
# Inicia o objeto
#--------------------------------------------------------------------------
def initialize(x, y)
super(x, y, 160, 96)
refresh
end
#--------------------------------------------------------------------------
# Atualiza o objeto
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, "Local:")
self.contents.font.color = system_color
self.contents.draw_text(4, 32, 120, 32, $data_mapinfo[$game_map.map_id].name, 2)
end
end
2.Cheat system öffnen
Ich möchte das mein Cheatsystem mit "§/°" aufegeht...
3. Caterpillar
Gibt es einen funktionierenden Caterpillar für das Requiem ABS 5?
Nicht die neueren Requem versionen... die sind schrott
o.O Ist es net ein BUMP nach 24H ???...
Sorry...
Währe schön wenn du noch näher drauf ein gehen kannst denn... ich hab keine ahnung wie ich nun die taste § als öffnungs taste nehmen kann im Common Event...
Hab schon n Input Script
#==============================================================================
# Input Module
#==============================================================================
module Input
Mouse_Left = 1
Mouse_Right = 2
Mouse_Middle = 4
Back = 8
Tab = 9
Enter = 13
Shift = 16
Ctrl = 17
Alt = 18
CapsLock = 20
Esc = 27
Space = 32
PGUP = 33
PGDN = 34
End = 35
Home = 36
Left = 37
Up = 38
Right = 39
Down = 40
PrintScreen = 44
Insert = 45
Delete = 46
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
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
LWin = 91
RWin = 92
Apps = 93
Numberpad = {}
Numberpad[0] = 96
Numberpad[1] = 97
Numberpad[2] = 98
Numberpad[3] = 99
Numberpad[4] = 100
Numberpad[5] = 101
Numberpad[6] = 102
Numberpad[7] = 103
Numberpad[8] = 104
Numberpad[9] = 105
Multiply = 106
Add = 107
Subtract = 109
Decimal = 110
Divide = 111
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
NumLock = 144
ScrollLock = 145
LShift = 160
RShift = 161
LControl = 162
RControl = 163
LAlt = 164
RAlt = 165
Collon = 186
Equal = 187
Comma = 188
Underscore = 189
Dot = 190
Backslash = 191
Uncle = 192
LB = 219
Bar = 220
RB = 221
Quote = 222
@time = Array.new(256, 0)
@press = Array.new(256, false)
@trigger = Array.new(256, false)
@repeat = Array.new(256, false)
@release = Array.new(256, false)
@dirs = [0, 0]
InputInitialize = Win32API.new("Input", 'InputInitialize', 'LLLLLL', '')
InputUpdate = Win32API.new("Input", 'InputUpdate', '', '')
REG_KVALUES = {0=>32,1=>13,2=>27,3=>96,4=>16,5=>90,6=>88,7=>67,8=>86,9=>66,
10=>65,11=>83,12=>68,13=>81,14=>87}
DEFAULT_KEYS = {11=>[16,90],12=>[27,88,96],13=>[13,32],14=>[65],15=>[83],
16=>[68],17=>[81],18=>[87]}
def convert_keys(key)
begin
keys = []
rkey = 'HKEY_CURRENT_USER\\Software\\Enterbrain\\RGSS'
data = Registry.read_entry(rkey, 'ButtonAssign')[10, 25].scan(/./)
15.times {|i| keys.push(REG_KVALUES[i]) if key == data[i].unpack('C')[0]}
keys
rescue
DEFAULT_KEYS[key] rescue []
end
end
module_function :convert_keys
LEFT = 37
UP = 38
RIGHT = 39
DOWN = 40
A = convert_keys(11)
B = [45] + convert_keys(12)
C = convert_keys(13)
X = convert_keys(14)
Y = convert_keys(15)
Z = convert_keys(16)
L = [33] + convert_keys(17)
R = [34] + convert_keys(18)
SHIFT = 16
CTRL = 17
ALT = 18
F5 = 116
F6 = 117
F7 = 118
F8 = 119
F9 = 120
InputInitialize.call(@time.object_id, @press.object_id, @trigger.object_id,
@repeat.object_id, @release.object_id, @dirs.object_id)
def self.update
InputUpdate.call
end
def self.trigger?(id)
@trigger.indexes(*id.to_a).include?(true)
end
def self.press?(id)
@press.indexes(*id.to_a).include?(true)
end
def self.triggerd?(what)
if triggered.include?(what)
return true
end
end
def self.triggered
array = Array.new
@trigger.each_index {|i| array.push(i) if @trigger[i]}
array
end
def self.pressed?(what)
if pressed.include?(what)
return true
end
end
def self.pressed
array = Array.new
@press.each_index {|i| array.push(i) if @press[i]}
array
end
def self.repeat?(id)
@repeat.indexes(*id.to_a).include?(true)
end
def self.repeated
array = Array.new
@repeat.each_index {|i| array.push(i) if @repeat[i]}
array
end
def self.release?(id)
@release.indexes(*id.to_a).include?(true)
end
def self.released
array = Array.new
@release.each_index {|i| array.push(i) if @release[i]}
array
end
def self.dir4
@dirs[0]
end
def self.dir8
@dirs[1]
end
KEYS_NAMES = {1=>'Mouse Left',2=>'Mouse Right',3=>'Cancel',
4=>'Mouse Middle',5=>'Mouse 4th',6=>'Mouse 5th',8=>'Backspace',9=>'Tab',
12=>'Clear',13=>'Enter',16=>'Shift',17=>'Control',18=>'Alt',19=>'Pause',
20=>'Capitals Lock',21=>'Kana',23=>'Junja',24=>'Final',25=>'Kanji',
27=>'Escape',28=>'Convert',29=>'Non Convert',30=>'Accept',31=>'Mode Change',
32=>'Space',33=>'Page Up',34=>'Page Down',35=>'End',36=>'Home',37=>'Left',
38=>'Up',39=>'Right',40=>'Down',41=>'Select',42=>'Print',43=>'Execute',
44=>'PrintScreen',45=>'Insert',46=>'Delete',47=>'Help',48=>'0',49=>'1',50=>'2',
51=>'3',52=>'4',53=>'5',54=>'6',55=>'7',56=>'8',57=>'9',65=>'A',66=>'B',
67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',
76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',
85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'Left Windows',
92=>'Right Windows',93=>'Application',95=>'Sleep',96=>'PAD 0',97=>'PAD 1',
98=>'PAD 2',99=>'PAD 3',100=>'PAD 4',101=>'PAD 5',102=>'PAD 6',103=>'PAD 7',
104=>'PAD 8',105=>'PAD 9',106=>'*',107=>'+',108=>'Separator',109=>'-',110=>'.',
111=>'/',112=>'F1',113=>'F2',114=>'F3',115=>'F4',116=>'F5',117=>'F6',118=>'F7',
119=>'F8',120=>'F9',121=>'F10',122=>'F11',123=>'F12',124=>'F13',125=>'F14',
126=>'F15',127=>'F16',128=>'F17',129=>'F18',130=>'F19',131=>'F20',132=>'F21',
133=>'F22',134=>'F23',135=>'F24',144=>'Number Lock',145=>'Scroll Lock',
146=>'OEM 15',147=>'OEM 16',148=>'OEM 17',149=>'OEM 18',150=>'OEM 19',
160=>'Left Shift',161=>'Right Shift',162=>' Left Control',163=>'Right Control',
164=>' Left Alt',165=>'Right Alt',166=>'Browser Back',167=>'Browser Forward',
168=>'Browser Refresh',169=>'Browser Stop',170=>'Browser Search',
171=>'Browser Favorites',172=>'Browser Home',173=>'Volume Mute',
174=>'Volume Down',175=>'Volume Up',176=>'Media Next Track',
177=>'Media Previous Track',178=>'Media Stop',179=>'Media Play Pause',
180=>'Launch Mail',181=>'Launch Media Select',182=>'Launch Application',
183=>'Launch Application',186=>'OEM 1',187=>'OEM 2',188=>'OEM 3',189=>'OEM 4',
190=>'OEM 5',191=>'OEM 6',192=>'OEM 7',219=>'OEM 8',220=>'OEM 9',221=>'OEM 10',
222=>'OEM 11',223=>'OEM 13',225=>'OEM 20',226=>'OEM 14',227=>'OEM 21',
228=>'OEM 22',229=>'Proccess',230=>'OEM 23',232=>'OEM 24',240=>'OEM 25',
241=>'OEM 26',242=>'OEM 27',243=>'OEM 28',244=>'OEM 29',245=>'OEM 30',
246=>'ATTN',247=>'CRSEL',248=>'EXSEL',249=>'EREOF',250=>'Play',251=>'Zoom',
253=>'PA1',254=>'OEM Clear'}
def self.name?(id)
return (KEYS_NAMES[id].nil? ? '???' : KEYS_NAMES[id])
end
end
#-----------------------------------------------------------------------------
module Registry
module_function
RegCloseKey = Win32API.new('advapi32', 'RegCloseKey', 'L', 'L')
RegOpenKeyExA = Win32API.new('advapi32', 'RegOpenKeyExA', 'LPLLP', 'L')
RegQueryValueExA = Win32API.new('advapi32', 'RegQueryValueExA','LPLPPP','L')
HKEYS = {'HKEY_CLASSES_ROOT' => 0x80000000,'HKEY_CURRENT_USER' =>0x80000001,
'HKEY_LOCAL_MACHINE' => 0x80000002, 'HKEY_USERS' => 0x80000003,
'HKEY_CURRENT_CONFIG' => 0x80000005}
def read_entry(key, entry)
key.sub!(/(.*?)\\/, '')
if HKEYS[$1] != nil
hkey = HKEYS[$1]
else
return nil
end
opened, type, size = [0].pack('V'), [0].pack('V'), [0].pack('V')
RegOpenKeyExA.call(hkey, key, 0, 131097, opened)
opened = (opened + [0].pack('V')).unpack('V')[0]
RegQueryValueExA.call(opened, entry, 0, type, 0, size)
data = ' ' * (size + [0].pack('V')).unpack('V')[0]
RegQueryValueExA.call(opened, entry, 0, type, data, size)
RegCloseKey.call(opened)
data = data[0, (size + [0].pack('V')).unpack('V')[0]]
type = (type += [0].pack('V')).unpack('V')[0]
case type
when 1
data.chop
when 2
data.chop.gsub(/%([^%]+)%/) { ENV[$1] || $& }
when 3
data
when 4
(data += [0].pack('V')).unpack('V')[0]
when 5
data.unpack('N')[0]
when 7
data.split(/\0/)
when 11
(data.unpack('VV')[1] << 32) | data[0]
else
nil
end
end
end
MFG TheBoy