The script used for stock trading is not retained for my work.

Source: Internet
Author: User

CopyCode The Code is as follows: # define global variables here
Dim digitimgs [10], digitimgs1 [10], digitimgs2 [10]
Function main
While true // execute the following code in an infinite loop
# Add the Code created or recorded by the wizard
Mouseleftbutton (917,665)
Wait (300)
Mouseleftbutton (836,293)
Wait (3000)
// ① Start copying the stock name
// Retrieve the coordinates of the window Origin
Getactivewindowxy (winx0, winy0)
// Press the left mouse button in the window coordinate (143,156)
Mousemove (winx0 + 143, winy0 + 156)
Mouseleftdown ()
Wait (300)
// Open the left mouse button in the window coordinate (81,160)
Mousemove (winx0 + 81, winy0 + 158)
Mouseleftup ()
Wait (200)
// Right-click the window coordinates (109,155)
Mousemove (winx0 + 109, winy0 + 155)
Mouserightclick ()
Wait (200)
Keypress ("C ")
Wait (200)
// Click the left mouse button at the screen coordinate (101,647)
Mouseleftbutton (101,647)
Wait (200)
// Right-click the screen coordinates (331,345)
Mouserightclick (331,345)
Wait (200)
Keypress ("p ")
Wait (200)
// In the window coordinate (602,512), click the left mouse button
Mousemove (winx0 + 318, winy0 + 249)
Mouseleftclick ()
Wait (200)
// ② Start copying the stock code
// In the window coordinate (109,106) double-click the left mouse button
Mousemove (winx0 + 109, winy0 + 106)
Mouseleftclick ()
Wait (200)
Mousemove (winx0 + 109, winy0 + 106)
Mouseleftclick ()
Wait (200)
// Right-click the window coordinates (111,105)
Mousemove (winx0 + 111, winy0 + 105)
Mouserightclick ()
Wait (100)
Keypress ("C ")
Wait (100)
// Click the left mouse button at the screen coordinate (109,645)
Mouseleftbutton (109,645)
Wait (100)
// Right-click the screen coordinates (351,380)
Mouserightclick (351,380)
Wait (100)
Keypress ("p ")
// ③ Start replication Diagnosis
Wait (100)
// Press the left mouse button in the window coordinate (528,300)
Mousemove (winx0 + 528, winy0 + 300)
Mouseleftdown ()
Wait (100)
// Open the left mouse button in the window coordinate (520,263)
Mousemove (winx0 + 520, winy0 + 263)
Mouseleftup ()
Wait (100)
// If the color of the window coordinate (111,290) is equal to (49,106,197 ),
If checkcolor (winx0 + 111, winy0 + 290, color (51, 94,168), 5) then
Wait (100)
Mousemove (winx0 + 111, winy0 + 290)
Mouserightclick ()
Keypress ("C ")
Else // otherwise
Beep (784,0319)
Beep (784,0160)
Beep (880,0284)
Beep (578,0421)
Beep (523,0478)
Beep (523,0239)
Beep (Listen, 0142)
Beep (578,0421)
Beep (784,0319)
Beep (784,0319)
Beep (880,0142)
Beep (20176, 0120)
Beep (880,0142)
Beep (784,0160)
Beep (523,0239)
Beep (fingerprint, 0284)
Beep (578,0421)
End if
Wait (100)
// ④ Modify the diagnostic symbol in the text
// In the screen coordinate (802, 77), click the left mouse button
Mouseleftclick (802, 77)
Wait (100)
Keydown ("Ctrl ")
Keypress ("v ")
Keypress ("H ")
Keypress ("space ")
Keyup ("Ctrl ")
Keypress (";")
Keypress ("tab ")
Keydown ("Ctrl ")
Keypress ("space ")
Keyup ("Ctrl ")
Keypress (";")
Keydown ("Alt ")
Keypress ("")
Keyup ("Alt ")
Keypress ("ESC ")
Keydown ("Ctrl ")
Keypress ("H ")
Keypress ("space ")
Keyup ("Ctrl ")
Keypress (",")
Keypress ("tab ")
Keydown ("Ctrl ")
Keypress ("space ")
Keyup ("Ctrl ")
Keypress (",")
Keydown ("Alt ")
Keypress ("")
Keyup ("Alt ")
Keypress ("ESC ")
Keydown ("Ctrl ")
Keypress ("")
Keypress ("X ")
Keyup ("Ctrl ")
// Click the left mouse button at the screen coordinate (106,630)
Mouseleftbutton (106,630)
Wait (100)
// Right-click the screen coordinates (381,492)
Mouserightclick (381,492)
Keypress ("p ")
Wait (100)
// Read the image file 0-9 to the array
LoadImage ("h1.sel", digitimgs [1])
LoadImage ("h2.sel", digitimgs [2])
LoadImage ("h3.sel", digitimgs [3])
LoadImage ("h4.sel", digitimgs [4])
LoadImage ("h5.sel", digitimgs [5])
LoadImage ("h6.sel", digitimgs [6])
LoadImage ("h7.sel", digitimgs [7])
LoadImage ("h8.sel", digitimgs [8])
LoadImage ("h9.sel", digitimgs [9])
LoadImage ("h0.sel", digitimgs [10])

LoadImage ("1.sel", digitimgs1 [1])
LoadImage ("2.sel", digitimgs1 [2])
LoadImage ("3.sel", digitimgs1 [3])
LoadImage ("4.sel", digitimgs1 [4])
LoadImage ("5.sel", digitimgs1 [5])
LoadImage ("6.sel", digitimgs1 [6])
LoadImage ("7.sel", digitimgs1 [7])
LoadImage ("8.sel", digitimgs1 [8])
LoadImage ("9.sel", digitimgs1 [9])
LoadImage ("0.sel", digitimgs1 [10])

LoadImage ("b1.sel", digitimgs2 [1])
LoadImage ("b2.sel", digitimgs2 [2])
LoadImage ("b3.sel", digitimgs2 [3])
LoadImage ("b4.sel", digitimgs2 [4])
LoadImage ("b5.sel", digitimgs2 [5])
LoadImage ("b6.sel", digitimgs2 [6])
LoadImage ("b7.sel", digitimgs2 [7])
LoadImage ("b8.sel", digitimgs2 [8])
LoadImage ("b9.sel", digitimgs2 [9])
LoadImage ("b0.sel", digitimgs2 [10])

// the function can only be defined outside the function, and then the call statement is used. The sequence of function definition does not matter:
myfunc () // call myfunc
wait (100)
// run the Program "D: \ Seraph exercise \ x.txt "
runapp (" D: \ Seraph exercise \ 1 \ x.txt ")
wait (800)

keydown ("Ctrl")
keypress ("A")
wait (100)
keypress ("X ")
keypress ("S")
keyup ("Ctrl")
// if the image "outputs the text icon. sel "appears
If findimageex (" output text icon. sel ", color (10, 10, 10), 372,356,928,710, true, foundx, foundy) Then
// (5, 5) on the Image) click
mouseleftclick (foundx + 5, foundy + 5)
end if
wait (100)
// on-screen coordinates (109,640) click the left mouse button
mouseleftclick (109,640)
// right-click the screen coordinate (343,443)
mouserightclick (343,443)
wait (600)
keypress ("p")
wait (100)
keypress ("Left")
keypress ("Left ")
keypress (". ")
keypress (" return ")
// wait for 2 milliseconds
wait (2000)
keypress (" return ")
// wait for 5 ms
wait (2000)
// click the left mouse button at the screen coordinate (910,654)
mouseleftclick (910,654)
wait (100)
keypress ("down")
// coordinates in the window (546, 57) click the left mouse button
mouseleftclick (winx0 + 546, winy0 + 57)

Wend // execute the above code in an infinite loop
End Function
Function myfunc
If readnumber (digitimgs, 974,523,101 7, 540, true, num) then
// If the read succeeds, the number is saved in the variable num.
Print ("find image" & num)
Writetexttofile ("x.txt", CSTR (Num), true)
Exit function // exit the function and run the subsequent script.
End if

// Identify the green number if it fails
If readnumber (digitimgs1, 974,523,101 7, 540, true, num) then
// If the read succeeds, the number is saved in the variable num.
Print ("find image" & num)
Writetexttofile ("x.txt", CSTR (Num), true)
Exit function // exit the function and run the subsequent script.
End if

// Continue to recognize white numbers if the task fails.
If readnumber (digitimgs2, 974,523,101 7, 540, true, num) then
// If the read succeeds, the number is saved in the variable num.
Print ("find image" & num)
Writetexttofile ("x.txt", CSTR (Num), true)
Exit function // exit the function and run the subsequent script.
End if
Do
// Alarm upon failure
Beep (784,0319)
Beep (784,0160)
Beep (880,0284)
Beep (578,0421)
Loop

End Function
# Add a subfunction here

This script has helped me spend nearly half a year.
although I don't need this script now, I will keep it for future commemorative purposes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.