Jump to content

Site Verisi Takip Programı Konusunda Imleç Ve Hafıza Sorunu


x_files_x
 Share

Recommended Posts

Site verisi takip programı konusunda imleç ve hafıza sorunu

Merhaba arkadaşlar, hayırlı cumalar. Geçenlerde bir siteye süekli bakıp altın durumu filan takip ederken düşündüm acaba autoit ile ordaki html içinden o bilgiyi çekip masaüstümde gösterebilir miyim diye. Bişiler deneyip sonuç elde ettim lakin. program çalışırken sürekli imleçte bir hareketlilik söz konusu ve bundan dolayı kasıyor biraz da. autoit konusunda yardıma ihtiyacım var çünkü benim bilgim bu kadarına yetti. bir yerlerde yalnış kodlama var kesin. lütfen yardım ederseniz çok sevinirim. 

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;~ Opt("GUIOnEventMode", 1)
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Altın.in Fiyat Durumu", 325, 120, 592, 424)
$input = GUICtrlCreateInput("https://yorumlar.altin.in/tum/gram-altin", 52, 16, 150, 21)
$Link = GUICtrlCreateLabel("Link:", 12, 20, 42, 24)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x008080)

$yazi = GUICtrlCreateLabel("Altın Bu Değerin Altına Düşerse Bilgi Ver:", 8, 55, 250, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x008080)
$input2 = GUICtrlCreateInput("", 250, 50, 50, 25) ; beklenilen değer

$yazi3 = GUICtrlCreateLabel(":Anlık Altın Durumu", 78, 85, 150, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$edit = GUICtrlCreateInput("", 8, 80, 60, 25)


$Button1 = GUICtrlCreateButton("Takip", 240, 14, 40, 25)
$Button2 = GUICtrlCreateButton("Gizle", 285, 14, 35, 25)
GUISetState(@SW_SHOW)

$config_tray = TrayCreateItem("Menüyü Göster") ;ileti bu
TrayItemSetOnEvent(-1, "mms") ; görevi "mms" functionunu calýstýrmak

TrayCreateItem("")
$exit_tray = TrayCreateItem("        Çıkış")
TrayItemSetOnEvent(-1, "exxit")
TraySetState();---------------------------

$tiklanmis_mi = False

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1 ; butona başlat durdur ekle, tek butona çift görevde
			If $tiklanmis_mi = False Then ; butona tiklanilmismi degeri eger iptaldeyse yani, butona tiklanilmamissa
				$tiklanmis_mi = True ;butona tikla diyo
				ControlSetText($Form1,"",$Button1,"Durdur")

			ElseIf $tiklanmis_mi = True Then ;butona tiklanilmisssa
				$tiklanmis_mi = False ;butona tiklama diyo
				ControlSetText($Form1,"",$Button1,"Takip")
			EndIf

		case $Button2
			GUISetState(@SW_HIDE)


	EndSwitch

If $tiklanmis_mi = True Then ;başlat-durdur döngünün görevi
_oku() ;görev burda
	ElseIf $tiklanmis_mi = False Then ;başlat durdur  döngüsünde durdur görevi
ToolTip("")
	EndIf

WEnd

Func _oku()

$dll=DLlOpen("ntdll.dll") ;cpu azalt
_HighPrecisionSleep(100*2,$dll) ;cpu için

	Local $aArray = 0, _
		$iOffset = 1



Sleep(100) ;bekle
	$oku = InetRead(GUICtrlRead($input))
	$Data = BinaryToString($oku)
	$aArray = StringRegExp($Data, '(?i)"Gram Altın - Satış">(.*?)</li>', 1, $iOffset) ; "keywords": başlayış-----       ", bitiş
	If @error Then Exit
	$iOffset = @extended
ClipPut($aArray[0])
ControlSetText($Form1,"",$edit,$aArray[0])
ToolTip($aArray[0],0,0)
;~ Sleep(150);;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$deger = GUICtrlRead($input2)
If $aArray[0] < $deger Then
	MsgBox(64,"","")
EndIf
EndFunc


Func _HighPrecisionSleep($iMicroSeconds,$hDll=False) ;cpu
    Local $hStruct, $bLoaded
    If Not $hDll Then
        $hDll=DllOpen("ntdll.dll")
        $bLoaded=True
    EndIf
    $hStruct=DllStructCreate("int64 time;")
    DllStructSetData($hStruct,"time",-1*($iMicroSeconds*10))
    DllCall($hDll,"dword","ZwDelayExecution","int",0,"ptr",DllStructGetPtr($hStruct))
    If $bLoaded Then DllClose($hDll)
EndFunc


Func mms() ;func
	GUISetState(@SW_SHOW, $Form1)
EndFunc
Func exxit()
	Exit
EndFunc

 

Link to comment
Share on other sites

Extended, 11.05.2018 - 19:06 yazdı:

Bu tip veriler zaten HTML ile direk çekilmez.  Web servislerini kullanarak çekmeniz en mantıklısıdır.

Html ile direkt çektim onda sorun yok ancak, kodlamada hata var. çalıştırdığınız zaman fark edersiniz. imleç sürekli yenileme yapıyor

Link to comment
Share on other sites

Extended, Bir saat önce yazdı:

Denedim imleçte sıkıntı yok

mesela çalıştırıp takip et butonuna bastıktan sonra kapat butonu yada durdur butonuna bastıgınızda, hemen kapanmıyor, bunun önüne geçmek için sleep süresini azalttım ancak bu defada mouse imleci ikide bir işlem yapıyor, 

Link to comment
Share on other sites

  • 1 ay sonra...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...