FrecKDancE
Новичок
- Сообщения
- 19
- Репутация
- 1
Добрый вечер. Столкнулся с проблемой, что когда программа выполняет какое-либо действие, то она зависает на время выполнения этого действия, после выполнения начинает нормально функционировать, до следующего действия.
Вот одно из действий:
Вот одно из действий:
Код:
Case $Button2
If $check_market = 1 Then
GUICtrlSetData($Button2, "Запустить торговлю")
AdlibUnRegister("trade")
AdlibUnRegister("pingit")
GUICtrlSetState ($Button1, $GUI_ENABLE)
GUICtrlSetData($Label1, "Офлайн")
GUICtrlSetColor($Label1, 0xff0000)
GUICtrlSetFont($Label1, 15)
GUICtrlSetData($Label3, "Статус: Продажи остановлены")
GUICtrlSetColor($Label3, 0xff0000)
$fullrequest = $http2&$apikey
BinaryToString(InetRead($fullrequest,1))
$check_market = 0
ElseIf $check_market = 0 Then
GUICtrlSetData($Button2, "Остановить торговлю")
AdlibRegister("trade", 15000)
AdlibRegister("pingit", 120000)
GUICtrlSetState ($Button1, $GUI_DISABLE)
trade()
pingit()
$check_market = 1
EndIf
Код:
func trade()
$fullrequest = $http3&$apikey
GUICtrlSetData($Label3, "Статус: Выполнение процесса")
GUICtrlSetColor($Label3, 0xffa500)
$SRead999 = BinaryToString(InetRead($fullrequest,2))
If StringInStr($SRead999, "error") Then
GUICtrlSetData($Label3, "Статус: Нет трейдов")
GUICtrlSetColor($Label3, 0xff0000)
ElseIf StringInStr($SRead999, "true") Then
GUICtrlSetData($Label3, "Статус: Есть трейды")
GUICtrlSetColor($Label3, 0x008000)
EndIf
EndFunc
Код:
func pingit()
$fullrequest = $http1&$apikey
GUICtrlSetData($Label1, "Выполнение процесса")
GUICtrlSetColor($Label1, 0xffa500)
GUICtrlSetFont($Label1, 15)
$SRead = BinaryToString(InetRead($fullrequest,1))
If StringInStr($SRead, "Bad KEY") Then
GUICtrlSetData($Label1, "Не верный Код")
GUICtrlSetColor($Label1, 0xff0000)
GUICtrlSetFont($Label1, 15)
Elseif StringInStr($SRead, "error") Then
GUICtrlSetData($Label1, "Ошибка")
GUICtrlSetColor($Label1, 0xff0000)
GUICtrlSetFont($Label1, 15)
ElseIf StringInStr($SRead, "too early for pong") Then
GUICtrlSetData($Label1, "Онлайн")
GUICtrlSetColor($Label1, 0x008000)
GUICtrlSetFont($Label1, 15)
ElseIf StringInStr($SRead, "true") Then
GUICtrlSetData($Label1, "Онлайн")
GUICtrlSetColor($Label1, 0x008000)
GUICtrlSetFont($Label1, 15)
Else
GUICtrlSetData($Label1, "Status: ???")
EndIf
EndFunc