[已解决]昨天的时间问题解决了,又产生一个新问题
本帖最后由 lnlyf 于 2011-12-16 08:11 编辑#include <GuiDateTimePicker.au3>
Local $vT = IniRead('vT.ini', 'TS', 'Default', '15:12')
GUICreate('设置启动时间', 200, 120, 500, 200)
$n = GUICtrlCreateDate($vT, 20, 20, 100, 20, $DTS_TIMEFORMAT)
$hn = GUICtrlGetHandle($n)
_GUICtrlDTP_SetFormat($hn, 'HH:mm')
$bt = GUICtrlCreateButton('确定', 20, 60, 65, 26)
GUISetState()
While 1
$Msg = GUIGetMsg()
Select
Case $Msg = -3
Exit
Case $Msg = $bt
$Input = GUICtrlRead($n)
$dayq = StringSplit($Input, ":")
$aDatepc = $dayq & $dayq
IniWrite('vT.ini', 'TS', 'Default', GUICtrlRead($n))
;MsgBox(0, '', $aDatepc)
Spqpc()
EndSelect
WEnd
Func Spqpc();收盘前清仓
GUISetState(@SW_HIDE)
While 2
tooltip(@HOUR&':'&@MIN&':'&@SEC,500,0,"收盘前清仓",0,0)
If @HOUR & @MIN = $aDatepc Then
WinActivate("雷凯投资期货交易")
SLEEP(200)
send("!q")
SLEEP(30000)
Exit
EndIf
WEnd
EndFunc
这样写CPU占用很大,高达100%,貌似不能用两个While ,请各位老大再帮忙看看,如何解决,谢谢了! 用adlibregister做,谁告诉你while 1套用了 用adlibregister做,谁告诉你while 1套用了
netegg 发表于 2011-12-15 17:01 http://www.autoitx.com/images/common/back.gif
初学AU3,想当然了,汗 #include <GuiDateTimePicker.au3>
Local $vT = IniRead('vT.ini', 'TS', 'Default', '15:12')
GUICreate('设置启动时间', 200, 120, 500, 200)
$n = GUICtrlCreateDate($vT, 20, 20, 100, 20, $DTS_TIMEFORMAT)
$hn = GUICtrlGetHandle($n)
_GUICtrlDTP_SetFormat($hn, 'HH:mm')
$bt = GUICtrlCreateButton('确定', 20, 60, 65, 26)
GUISetState()
While 1
$Msg = GUIGetMsg()
Select
Case $Msg = -3
Exit
Case $Msg = $bt
$Input = GUICtrlRead($n)
$dayq = StringSplit($Input, ":")
$aDatepc = $dayq & $dayq
IniWrite('vT.ini', 'TS', 'Default', GUICtrlRead($n))
;MsgBox(0, '', $aDatepc)
GUISetState(@SW_HIDE)
AdlibRegister('Spqpc', 500)
EndSelect
WEnd
Func Spqpc();收盘前清仓
ToolTip(@HOUR & ':' & @MIN & ':' & @SEC, 500, 0, "收盘前清仓")
If @HOUR & @MIN = $aDatepc Then
AdlibUnRegister()
WinActivate("雷凯投资期货交易")
Sleep(200)
Send("!q")
Sleep(30000)
Exit
EndIf
EndFunc ;==>Spqpc
解决了,afan 老大真强,太谢谢了!!! 本帖最后由 lnlyf 于 2011-12-16 00:12 编辑
afan 发表于 2011-12-15 17:30 http://www.autoitx.com/images/common/back.gif
老大,如何在窗口的空白处加字呢,比如按钮或时间框的上面,再次请教。 GUICtrlCreateLabel() 看来新手变多了,版主有点忙
sliqi 发表于 2011-12-16 01:43 http://www.autoitx.com/images/common/back.gif
afan版主是大好人,非常感谢他的帮助! 已经实现了如下的效果,这个外挂的功能只实现了一半,还有一半对新手来说非常艰难,不知能不能做出来了。 本贴的问题已解决,再次感谢afan版主和其他老大的帮助! 怎么解决的,方法呢楼主 怎么解决的,方法呢楼主
sgj584520 发表于 2011-12-16 08:13 http://www.autoitx.com/images/common/back.gif
方法不是都在贴子里吗。。。 不好意思刚才没有显示出来网速问题 谢谢分享。
页:
[1]