【脚本】伪·文字输入框 Ver1.1〖免dll免exe兼容VX〗
伪·文字输入框——Defanive
更新 Version 1.1 :
修正了窗口进程被杀导致的游戏卡死
现在的输入法都不怎么方便用,而且还要附带一些DLL和EXE,用起来实在麻烦。。。
利用MsHta弄了个伪劣假冒的文字输入框。。。
话说本来只有5行核心代码的,结果问题太多了,一加代码就多起来。。。
10s问题耗了我5行左右,结果编码问题又浪费了好多时间。。。
目前提示信息不支持中文,但返回信息支持中文。。。
足够了。。。
最新测试:
本脚本兼容VX,只需将55行Graphics.update删去即可
贴图预览:
http://bbs.66rpg.com/upload_program/d/Defanive_p1_119374501.jpg
http://bbs.66rpg.com/upload_program/d/Defanive_p2_119374633.jpg
http://bbs.66rpg.com/upload_program/d/Defanive_p3_119374664.jpg
#==============================================================================# # ■ Code_Input
#
#------------------------------------------------------------------------------
#
# 伪·文字输入框Version 1.1
#
#==============================================================================
#==============================================================================
#
# 伪·文字输入框
# —— By Defanive
#
# 能够弹出一个InputBox窗口,输入完成后返回值
#
# Version 1.1 修正:
# 防止窗口进程被杀导致的游戏卡死
#
# 目前的缺陷:
# input参数不支持中文
#
#------------------------------------------------------------------------------
#
# 使用:
# 变量 = Input(提示, 标题, 默认值)
#
#==============================================================================
#==============================================================================
# API Functions
#==============================================================================
Shell=Win32API.new('kernel32','WinExec','pl','l')
M2w=Win32API.new('kernel32','MultiByteToWideChar','ilpipi','i')
W2m=Win32API.new('kernel32','WideCharToMultiByte','ilpipipp','i')
Find=Win32API.new('user32','FindWindowA','p,p','l')
IsWnd=Win32API.new('user32','IsWindow','l','l')
#==============================================================================
# Main Function
#==============================================================================
def input(text,title,strs)
tdir=Dir.getwd+"/input.tmp"
sname='mshta vbscript:createobject("scripting.filesystemobject").opentextfile("'+tdir+'",2,True).write(inputbox("'+text+'","'+title+'","'+strs+'"))(window.close)'
Shell.call(sname,1)
sleep(1)
hw=Find.call(nil,title)
while true
Graphics.update
break if IsWnd.call(hw)==0
end
s=text_conv(File.open(tdir).read)
return s
end
#==============================================================================
# Convert Function
#==============================================================================
def text_conv(text)
len=M2w.call(0,0,text,-1,nil,0)
buf="\0"*(len*2)
M2w.call(0,0,text,-1,buf,buf.size/2)
len=W2m.call(65001,0,buf,-1,nil,0,nil,nil)
ret="\0"*len
W2m.call(65001,0,buf,-1,ret,ret.size,nil,nil)
return ret
end
需要使用时 变量 = Input(提示, 标题, 默认值)
具体参考Ver1.1范例:
XP:http://bbs.66rpg.com/upload_program/d/Defanive_Code_Input_Ver1.1_119447684.rar
VX:http://bbs.66rpg.com/upload_program/d/Defanive_Code_Input_Ver1.1_119449275.rar VX还会有编码问题么。。。
正在制作中。。。 VX中直接有`notepad.exe`会出错吗?
我这边是Vista,XP的帮忙测试下。。。 这个好~接近真实 想不到直接将代码复制过去VX也能运行。。。
语法没多大变化啊。。。
页:
[1]