软件简介
飞狐软件交易小脚本代码(供参考)
初学脚本技术,资源来自网络,请老师们别拍砖,谢谢!
?不合适的,请各位老师帮俺改改,先谢过了!
?
?
C/C++ Code复制内容到剪贴板
- #Region? ??
- #EndRegion? ??
- #include? ??
- ?#include? ??
- ?#include? ??
- ?#include? ??
- ?Opt("GUIOnEventMode",?1) ??
- ?#Region?###?START?Koda?GUI?section?###?Form= ??
- ?$Form1?=?GUICreate("联",?40,?80,?292,?224,?-1,?BitOR($WS_EX_TOOLWINDOW,?$WS_EX_TOPMOST,?$WS_EX_WINDOWEDGE)) ??
- ?GUISetOnEvent($GUI_EVENT_CLOSE,?"Form1Close") ??
- ? ??
- $Button1?=?GUICtrlCreateButton("联动",?2,?2,?36,?18,?$WS_GROUP) ??
- ?GUICtrlSetOnEvent(-1,?"Button1Click") ??
- ?GUICtrlSetColor(-1,?0xFFFFF) ??
- ?GUICtrlSetBkColor(-1,?0x000000) ??
- ? ??
- $Button2?=?GUICtrlCreateButton("闪买",?2,22,?36,?18,?$WS_GROUP) ??
- ?GUICtrlSetOnEvent(-1,?"Button2Click") ??
- ?GUICtrlSetColor(-1,?0xFFFFF) ??
- ?GUICtrlSetBkColor(-1,?0xFF0000) ??
- ? ??
- $Button3?=?GUICtrlCreateButton("闪卖",?2,42,?36,?18,?$WS_GROUP) ??
- ?GUICtrlSetOnEvent(-1,?"Button3Click") ??
- ?GUICtrlSetColor(-1,?0xF00FF) ??
- ?GUICtrlSetBkColor(-1,?0x00FF00) ??
- ? ??
- $Button4?=?GUICtrlCreateButton("撤单",?2,62,?36,?18,?$WS_GROUP) ??
- ?GUICtrlSetOnEvent(-1,?"Button4Click") ??
- ?GUICtrlSetColor(-1,?0xFFFFF) ??
- ?GUICtrlSetBkColor(-1,?0x0000FF) ??
- ? ??
- GUISetState(@SW_SHOW) ??
- ?#EndRegion?###?END?Koda?GUI?section?## ??
- ?Global?$sss ??
- ?While?1 ??
- ??????????$BT=ControlGetText?("阳光股道?-?",?"",?65281?) ??
- ??????????$sss=StringRegExp($BT,'\d{6}',1)???????? ??
- ??????????Sleep(50) ??
- ?????????? ??
- ?WEnd ??
- ? ??
- Func?Button1Click() ??
- ?If?WinExists("[CLASS:TdxW_MainFrame_Class]")?Then ??
- ??????????WinActivate("[CLASS:TdxW_MainFrame_Class]") ??
- ??????????Send($sss[0]) ??
- ??????????Sleep(100) ??
- ??????????Send("{ENTER}")???????? ??
- ?Else???????? ??
- ???????????MsgBox(0,?"",?"通达信没打开") ??
- ?EndIf ??
- ?EndFunc ??
- ? ??
- Func?Button2Click() ??
- ?If?WinExists("[CLASS:TdxW_MainFrame_Class]")?Then ??
- ??????????WinActivate("[CLASS:TdxW_MainFrame_Class]") ??
- ??????????Send($sss[0]) ??
- ??????????Sleep(100) ??
- ??????????Send("{ENTER}")???????? ??
- ??????????Send("21") ??
- ??????????Sleep(100) ??
- ??????????Send("{ENTER}")? ??
- Else???????? ??
- ???????????MsgBox(0,?"",?"通达信没打开") ??
- ?EndIf ??
- ?EndFunc ??
- ? ??
- Func?Button3Click() ??
- ?If?WinExists("[CLASS:TdxW_MainFrame_Class]")?Then ??
- ??????????WinActivate("[CLASS:TdxW_MainFrame_Class]") ??
- ??????????Send($sss[0]) ??
- ??????????Sleep(100) ??
- ??????????Send("{ENTER}")???????? ??
- ??????????Send("23") ??
- ??????????Sleep(100) ??
- ??????????Send("{ENTER}")? ??
- Else???????? ??
- ???????????MsgBox(0,?"",?"通达信没打开") ??
- ?EndIf ??
- ?EndFunc ??
- ? ??
- Func?Button4Click() ??
- ?If?WinExists("[CLASS:TdxW_MainFrame_Class]")?Then ??
- ??????????WinActivate("[CLASS:TdxW_MainFrame_Class]") ??
- ??????????Send($sss[0]) ??
- ??????????Sleep(100) ??
- ??????????Send("{ENTER}")???????? ??
- ??????????Send("22") ??
- ??????????Sleep(100) ??
- ??????????Send("{ENTER}")? ??
- Else???????? ??
- ???????????MsgBox(0,?"",?"通达信没打开") ??
- ?EndIf ??
- ?EndFunc ??
- ? ??
- Func?Form1Close() ??
- ??????????exit ??
- ?EndFunc ??
?
说明