Ex-Admin-Script
Age : 42 Inscrit le : 26/05/2008 Messages : 2360
| Sujet: Utiliser GETS dans VX Mer 14 Jan 2009 - 19:40 | |
| Je remercie Berka pour cette contribution. - Code:
-
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # Fonction gets Rgss2 # par berka #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Getkeystate=Win32API.new("user32","GetAsyncKeyState",'i','i') Getprivatestring=Win32API.new('kernel32','GetPrivateProfileString','pppplp','l') Findwindow=Win32API.new('user32','FindWindow','pp','i') Createwindow=Win32API.new("user32","CreateWindowEx",'lpplllllllll','l') Destroywindow=Win32API.new('user32','DestroyWindow','p','l') Getwindowtext=Win32API.new('user32','GetWindowText','npn','l') Getwindowrect=Win32API.new('user32','GetWindowRect','lp','i') Updatewindow=Win32API.new('user32','UpdateWindow','p','i') Setwindowtext=Win32API.new('user32','SetWindowText','pp','i') Showwindow=Win32API.new('user32','ShowWindow','ll','l') def handle title="\0"*256 Getprivatestring.call("Game","Title","",title,256,".//Game.ini") title.delete!("\0") return Findwindow.call("RGSS Player",title) end def gets (Destroywindow.call(@fen);@fen=nil;return) if !@fen.nil? @fen=Createwindow.call((0x00000100|0x00000200),'edit','',( (0x4000000|0x80000000|0)|0x02000000),dim[0],dim[3],dim[2]-dim[0],24,handle,0,0,0) Showwindow.call(@fen,1) res=" "*0x100 loop{Graphics.update;Updatewindow.call(@fen) break if Getkeystate.call(0x0D)&0x01==1 return if Getkeystate.call(0x74)&0x01==1} Getwindowtext.call(@fen,res,0x100) Destroywindow.call(@fen);@fen=nil return res.delete!("\0").gsub!(" "){""} end def dim rect=[0,0,0,0].pack('l4') Getwindowrect.call(handle,rect) x,y,w,h=rect.unpack('l4') return x,y,w,h end Vous placer ce code au même endroit que vous avez mis puts et voilà. VX supporte maintenant GETS. |
|