Jump to content

auto refresh script for Metastock needs correction


bharatk8
 Share

Recommended Posts

Hi

I reproduce script for auto refreshing Metastock charting software.Please suggest correction as it is not working.

AutoItSetOption("WinTitleMatchMode", 1)

WinWaitActive("MetaStock Professional")

For $i = 10 to 1 Step -1

sleep(10000)

Send("!fgN")

Next

Pl. help

Link to comment
Share on other sites

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

We're going to need more info.

Have you tried WinMenuSelectItem? If the app supports it, it would be more reliable than Send.

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Link to comment
Share on other sites

  • 3 weeks later...

Hi

i need start/stop control with any key stroke or mouse click without limit of 10

Pl. suggest changes.

Bharat

.

We're going to need more info.

Have you tried WinMenuSelectItem? If the app supports it, it would be more reliable than Send.

Link to comment
Share on other sites

I'm new but here's an attempt to help:

HotKeySet("{F1}", "_Start")
HotKeySet("{F2}", "_Stop")
HotKeySet("{F3}", "_Close")

$pause = 0

;##Main##;
TrayTip("Status","ON; F1 to start.", 2)
While 1
    Sleep(1000)
WEnd



;##Functions##;

Func _Start()
    While 1
        ; DO STUFF HERE
    WEnd
EndFunc


Func _Stop()
    $Pause = NOT $Pause
    TrayTip("Status","Script is paused.",1)
    While $Pause
        Sleep(1000)
    WEnd
EndFunc


Func _Close()
    TrayTip("Status","OFF",3)
    Exit
Endfunc

And about the limit of 10...

"For $i = 10 to 1 Step -1"

Change your for loop to a while loop or something.

Not sure what you're trying to do exactly but this was my best guess.

Edited by Flam
Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

$dongu = 7200;
$sure = 5
Local $cevap1 = InputBox("MetaStock Auto Refresh", "Kaç Periyod Dönsün ?", $dongu);
Local $cevap2 = InputBox("MetaStock Auto Refresh", "Kaç Saniyede bir yenilensin ?", $sure);

if ($cevap1 == "" AND $cevap2 == "") Then
   MsgBox(0, "", "Tüm alanları doldurmak zorundasınız. Program Sonlandırıldı")  
   Exit
Else
   MsgBox(1,"MetaStock Auto Refresh",$cevap2 & " saniyede bir yenilemek üzere çalışmaya başladı...",2);
  
   For $i = $cevap1 To 1 Step -1
   WinWaitActive("[CLASS:MetaStockMainWnd]", "")
   WinMenuSelectItem("[CLASS:MetaStockMainWnd]", "", "&View", "&Refresh Data" )
   Sleep($cevap2*1000);
   Next
   MsgBox(0, "MetaStock Auto Refresh", "Program Sonlandırıldı");
   Exit
EndIf;

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...