|
今天在源码区,找了一源码如下:
HotKeySet("{F9}","myStar")
HotKeySet("{F11}","myStop")
Opt("TrayAutoPause",0)
Opt("TrayOnEventMode",1)
Dim $CdHawdS
#include <GUIConstants.au3>
$say = IniRead("Mysay.ini", "NuSay", "say", "")
$Name = IniRead("Mysay.ini", "NuSay", "Name", "")
$Time = IniRead("Mysay.ini", "NuSay", "Time", "")
#Region ### START Koda GUI section ### Form=d:\工具\autoit3编程工具\auto3\scite\koda\forms\自动发密语.kxf
$Win = GUICreate("自动发言 制作:稻田守望者", 427, 126, 300, 400)
$Label1 = GUICtrlCreateLabel("发言内容:", 8, 37, 69, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
$Input1 = GUICtrlCreateInput($say, 80, 35, 337, 21)
GUICtrlSetColor(-1, 0x0000FF)
$CdSave = GUICtrlCreateButton("保存设置", 224, 93, 75, 25, 0)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$CdExit = GUICtrlCreateButton("退出", 328, 93, 75, 25, 0)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label3 = GUICtrlCreateLabel("热键:F9<开始> F11<中止>", 24, 99, 184, 17)
GUICtrlSetColor(-1, 0x800080)
$Label2 = GUICtrlCreateLabel("游戏窗口名称:", 8, 10, 95, 14)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$Input2 = GUICtrlCreateInput($Name, 104, 8, 200, 21)
GUICtrlSetColor(-1, 0xFF0000)
$CdHawd = GUICtrlCreateButton("获取窗口名", 328, 6, 80, 25, 0)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label4 = GUICtrlCreateLabel("发密语间隔时间:", 8, 67, 108, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x008000)
$Input3 = GUICtrlCreateInput($Time, 115, 64, 60, 21)
GUICtrlSetColor(-1, 0x008000)
$Label5 = GUICtrlCreateLabel("秒", 185, 67, 30, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x008000)
$Checkbox1 = GUICtrlCreateCheckbox("使用自动复制/粘贴广告方法", 240, 65, 165, 17)
GUICtrlSetFont(-1, 9, 400, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0080C0)
$ACheckbox = IniRead("Mysay.ini", "NuSay", "ACheckbox", "")
If $ACheckbox=1 Then GUICtrlSetState($Checkbox1, $GUI_CHECKED)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
myStop()
Func myStop()
WinSetState($Win,"",@SW_RESTORE)
WinSetOnTop($Win,"",0)
If $CdHawdS=1 Then
TrayTip('自动发广告', '获取窗口名称完毕', 3)
$CdHawdS=0
Else
TrayTip('自动发广告', '程序处于中止状态,按热键"F9"启动', 3)
EndIf
While 1
$msg = GUIGetMsg()
If $msg = $CdExit Or $msg = $GUI_EVENT_CLOSE then
Exit
EndIf
if $msg=$CdSave then
$say= GUICtrlRead($Input1)
$Name= GUICtrlRead($Input2)
$Time= GUICtrlRead($Input3)
$ACheckbox=GUICtrlRead($Checkbox1)
IniWrite("Mysay.ini", "NuSay", "say", $say)
IniWrite("Mysay.ini", "NuSay", "Name", $Name)
IniWrite("Mysay.ini", "NuSay", "Time", $Time)
IniWrite("Mysay.ini", "NuSay", "ACheckbox", $ACheckbox)
EndIf
If $msg=$CdHawd Then
WinSetOnTop($Win,"",1)
$CdHawdS=1
While 1
TrayTip('自动发广告', '鼠标左键点击要获取的窗口或让要获取的窗口处于激活状态,然后按热键"F11"获取该窗口的名称。',20)
$Name=WinGetTitle("")
sleep(100)
If $Name<>"自动发广告 制作:≈※爖※≈" Then GUICtrlSetData($Input2,$Name)
WEnd
EndIf
WEnd
EndFunc
Func myStar()
WinSetState($Win,"",@SW_MINIMIZE)
TrayTip('自动发广告', '程序已启动,按热键"F11"中止', 3)
$begin = TimerInit()
$say = GUICtrlRead($Input1)
$Name = GUICtrlRead($Input2)
$Time = GUICtrlRead($Input3)
$ACheckbox = GUICtrlRead($Checkbox1)
If $ACheckbox=$GUI_CHECKED Then ClipPut($say) ;;ClipPut("数据") 向剪贴板写入数据
WinActivate($Name,"")
$i=1
While 1
$dif=TimerDiff($begin)
if $dif/1000>=$Time or $i=1 then
WinActivate($Name,"")
ControlSend($Name,"","","{Enter}")
Sleep(200)
If $ACheckbox=$GUI_CHECKED Then
ControlSend($Name,"","","^V",0)
EndIf
If $i=1 AND $ACheckbox<>$GUI_CHECKED Then
_SendUnicode($say)
ElseIf $i=2 AND $ACheckbox<>$GUI_CHECKED Then
ControlSend($Name,"","","{UP}")
EndIf
Sleep(500)
ControlSend($Name,"","","{Enter}")
Sleep(200)
$i=2
$begin = TimerInit()
EndIf
WEnd
EndFunc
Func _SendUnicode($string)
Local $char
Local $code
For $i = 1 to StringLen($string)
$char = StringMid($string, $i, 1)
$code = Asc($char)
If $code > 127 Then
$code = $code * 256
$i = $i + 1
$char = StringMid($string, $i, 1)
$code = $code + Asc($char)
EndIf
Send("{ASC " & $code & "}")
Next
EndFunc
把版权改了,以为就可以,可拿到别的电脑就用不了?
我是这样保存的--[文件F]--[文件另存为A]--[文件名N:xxx.au3]
请问要如何改xxx.au3后缀名?是不是我保存方法不对!还是源码有问题?
ps:不好意思,原作者我只是为了学习才把你源码改了的! |
|