懒人专用-自动生成安装脚本.au3

#include
#include
#include
#include
#include
#include
#include
#include

#Region ### START Koda GUI section ### Form=c:\documents and settings\administrator\桌面\form1.kxf

Local $Input1,$Input2,$Input3,$Input4,$Input5,$Input6,$Input7,$aaaa,$a,$Form1_1,$edit1,$Button1,$Button2,$Button3,$Label1,$yyyyy

main()

Func Main()

$Form1_1 = GUICreate("懒人专用-By:张永昌 QQ106182722 温馨提示:代码还是自己写的好。", 607, 480, 247, 279)
$Input1 = GUICtrlCreateInput("窗口标题", 16, 16, 577, 21)
$Input2 = GUICtrlCreateInput("窗口内可见文字内容", 16, 40, 577, 21)
$Input3 = GUICtrlCreateInput("5", 16, 64, 65, 21)
$Input4 = GUICtrlCreateInput("请输入进程.exe", 472, 64, 121, 21)
$Input5 = GUICtrlCreateInput("键盘指令1", 200, 64, 73, 21)
$Input6 = GUICtrlCreateInput("未开放指令", 280, 64, 73, 21)
$Input7 = GUICtrlCreateInput("鼠标指令1", 360, 64, 73, 21)
$edit1 = GUICtrlCreateEdit("", 16, 88, 577, 337)
$Button1 = GUICtrlCreateButton("生成代码", 32, 432, 113, 33)
$Button2 = GUICtrlCreateButton("保存代码", 240, 432, 113, 33)
$Button3 = GUICtrlCreateButton("关闭", 456, 432, 113, 33)
$Label1 = GUICtrlCreateLabel("超时5秒", 88, 64, 85, 20)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
;MsgBox(1,1,$Label1)
#EndRegion ### END Koda GUI section ###
While 1

$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button3
Exit
Case $Button1
If GUICtrlRead($Button1) = "生成exe" Then
_FileCreate("./temp.bak")
$yyyyy=_GUICtrlEdit_GetText($edit1)
_FileWriteToLine("./temp.bak",1,$yyyyy)
RunWait ("./ACNWrapper.exe /in ./temp.bak")

_FileCreate("./temp.bak") ;生成完代码清空临时文件
MsgBox(1,"生成完毕","恭喜您生成代码完毕了。去测试一下吧")
Else
shengcheng()
EndIf
Case $Button2
If GUICtrlRead($Button1) = "生成exe" Then

Else
_GUICtrlEdit_AppendText($edit1,"EndFunc")
$yyyyy=$yyyyy & "EndFunc"
GUICtrlSetData($Button1,"生成exe")
EndIf
EndSwitch
WEnd
EndFunc
Func aaaa()
GUICtrlSetData($Label1,"添加"& $a &"组代码")

GUICtrlSetData($Button1,"追加代码")
EndFunc ;改变按钮1的名字

Func shengcheng()
$a=$a+1
If $a<>0 Then aaaa()
$aaa="Main()" & @CRLF &"Func Main()" & @CRLF & "Run(""./" & GUICtrlRead($Input4) & """)" & @CRLF
$aaaa="$error=WinWaitActive(" & Chr(34) & GUICtrlRead($Input1)& Chr(34) &"," & Chr(34) & GUICtrlRead($Input2)& Chr(34) &","&GUICtrlRead($Input3)& ")" &";第"&$a&"组代码" &@CRLF
$bbbb="If $error <> 0 Then " &@CRLF
If GUICtrlRead($Input5) = "键盘指令1" Or GUICtrlRead($Input5) = Chr(0) Then
$cccc=""
Else
$cccc="Send("& Chr(34) &"!" &GUICtrlRead($Input5) & Chr(34) &") ;模拟按键"&@CR

LF
EndIf
If GUICtrlRead($Input7)= "鼠标指令1" Or GUICtrlRead($Input7) = Chr(0) Then
$dddd=""
Else
$dddd="ControlClick("& Chr(34) &GUICtrlRead($Input1) & Chr(34)&"," & Chr(34) & GUICtrlRead($Input2) & """,""[text:" & GUICtrlRead($Input7)&"]"");模拟鼠标点击"& @CRLF
EndIf
$eeee="$error=WinWaitNotActive("& Chr(34) & GUICtrlRead($Input1) & Chr(34)&"," & Chr(34) & GUICtrlRead($Input2)& """)"& ";等待失去焦点"&@CRLF _
&"else"&@CRLF _
&"RunWait(" & Chr(34) & "taskkill /im " &GUICtrlRead($Input4) &" /t /f"",@SW_HIDE)" &@CRLF _
& "Return"&@CRLF _
&"EndIf"&@CRLF
;&"ProcessClose("""&GUICtrlRead($Input4)&""")" &@CRLF _
If $a= 1 then
$xxxx=$aaa&$aaaa&$bbbb&$cccc&$dddd&$eeee
Else
$xxxx=$aaaa&$bbbb&$cccc&$dddd&$eeee
EndIf
_GUICtrlEdit_AppendText($edit1,$xxxx)
GUICtrlSetData($Input5,Chr(0))
GUICtrlSetData($Input7,Chr(0))

EndFunc
;edtEvent($edit1,2)
; 编辑框相关事件
; $edt : 要操作的编辑框句柄
; $Event : 要执行的操作(1-剪切;2-复制;3-粘贴)
Func edtEvent($edt, $Event)
Local $Text, $Len
Switch $Event
Case 1, 2
$Text = GUICtrlRead($edt)
If $Text = '' Then Return
ClipPut($Text)
If $Event = 1 Then GUICtrlSetData($edt, '')
$Len = StringLen($Text)
Case 3
$Text = ClipGet()
If $Text = '' Then Return
GUICtrlSetData($edt, $Text)
$Len = StringLen($Text)
EndSwitch
GUICtrlSetState($edt, $GUI_FOCUS)
_GUICtrlEdit_SetSel($edt, 0, $Len)
EndFunc ;==>edtEvent

相关文档
最新文档