Jump to content
Tripoz

How to make This script better ?

Recommended Posts

Tripoz

hi guys,

i have code to capture some Number (live action) from another website..i got help from this members too for some code.

but the code r too heavy..its cant do anything else..

how can i fixed it to become more simply or lighlty so i can make another "Loop" or another Func to run.

thx

here's the code:

#include <WinHTTP.au3>
#include <ButtonConstants.au3>
#include <MsgBoxConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>

Global $hSession = _WinHttpOpen()
Global $hConnect = _WinHttpConnect($hSession, "www.binary.com", 443)
Global $hRequest = _WinHttpSimpleSendSSLRequest($hConnect, 'GET', '/push/price/T_CALL_R-50_5t_S0P_c_USD_EN')
If @error Then Exit

_WinHttpReceiveResponse($hRequest)

#Region ### START Koda GUI section ### Form=C:\Users\Marcellino\Downloads\koda_1.7.3.0\Forms\project Pakdhe.kxf
$Form1 = GUICreate("Macro Martandang's Methode v.1", 349, 280, 192, 124)
$Group1 = GUICtrlCreateGroup(" Random Market ", 176, 48, 161, 49)
$Random = GUICtrlCreateCombo("R.100", 184, 64, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "R.25|R.50|R.75|R.Bear|R.Bull|R.Yang|R.Yin")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("  Method  ", 8, 8, 161, 137)
$Radio_Ujung = GUICtrlCreateRadio("Metode Ujung", 24, 56, 113, 17)
$Radio_Locking = GUICtrlCreateRadio("Metode Locking", 24, 32, 113, 17)
$Radio_Lambung = GUICtrlCreateRadio("Metode Lambung", 24, 80, 113, 17)
GUICtrlSetState($Radio_Lambung, $GUI_CHECKED)
$Radio_Cantik = GUICtrlCreateRadio("Metode Cantik", 24, 104, 113, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("  Stake  ", 176, 96, 161, 49)
$Label1 = GUICtrlCreateLabel("Stake :", 184, 116, 38, 17)
$InputStake = GUICtrlCreateInput("5", 228, 112, 73, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_CENTER, $ES_NUMBER))
$Label2 = GUICtrlCreateLabel("$", 311, 116, 10, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group4 = GUICtrlCreateGroup("  Martingale  ", 176, 8, 161, 41)
$Radio5 = GUICtrlCreateRadio("YES", 192, 24, 41, 17)
$Radio6 = GUICtrlCreateRadio("NO", 290, 24, 41, 17)
GUICtrlSetState($Radio6, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group5 = GUICtrlCreateGroup("  Barrier  ", 8, 152, 329, 49)
$Label3 = GUICtrlCreateLabel("High Barrier :", 16, 173, 65, 17)
$Label4 = GUICtrlCreateLabel("Low Barrier :", 190, 173, 63, 17)
$Input2 = GUICtrlCreateInput("-1.30000", 256, 168, 65, 21)
$Input1 = GUICtrlCreateInput("+1.30000", 82, 168, 73, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group5 = GUICtrlCreateGroup("  SPOT PRICE  ", 8, 202, 329, 39)
$Label4 = GUICtrlCreateLabel("SPOT  :", 96, 220, 65, 17)
$Label5 = GUICtrlCreateLabel("", 146, 210, 105, 27, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetFont(-1, 16, 800, 0, "Hobo Std")
GUICtrlSetBkColor(-1, 0x0000FF)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("&RUN", 8, 248, 99, 25)
$Button2 = GUICtrlCreateButton("STOP", 120, 248, 107, 25)
$Button3 = GUICtrlCreateButton("EXIT", 240, 248, 99, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

AdlibRegister(_SpotRefresh, 500)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE, $Button3
            End()
        Case $Radio_Ujung
            If GUICtrlRead($Radio_Ujung) = $GUI_CHECKED Then GUICtrlSetState($Input1, $GUI_DISABLE)
        Case $Radio_Cantik
            If GUICtrlRead($Radio_Cantik) = $GUI_CHECKED Then GUICtrlSetState($Input1, $GUI_ENABLE)
    EndSwitch
WEnd


Func _SpotRefresh()
    If _WinHttpQueryDataAvailable($hRequest) Then
        $s_Response = _WinHttpReadData($hRequest, 0, @extended)
        If Not @error Then
            Local $a_RegEx = StringRegExp($s_Response, 'spot":"(\d+\.\d+)', 1)
            If Not @error Then GUICtrlSetData($Label5, $a_RegEx[0])
        EndIf
    EndIf
EndFunc   ;==>_SpotRefresh

Func End()
    _WinHttpCloseHandle($hRequest)
    _WinHttpCloseHandle($hConnect)
    _WinHttpCloseHandle($hSession)
EndFunc   ;==>End

 

Share this post


Link to post
Share on other sites
CaptainSparky

There's somewhere around Autoit Forums that mentions this.

General Help and Support is not where you post your scripts and ask other members to make it better or do the work for you, General Help and Support is where you post a question or a problem that you are currently facing, but beware because there might already exist a similar thread which already contains the answer for your question, so please search Autoit's forum before you post.


Hello.

If in someway I have helped, please consider liking my post(s).

The formula for the right answer: You + Right Question = Answer

(Think) BEFORE you post.

Share this post


Link to post
Share on other sites
Tripoz

@CaptainSparky

sorry for the words,

but i want to asking coz i got a problem (heavy running) n how to make it lighter so i can make another function in my program.

its still not allowed?

Share this post


Link to post
Share on other sites
Jos

There's somewhere around Autoit Forums that mentions this.

​There is also a topic called Wannabee Mods ... maybe you should read that?

The OP asks for pointers on how he can fix the script not if you can do it for him.

Jos

hi guys,

i have code to capture some Number (live action) from another website..i got help from this members too for some code.

but the code r too heavy..its cant do anything else..

how can i fixed it to become more simply or lighlty so i can make another "Loop" or another Func to run.​


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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

×