Что нового

[Данные, строки] проблема с переводом строки

andreitrane

Новичок
Сообщения
141
Репутация
3
никак не могу поставить в stringsplit перевод строки
если ставить @CRLF, то делит так
crlf.jpg

а мне так не надо, если ставить @CR, то делит вроде нормально
cr.jpg

нормально проходит первый фейк, а на втором уже запрос кривится, откуда то взялась вторая строка
cr2.jpg

ну а если ставить @LF, то и делит нормально
cr.jpg

и запросы не кривятся
lf2.jpg

но сервер уже отвечает отрицательно, типа фейк не рабочий или че то в этом роде
lf.jpg



в чем моя ошибка и что надо исправить?



Код:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Array.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Срочняки v1.1", 271, 378, 245, 161)
GUISetBkColor(0xFFFF00)
$Group1 = GUICtrlCreateGroup("id:auth", 8, 0, 257, 81)
$fake_edit = GUICtrlCreateEdit("", 16, 16, 241, 57, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_HSCROLL))
GUICtrlCreateGroup("", -99, -99, 1, 1)
$whatthefake = GUICtrlCreateButton("?", 8, 88, 25, 25)
$srlogedit = GUICtrlCreateEdit("", 8, 128, 257, 209)
$newfakesbtn = GUICtrlCreateButton("Из файла", 40, 88, 89, 25)
$startsrbtn = GUICtrlCreateButton("Выполнить", 144, 88, 89, 25)
$Label1 = GUICtrlCreateLabel("by andreitrane (maniakk)", 40, 344, 173, 26)
GUICtrlSetFont(-1, 12, 400, 0, "Matura MT Script Capitals")
GUICtrlSetColor(-1, 0x000000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		case $whatthefake
			MsgBox(0, "срочняки", "в поле необходимо ввести список ваших id:auth через пробел (не на новой строке а через пробел) Пример: id:auth id:auth id:auth")
		Case $newfakesbtn
			$text = FileOpenDialog("Указать файл", @WorkingDir & "", "Любой (*.txt)", 1 + 4 )
        $Read = FileRead($text)
        GUICtrlSetData($fake_edit,$Read)
		Case $startsrbtn
			_startsr()

	EndSwitch
WEnd

Func _startsr()
	$i = GUICtrlRead($fake_edit)
	$fake = StringSplit($i,@LF)
	_ArrayDisplay($fake)
	$ii = 1
	for $ii = 1 to $fake[0]
	$ID = StringSplit($fake[$ii], ":")
	_ArrayDisplay($ID)
	$URL = "http://109.234.155.198/prison/universal.php?sendPresent"
            $PostData = "present%5Fid=3&user="& $ID[1] &"&key="& $ID[2] &"&sig=18e31e27a618dd2b2a6bb85921b5541c&recipients=48667677%2C127964220%2C90860572%2C115123216%2C106965530%2C112837336%2C114205321&method=sendPresent"
            $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
            $oHTTP.Open("POST", $URL)
            $oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
            $oHTTP.Send($PostData)
            $oHTTP.WaitForResponse
            $Response = $oHTTP.ResponseText
			Sleep(300)
			$URL = "http://109.234.155.198/prison/universal.php?voteForFriend"
            $PostData = "vote=5&model%5Fid=1&username=Zhyk.ru&sig=fd42e6a512b610dcaff59af25ba2b736&key="& $ID[2] &"&sex=0&friend%5Fuid=48667677&user="& $ID[1] &"&method=voteForFriend"
            $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
            $oHTTP.Open("POST", $URL)
            $oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
            $oHTTP.Send($PostData)
            $oHTTP.WaitForResponse
            $Response = $oHTTP.ResponseText
			Sleep(300)
			$URL = "http://109.234.156.250/prison/universal.php?getAllBuildingsRewards"
            $PostData = "sig=b858ff4bb6396bfa6a8ebec70d586566&user="& $ID[1] &"&key="& $ID[2] &"&method=getAllBuildingsRewards"
            $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
            $oHTTP.Open("POST", $URL)
            $oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
            $oHTTP.Send($PostData)
            $oHTTP.WaitForResponse
            $Response = $oHTTP.ResponseText
			Sleep(300)
			$URL = "http://109.234.156.250/prison/universal.php?office"
            $PostData = "method=office&key="& $ID[2] &"&getidea=5&user="& $ID[1] &"&sig=940e212c740281e8482bcc4102865d6d"
            $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
            $oHTTP.Open("POST", $URL)
            $oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
            $oHTTP.Send($PostData)
            $oHTTP.WaitForResponse
            $Response = $oHTTP.ResponseText
			Sleep(300)
			$URL = "http://109.234.155.198/prison/universal.php?challengeToDuel"
            $PostData = "enemy=48667677&key="& $ID[2] &"&sig=7e9456cbb7de72614e89d33e9e6b8542&user="& $ID[1] &"&method=challengeToDuel"
            $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
            $oHTTP.Open("POST", $URL)
            $oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
            $oHTTP.Send($PostData)
            $oHTTP.WaitForResponse
            $Response = $oHTTP.ResponseText
			Sleep(300)
			$URL = "http://109.234.155.198/prison/universal.php?challengeToDuel"
            $PostData = "enemy=48667677&key="& $ID[2] &"&sig=7e9456cbb7de72614e89d33e9e6b8542&user="& $ID[1] &"&method=challengeToDuel"
            $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
            $oHTTP.Open("POST", $URL)
            $oHTTP.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
            $oHTTP.Send($PostData)
            $oHTTP.WaitForResponse
            $Response = $oHTTP.ResponseText
			GUICtrlSetData($srlogedit, "id"& $ID[1] &" - выполнено"& @CRLF, @CRLF)
			Sleep(300)
		Next
		GUICtrlSetData($srlogedit, "срочняки выполнены"& @CRLF, @CRLF)
			MsgBox(0, "срочняки", "срочняки выполнены))")
			EndFunc
 

madmasles

Модератор
Глобальный модератор
Сообщения
7,790
Репутация
2,322
andreitrane
Попробуйте так:
Код:
;...
$fake = StringSplit(StringStripCR($i), @LF)
;...

Зачем такие большие картинки и столько их много?
 

kaster

Мой Аватар, он лучший самый
Команда форума
Глобальный модератор
Сообщения
4,020
Репутация
626
andreitrane
исправь, пож-та, все свои скрины на кликабельные эскизы
 
Верх