Caine Luveno
15.11.2005, 18:46
Ich suche nach nem Mausscript für den RPGMaker XP.
Die Suchfunktion habe ich bereits verwendet und nix gefunden. Auch auf den Seiten der RMXP FAQ gab es keins.
Hat jemand von euch ne Ahnung wo ich (schnell) eins her kriege? Weil was Ruby angeht, naja, XP Anfänger halt....
Der Drake
15.11.2005, 20:21
#==============================================================================
# Mouse Script v1 created by: Cybersam, edited by Astro_mech
#==============================================================================
module Mouse
gsm = Win32API.new('user32', 'GetSystemMetrics', 'i', 'i')
@cursor_pos = Win32API.new('user32', 'GetCursorPos', 'p', 'i')
module_function
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(catch_anywhere = false)
x, y = screen_to_client(*mouse_global_pos)
width, height = client_size
if catch_anywhere or (x >= 0 and y >= 0 and x < width and y < height)
return x, y
else
return $m.x, $m.y
end
end
def del
if @oldcursor == nil
return
else
@SetClassLong.call(handel ,-12, @oldcursor)
@oldcursor = nil
end
end
end
$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 screen_to_client(x, y)
return nil unless x and y
pos = [x, y].pack('ll')
if $scr2cli.call(hwnd, pos) != 0
return pos.unpack('ll')
else
return nil
end
end
def hwnd
game_name = "\0" * 256
$readini.call('Game','Title','',game_name,255,".\\Game.ini")
game_name.delete!("\0")
return $findwindow.call('RGSS Player',game_name)
end
def client_size
rect = [0, 0, 0, 0].pack('l4')
$client_rect.call(hwnd, rect)
right, bottom = rect.unpack('l4')[2..3]
return right, bottom
end
Aber nur so ne kleine Frage am Rande: Wenn du kein Ruby kannst, was willst du dann damit? xD
Caine Luveno
16.11.2005, 18:02
Sagen wir mal so: Ich bin zu blöd sowas in Ruby selbst zu coden, einbinden kann ichs aber ;-) (hoffe ich zumindest, bei anderen Scripten z.B. SKS oder anderer Titelscreen ging das jedenfalls ganz gut ^^)
Aber danke fürs Script.
Powered by vBulletin® Version 4.2.3 Copyright ©2025 Adduco Digital e.K. und vBulletin Solutions, Inc. Alle Rechte vorbehalten.