Jump to content
Jimmy

Curs Valutar

Recommended Posts

De plictiseala am facut un script in autoit care iti trimite sms pe telefon cand EUR/USD/GBP a ajuns la o anumita valoare setata de tine.

1. Trebuie sa va face-ti cont pe smsglobal.

2. In acel input baga-ti de exemplu pt euro ”4.5” , cand ajunge euro la 4.5*** primi-ti sms.

3. Cine vrea poate sa adauge un timer, de exemplu sa verifice din 5 in 5 ore.

4. Pute-ti modifica sursa de exemplu cand primi-ti un anumit email primi-ti sms, cand ave-ti un mesaj nou pe facebook :)) , primi-ti sms...etc

5. Am gresit categoria , trebuia la programare :P.

capturw.png

#include <ButtonConstants.au3>#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <Inet.au3>
#include <String.au3>


$Valuta = GUICreate("Curs Valutar", 214, 210, 192, 124)
GUISetBkColor(0x008000)
$User = GUICtrlCreateInput("SMS_Global_User", 8, 15, 193, 21)
$Pass = GUICtrlCreateInput("SMS_Global_Pass", 8, 55, 193, 21)
$Phone = GUICtrlCreateInput("00407", 8, 95, 193, 21)
$EUR = GUICtrlCreateRadio("EUR", 16, 130, 41, 25)
$USD = GUICtrlCreateRadio("USD", 80, 130, 41, 25)
$GBP = GUICtrlCreateRadio("GBP", 152, 130, 49, 25)
$Value = GUICtrlCreateInput("0.0", 8, 172, 89, 20)
$Alert_me = GUICtrlCreateButton("Alert_me", 112, 170, 89, 25)
GUISetState(@SW_SHOW)


While 1
$Msg = GUIGetMsg()
Select
Case $Msg = $Alert_me
If GUICtrlRead($EUR) = 1 Then
GUISetState(@SW_HIDE)
TrayTip("", "Stau la panda", 5)
Sleep(5000)
_Eur()
EndIf


If GUICtrlRead($USD) = 1 Then
GUISetState(@SW_HIDE)
TrayTip("", "Stau la panda", 5)
Sleep(5000)
_Usd()
EndIf


If GUICtrlRead($GBP) = 1 Then
GUISetState(@SW_HIDE)
TrayTip("", "Stau la panda", 5)
Sleep(5000)
_Gbp()
EndIf
Case $Msg = $GUI_EVENT_CLOSE
Exit
EndSelect


WEnd


Func _Eur()
While True
$oIE = _IECreate("http://www.cursvalutar.ro/", 0, 0, 1)
_IELoadWait($oIE)
$HTML = _IEBodyReadHTML($oIE)
$Money = _StringBetween($HTML, '<td>', '</td>')
$Money2 = $Money[1]
Local $Result = StringLeft($Money2, 3)
Local $String = StringCompare(GUICtrlRead($Value), $Result)
If $String = 0 Then
_IENavigate($oIE, "https://www.smsglobal.com/mobileworks/signin.php")
_IELoadWait($oIE)
$Username = _IEGetObjByName($oIE, "username")
$Password = _IEGetObjByName($oIE, "password")
$Login = _IEGetObjByName($oIE, "SI")
_IEFormElementSetValue($Username, GUICtrlRead($User))
_IEFormElementSetValue($Password, GUICtrlRead($Pass))
_IEAction($Login, "click")
_IELoadWait($oIE)
_IENavigate($oIE, "https://www.smsglobal.com/mobileworks/sendtono.php")
_IELoadWait($oIE)
$Nr = _IEGetObjByName($oIE, "p_cellphone")
$From = _IEGetObjByName($oIE, "sms_from")
$Sms = _IEGetObjByName($oIE, "message")
$Send = _IEGetObjByName($oIE, "SI")
_IEFormElementSetValue($Nr, GUICtrlRead($Phone))
_IEFormElementSetValue($From, "Valuta")
_IEFormElementSetValue($Sms, "EUR a ajuns la " & $Money2)
Sleep(10000)
_IEAction($Send, "click")
_IELoadWait($oIE)
_IEQuit($oIE)
Exit
Else
_IEQuit($oIE)
EndIf
WEnd
EndFunc ;==>_Eur


Func _Usd()
While True
$oIE = _IECreate("http://www.cursvalutar.ro/", 1, 1, 0)
_IELoadWait($oIE)
$HTML = _IEBodyReadHTML($oIE)
$Money = _StringBetween($HTML, '<td>', '</td>')
$Money2 = $Money[6]
Local $Result = StringLeft($Money2, 3)
Local $String = StringCompare(GUICtrlRead($Value), $Result)
If $String = 0 Then
_IENavigate($oIE, "https://www.smsglobal.com/mobileworks/signin.php")
_IELoadWait($oIE)
$Username = _IEGetObjByName($oIE, "username")
$Password = _IEGetObjByName($oIE, "password")
$Login = _IEGetObjByName($oIE, "SI")
_IEFormElementSetValue($Username, GUICtrlRead($User))
_IEFormElementSetValue($Password, GUICtrlRead($Pass))
_IEAction($Login, "click")
_IELoadWait($oIE)
_IENavigate($oIE, "https://www.smsglobal.com/mobileworks/sendtono.php")
_IELoadWait($oIE)
$Nr = _IEGetObjByName($oIE, "p_cellphone")
$From = _IEGetObjByName($oIE, "sms_from")
$Sms = _IEGetObjByName($oIE, "message")
$Send = _IEGetObjByName($oIE, "SI")
_IEFormElementSetValue($Nr, GUICtrlRead($Phone))
_IEFormElementSetValue($From, "Valuta")
_IEFormElementSetValue($Sms, "USD a ajuns la " & $Money2)
_IEAction($Send, "click")
_IELoadWait($oIE)
_IEQuit($oIE)
Exit
Else
_IEQuit($oIE)
EndIf
WEnd
EndFunc ;==>_Usd


Func _Gbp()
While True
$oIE = _IECreate("http://www.cursvalutar.ro/", 0, 0, 1)
_IELoadWait($oIE)
$HTML = _IEBodyReadHTML($oIE)
$Money = _StringBetween($HTML, '<td>', '</td>')
$Money2 = $Money[66]
Local $Result = StringLeft($Money2, 3)
Local $String = StringCompare(GUICtrlRead($Value), $Result)
If $String = 0 Then
_IENavigate($oIE, "https://www.smsglobal.com/mobileworks/signin.php")
_IELoadWait($oIE)
$Username = _IEGetObjByName($oIE, "username")
$Password = _IEGetObjByName($oIE, "password")
$Login = _IEGetObjByName($oIE, "SI")
_IEFormElementSetValue($Username, GUICtrlRead($User))
_IEFormElementSetValue($Password, GUICtrlRead($Pass))
_IEAction($Login, "click")
_IELoadWait($oIE)
_IENavigate($oIE, "https://www.smsglobal.com/mobileworks/sendtono.php")
_IELoadWait($oIE)
$Nr = _IEGetObjByName($oIE, "p_cellphone")
$From = _IEGetObjByName($oIE, "sms_from")
$Sms = _IEGetObjByName($oIE, "message")
$Send = _IEGetObjByName($oIE, "SI")
_IEFormElementSetValue($Nr, GUICtrlRead($Phone))
_IEFormElementSetValue($From, "Valuta")
_IEFormElementSetValue($Sms, "GBP a ajuns la " & $Money2)
_IEAction($Send, "click")
_IELoadWait($oIE)
_IEQuit($oIE)
Exit
Else
_IEQuit($oIE)
EndIf
WEnd
EndFunc ;==>_Gbp








Edited by Jimmy
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.



×
×
  • Create New...