Skocz do zawartości

[Source][Winhttp.au3]rayOgameBot source


Rekomendowane odpowiedzi

Takie nudy w szpitalu że wpadłem na pomysł aby napisać bota na podstawie winhttp(jebac ie i ff :D).

Bot jest w fazie raczkowania i zawiera tylko jedna funkcje i poki co jest czytelny(zmienne nazwane po imieniu) dlatego go udostepniam bo potem nie bedzie sensu :D

Potrzebny jest udf z tej strony

http://www.autoitscr...http-functions/

Być może tutka napisze do tego udfa?

instrukcja

wlaczamy, czekamy, wpisujemy passy, logujemy sie, wybieramy kordy docelowe, z ktorej planety ma slac, flote najlepiej zostawic to wybierze tyle mt i dt ile potrzeba, w surke wpisujemy ile chcemy wyslac lub wpisujemy max to wysle tyle ile jest na planecie, klikamy dodaj, a potem start

http://wklej.to/GnZGc

 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compression=0
#AutoIt3Wrapper_Add_Constants=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include "WinHTTP.au3"
#include "string.au3"
#include "array.au3"
#include <Date.au3>
;#include <IE.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <file.au3>
#include <GuiEdit.au3>
Global $listaserwerow, $listaplanet, $h_openrequest, $hw_connect, $planeta, $pojemnoscstatkow, $dostepnestatki[13],$surka[3]
Global $data = ""
#region ### START Koda GUI section ### Form=
;Local $oIE = _IECreateEmbedded()
$Form1 = GUICreate("rayOgameBot", 950, 460, 0, 0)
;$obj = GUICtrlCreateObj($oIE, 770, 5, @DesktopWidth - 290, @DesktopHeight-80)
;GUICtrlSetState($obj, $gui_show)
GUICtrlCreateGroup("Logowanie", 1, 1, 240, 100)
$Combo1 = GUICtrlCreateCombo("", 8, 24, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL))
$Input1 = GUICtrlCreateInput("", 8, 48, 145, 21)
$Input2 = GUICtrlCreateInput("", 8, 72, 145, 21)
$Button1 = GUICtrlCreateButton("Zaloguj", 160, 24, 75, 65)
GUICtrlCreateGroup("Szpiegowanie", 1, 113, 740, 332)
$Input3 = GUICtrlCreateInput("", 56, 136, 25, 21)
GUICtrlSetLimit(-1, 2)
$Input4 = GUICtrlCreateInput("", 95, 136, 29, 21)
GUICtrlSetLimit(-1, 3)
$Input5 = GUICtrlCreateInput("", 136, 136, 29, 21)
GUICtrlSetLimit(-1, 2)
$Combo4 = GUICtrlCreateCombo("Planeta", 170, 136, 60, 25)
GUICtrlSetData(-1, "Moon")
$Combo2 = GUICtrlCreateCombo("", 56, 160, 110, 25)
$Combo5 = GUICtrlCreateCombo("Planeta", 170, 160, 60, 25)
GUICtrlSetData(-1, "Moon")
$Combo3 = GUICtrlCreateCombo("Transportuj", 56, 184, 110, 25)
;guictrlsetdata(-1,"Szpieguj|Atakuj|Stancjonuj")
GUICtrlCreateLabel(":", 83, 138)
GUICtrlCreateLabel(":", 126, 136)
GUICtrlCreateLabel("Kord", 8, 136, 36, 17)
GUICtrlCreateLabel("Planeta", 8, 160, 36, 17)
GUICtrlCreateLabel("Akcja", 8, 184, 36, 17)
GUICtrlCreateLabel("Szybkosc", 170, 184)
GUICtrlCreateLabel("Metal", 8, 208)
$Input18 = GUICtrlCreateInput("", 56, 208, 110, 21)
GUICtrlCreateLabel("Krysztal", 170, 208)
$Input19 = GUICtrlCreateInput("", 230, 208, 110, 21)
GUICtrlCreateLabel("Deuter", 380, 208)
$Input20 = GUICtrlCreateInput("", 433, 208, 110, 21)
$Combo6 = GUICtrlCreateCombo("100", 230, 184, 60, 25)
GUICtrlSetData(-1, "90|80|70|60|50|40|30|20|10")
GUICtrlCreateLabel("LM", 290, 138)
$Input6 = GUICtrlCreateInput("", 310, 136, 65, 21)
GUICtrlCreateLabel("CM", 290, 160)
$Input7 = GUICtrlCreateInput("", 310, 160, 65, 21)
GUICtrlCreateLabel("OW", 290, 184)
$Input8 = GUICtrlCreateInput("", 310, 184, 65, 21)
GUICtrlCreateLabel("GS", 380, 138)
$Input9 = GUICtrlCreateInput("", 433, 136, 65, 21)
GUICtrlCreateLabel("Krazownik", 380, 160)
$Input10 = GUICtrlCreateInput("", 433, 160, 65, 21)
GUICtrlCreateLabel("Pancernik", 380, 184)
$Input11 = GUICtrlCreateInput("", 433, 184, 65, 21)
GUICtrlCreateLabel("Bombowiec", 500, 138)
$Input12 = GUICtrlCreateInput("", 557, 136, 65, 21)
GUICtrlCreateLabel("Niszczyciel", 500, 160)
$Input13 = GUICtrlCreateInput("", 557, 160, 65, 21)
GUICtrlCreateLabel("Recykler", 500, 184)
$Input14 = GUICtrlCreateInput("", 557, 184, 65, 21)
GUICtrlCreateLabel("DT", 624, 136)
$Input15 = GUICtrlCreateInput("", 667, 136, 65, 21)
GUICtrlCreateLabel("MT", 624, 160)
$Input16 = GUICtrlCreateInput("", 667, 160, 65, 21)
GUICtrlCreateLabel("Sonda", 624, 184)
$Input17 = GUICtrlCreateInput("", 667, 184, 65, 21)
$Button2 = GUICtrlCreateButton("Dodaj", 230, 136, 60, 46)
$listview = GUICtrlCreateListView("", 5, 232, 730, 175)
_GUICtrlListView_AddColumn($listview, "Kord", 80)
_GUICtrlListView_AddColumn($listview, "Planeta", 90)
_GUICtrlListView_AddColumn($listview, "Akcja", 63)
_GUICtrlListView_AddColumn($listview, "Szybkosc", 59)
_GUICtrlListView_AddColumn($listview, "Statki", 250)
_GUICtrlListView_AddColumn($listview, "Surowiec", 184)
;$gala,$system,$pozycja,$cel,$planeta,$skad,$misja,$szybkosc,$surka = "max",$statki = "max"
$Button3 = GUICtrlCreateButton("Start", 5, 409, 175, 33)
GUICtrlCreateGroup("Wczytywanie", 250, 1, 490, 100)
$Input21 = GUICtrlCreateInput("", 260, 20, 140, 21)
$Button4 = GUICtrlCreateButton("Szukaj", 405, 20, 50, 21)
$Button5 = GUICtrlCreateButton("Wczytaj", 260, 45, 140, 21)
GUICtrlCreateLabel("Nazwa pliku", 500, 22)
$Input22 = GUICtrlCreateInput("", 560, 20, 140, 21)
$Button6 = GUICtrlCreateButton("Zapisz", 560, 45, 140, 21)
GUICtrlSetState($Button1, $GUI_disable)
GUICtrlSetState($Button2, $GUI_disable)
GUICtrlSetState($Button3, $GUI_disable)
GUICtrlSetState($Combo1, $GUI_disable)
$Edit1 = GUICtrlCreateEdit("", 750, 8, 190, 435, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL))

GUISetState(@SW_SHOW)
Do
$hw_open = _WinHttpOpen("Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20100101 Firefox/16.0")
Until $hw_open
uzupelnianiecomboserw(pobieranielistyserwerow())
GUICtrlSetState($Button1, $GUI_ENABLE)
GUICtrlSetState($Combo1, $GUI_ENABLE)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_WinHttpCloseHandle($h_openrequest)
_WinHttpCloseHandle($hw_connect)
_WinHttpCloseHandle($hw_open)
Exit
Case $Button3
GUICtrlSetState($Button1, $GUI_disable)
GUICtrlSetState($Button2, $GUI_disable)
GUICtrlSetState($Button3, $GUI_disable)
GUICtrlSetState($Combo1, $GUI_disable)
If _GUICtrlListView_GetItemCount($listview) = 0 Then
Consolewrites("Brak ustawionej kolejki")
Else
Do
$listinfo = _GUICtrlListView_GetItemTextArray($listview, 0)
$gala = _StringBetween($listinfo[1], "", ":")
$system = _StringBetween($listinfo[1], ":", ":")
$pozycja = _StringBetween($listinfo[1], $system[0] & ":", "(")
$cel = _StringBetween($listinfo[1], "(", ")")
Switch $cel[0]
Case "P"
$cel = 1
Case "M"
$cel = 3
Case "PZ"
$cel = 2
EndSwitch
If StringInStr($listinfo[2], "(M)") Then
For $i = 0 To UBound($listaplanet) - 1
If $listaplanet[$i][0][0] = StringTrimRight($listinfo[2], 3) Then $planeta = $listaplanet[$i][1][0]

Next
Else
For $i = 0 To UBound($listaplanet) - 1
If $listaplanet[$i][0][0] = StringTrimRight($listinfo[2], 3) Then $planeta = $listaplanet[$i][0][1]
Next
EndIf
$misja = $listinfo[3]
$szybkosc = StringTrimRight($listinfo[4], 1)
$surka = $listinfo[6]
$statki = $listinfo[5]
; [1] = kord,[2] = planeta,[3]= misja,[4]=szybkosc,[5] = statki,[6] = surka
Do
sleep(100)
Until wyslijflote($gala[0], $system[0], $pozycja[0], $cel, $planeta, $misja, $szybkosc, $surka, $statki)

_GUICtrlListView_DeleteItem($listview, 0)
Until _GUICtrlListView_GetItemCount($listview) = 0
Consolewrites("Kolejka pusta, koncze prace")
EndIf
GUICtrlSetState($Button1, $GUI_ENABLE)
GUICtrlSetState($Button2, $GUI_ENABLE)
GUICtrlSetState($Button3, $GUI_ENABLE)
GUICtrlSetState($Combo1, $GUI_ENABLE)
Case $Button5
GUICtrlSetState($Button5, $GUI_disable)
$file = GUICtrlRead($Input21)
$filelines = _FileCountLines($file)
If $filelines = 0 Then
consolewrites("Brak danych w pliku")
Else;if $filelines = 1 Then
If _GUICtrlListView_GetItemCount($listview) <> 0 Then
For $i = 1 To _GUICtrlListView_GetItemCount($listview)
_GUICtrlListView_DeleteItem($listview, 0)
Next
EndIf
$dane = _StringBetween(FileReadLine($file, 1), "<>", "<>")
GUICtrlSetData($Combo1, $dane[0])
GUICtrlSetData($Input1, $dane[1])
GUICtrlSetData($Input2, $dane[2])
If $filelines > 1 Then
For $i = 2 To $filelines
GUICtrlCreateListViewItem(FileReadLine($file, $i), $listview)
Next
EndIf
EndIf
GUICtrlSetState($Button5, $GUI_ENABLE)
GUICtrlSetState($Button1, $GUI_disable)
$serw = GUICtrlRead($Combo1)
For $i = 0 To UBound($listaserwerow) - 1
If $listaserwerow[$i][1] = $serw Then $serw = $listaserwerow[$i][0]
Next
$data = login($serw, GUICtrlRead($Input1), GUICtrlRead($Input2))
If $data Then
GUICtrlSetState($Button1, $GUI_ENABLE)
Global $listaplanet = wczytajplanety($data)
$combo2func = ""
For $i = 0 To UBound($listaplanet) - 1
$combo2func &= $listaplanet[$i][0][0] & "|"
Next
consolewrites("Wszytano planety")
GUICtrlSetData($Combo2, $combo2func)
GUICtrlSetState($Button2, $GUI_ENABLE)
EndIf
Case $Button6
GUICtrlSetState($Button6, $GUI_disable)
If _GUICtrlListView_GetItemCount($listview) = 0 And GUICtrlRead($Combo1) = "" And GUICtrlRead($Input1) = "" And GUICtrlRead($Input2) = "" Then
consolewrites("Brak danych do zapisania ustawien")
Else
$plik = GUICtrlRead($Input22)
FileDelete(@ScriptDir & "/" & $plik & ".txt")
FileWriteLine(@ScriptDir & "/" & $plik & ".txt", "<>" & GUICtrlRead($Combo1) & "<><>" & GUICtrlRead($Input1) & "<><>" & GUICtrlRead($Input2) & "<>")
; [1] = kord,[2] = planeta,[3]= misja,[4]=szybkosc,[5] = statki,[6] = surka
If _GUICtrlListView_GetItemCount($listview) <> 0 Then
For $i = 0 To _GUICtrlListView_GetItemCount($listview) - 1
$listinfo = _GUICtrlListView_GetItemTextArray($listview, $i)
FileWriteLine(@ScriptDir & "/" & $plik & ".txt", $listinfo[1] & "|" & $listinfo[2] & "|" & $listinfo[3] & "|" & $listinfo[4] & "|" & $listinfo[5] & "|" & $listinfo[6])
Next
EndIf
Consolewrites("Zapisano pomyslnie ustawienia do pliku " & $plik)
EndIf
GUICtrlSetState($Button6, $GUI_ENABLE)

Case $Button4
$var = FileOpenDialog("Wybierz ustawienia", @ScriptDir & "\", "Plik tekstowy (*.txt)", 1)
GUICtrlSetData($Input21, $var)
Case $Button1
GUICtrlSetState($Button1, $GUI_disable)
$serw = GUICtrlRead($Combo1)
For $i = 0 To UBound($listaserwerow) - 1
If $listaserwerow[$i][1] = $serw Then $serw = $listaserwerow[$i][0]
Next
$data = login($serw, GUICtrlRead($Input1), GUICtrlRead($Input2))
If $data Then
GUICtrlSetState($Button1, $GUI_ENABLE)
Global $listaplanet = wczytajplanety($data)
$combo2func = ""
For $i = 0 To UBound($listaplanet) - 1
$combo2func &= $listaplanet[$i][0][0] & "|"
Next
consolewrites("Wszytano planety")
GUICtrlSetData($Combo2, $combo2func)
GUICtrlSetState($Button2, $GUI_ENABLE)
EndIf
Case $Button2
$kord = ""
Switch GUICtrlRead($Combo4)
Case "Planeta"
$kord = "P"
Case "Moon"
$kord = "M"
Case "PZ"
$kord = "PZ"
EndSwitch
$od = ""
Switch GUICtrlRead($Combo5)
Case "Planeta"
$od = "P"
Case "Moon"
$od = "M"
Case "PZ"
$od = "PZ"
EndSwitch
$statki = ""
If GUICtrlRead($Input6) <> "" Then $statki &= ".LM=" & GUICtrlRead($Input6) & "."
If GUICtrlRead($Input7) <> "" Then $statki &= ".CM=" & GUICtrlRead($Input7) & "."
If GUICtrlRead($Input8) <> "" Then $statki &= ".OW=" & GUICtrlRead($Input8) & "."
If GUICtrlRead($Input9) <> "" Then $statki &= ".GS=" & GUICtrlRead($Input9) & "."
If GUICtrlRead($Input10) <> "" Then $statki &= ".Krazownik=" & GUICtrlRead($Input10) & "."
If GUICtrlRead($Input11) <> "" Then $statki &= ".Pancernik=" & GUICtrlRead($Input11) & "."
If GUICtrlRead($Input12) <> "" Then $statki &= ".Bombowiec=" & GUICtrlRead($Input12) & "."
If GUICtrlRead($Input13) <> "" Then $statki &= ".Niszczyciel=" & GUICtrlRead($Input13) & "."
If GUICtrlRead($Input14) <> "" Then $statki &= ".Recykler=" & GUICtrlRead($Input14) & "."
If GUICtrlRead($Input15) <> "" Then $statki &= ".DT=" & GUICtrlRead($Input15) & "."
If GUICtrlRead($Input16) <> "" Then $statki &= ".MT=" & GUICtrlRead($Input16) & "."
If GUICtrlRead($Input17) <> "" Then $statki &= ".Sonda=" & GUICtrlRead($Input17) & "."
$surka = "," & GUICtrlRead($Input18) & ",," & GUICtrlRead($Input19) & ",," & GUICtrlRead($Input20) & ","
GUICtrlCreateListViewItem(GUICtrlRead($Input3) & ":" & GUICtrlRead($Input4) & ":" & GUICtrlRead($Input5) & "(" & $kord & ")" & "|" & GUICtrlRead($Combo2) & "(" & $od & ")" & "|" & GUICtrlRead($Combo3) & "|" & GUICtrlRead($Combo6) & "|" & $statki & "|" & $surka, $listview)
EndSwitch
WEnd
Func wyslijflote($gala, $system, $pozycja, $cel, $planeta, $misja, $szybkosc, $surka, $statki)
$h_openrequest = _WinHttpOpenRequest($hw_connect, "GET", "/game/index.php?page=fleet1&cp=" & $planeta)
_WinHttpAddRequestHeaders($h_openrequest, "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20100101 Firefox/16.0")
_WinHttpAddRequestHeaders($h_openrequest, "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
_WinHttpAddRequestHeaders($h_openrequest, "Accept-Language: pl,en-us;q=0.7,en;q=0.3")
_WinHttpAddRequestHeaders($h_openrequest, "Connection: keep-alive")
_WinHttpAddRequestHeaders($h_openrequest, "Content-Type: application/x-www-form-urlencoded")
_WinHttpSendRequest($h_openrequest)
_WinHttpReceiveResponse($h_openrequest)
$data = ""
Do
$data &= _WinHttpReadData($h_openrequest, 0)
Until @error
FileDelete(@ScriptDir & '/fleet.html')
FileWrite(@ScriptDir & '/fleet.html', $data)
$metal = _StringBetween($data, 'span id="resources_metal', '/span>')
$metal = _StringBetween(StringReplace($metal[0], " ", ""), '>', '<')
$metal = StringReplace(StringTrimLeft($metal[0], 1), ".", "")
$krysztal = _StringBetween($data, 'span id="resources_crystal"', '/span>')
$krysztal = _StringBetween(StringReplace($krysztal[0], " ", ""), '>', '<')
$krysztal = StringReplace(StringTrimLeft($krysztal[0], 1), ".", "")
$deuter = _StringBetween($data, 'span id="resources_deuterium"', '/span>')
$deuter = _StringBetween(StringReplace($deuter[0], " ", ""), '>', '<')
$deuter = StringReplace(StringTrimLeft($deuter[0], 1), ".", "")
Global $dostepnestatki = _StringBetween($data, 'onkeyup="checkIntInput(this, 0, ', ")")
Switch $misja
Case "Transportuj"
If $statki = "" Then
$surka1 = _StringBetween($surka, ",", ",");[0] metal,[1] krycha [2], deuter
If $surka1[0] > $metal Or $surka1[0] = "max" Then $surka1[0] = $metal
If $surka1[1] > $krysztal Or $surka1[1] = "max" Then $surka1[1] = $krysztal
If $surka1[2] > $deuter Or $surka1[2] = "max" Then $surka1[2] = $deuter
$overallsurka = 0


$overallsurka = $surka1[0] + $surka1[1] + $surka1[2]
$iloscpotrzmt = 0
$iloscpotrzdt = 0
$statki = ""
If $dostepnestatki[8] + $dostepnestatki[9] = 0 Or $overallsurka = 0 Then
consolewrites("Brak statkow lub surowcow na planecie do wyslania")
Return 0
Else
If $dostepnestatki[8] > 0 Then
$obliczenia = $overallsurka / 5000
$iloscpotrzmt = Ceiling($obliczenia)
If $dostepnestatki[8] < $iloscpotrzmt Then
$iloscpotrzmt = $dostepnestatki[8]
$overallsurka -= $dostepnestatki[8] * 5000
EndIf
EndIf
If $dostepnestatki[9] > 0 Then
$iloscpotrzdt = Ceiling($overallsurka / 25000)
If $dostepnestatki[9] < $iloscpotrzdt Then $iloscpotrzdt = $dostepnestatki[9]
EndIf
$overallsurka = $surka1[0] + $surka1[1] + $surka1[2]
$pojemnoscstatkow = 0
$pojemnoscstatkow += $iloscpotrzmt * 5000
$pojemnoscstatkow += $iloscpotrzdt * 25000
$surka = ""
If $pojemnoscstatkow > $overallsurka Then
$surka = "&metal=" & $surka1[0] & "&crystal=" & $surka1[1] & "&deuterium=" & $surka1[2]
Else
$overallsurka1 = $pojemnoscstatkow
$pojemnoscstatkow -= $surka1[0]
If $pojemnoscstatkow < 0 Then $surka &= "&metal=" & $overallsurka1
If $pojemnoscstatkow > 0 Then $surka &= "&metal=" & $surka1[0]
$overallsurka1 = $pojemnoscstatkow
$pojemnoscstatkow -= $surka1[1]
If $pojemnoscstatkow < 0 Then $surka &= "&crystal=" & $overallsurka1
If $pojemnoscstatkow > 0 Then $surka &= "&crystal=" & $surka1[1]
$overallsurka1 = $pojemnoscstatkow
$pojemnoscstatkow -= $surka1[2]
If $pojemnoscstatkow < 0 Then $surka &= "&deuterium=" & $overallsurka1
If $pojemnoscstatkow > 0 Then $surka &= "&deuterium=" & $surka1[2]
EndIf

If $iloscpotrzmt > 0 Then $statki &= "&am202=" & $iloscpotrzmt
If $iloscpotrzdt > 0 Then $statki &= "&am203=" & $iloscpotrzdt
EndIf
EndIf
$token = ""
fleet2($gala, $system, $pozycja, $cel, $szybkosc, $statki)
$token = fleet3($cel, $statki, $gala, $system, $pozycja, $szybkosc)
fleet4($token, $gala, $system, $pozycja, $cel, 3, $szybkosc, $statki, $surka)
ConsoleWrites("Wyslano surowce na " & $gala & ":" & $system & ":" & $pozycja)
return 1
EndSwitch
EndFunc ;==>wyslijflote
Func fleet2($fleet2gala, $fleet2system, $fleet2pozycja, $fleet2cel, $fleet2szybkosc, $fleet2flota)
$data = "galaxy=" & $fleet2gala & "&system=" & $fleet2system & "&position=" & $fleet2pozycja & "&type=" & $fleet2cel & "&mission=0&speed=" & $fleet2szybkosc & $fleet2flota
$h_openrequest = _WinHttpOpenRequest($hw_connect, "POST", "/game/index.php?page=fleet2")
_WinHttpAddRequestHeaders($h_openrequest, "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20100101 Firefox/16.0")
_WinHttpAddRequestHeaders($h_openrequest, "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
_WinHttpAddRequestHeaders($h_openrequest, "Accept-Language: pl,en-us;q=0.7,en;q=0.3")
_WinHttpAddRequestHeaders($h_openrequest, "Connection: keep-alive")
_WinHttpAddRequestHeaders($h_openrequest, "Referer: [url="http://uni106.ogame.pl/game/index.php?page=fleet1"]http://uni106.ogame....hp?page=fleet1"[/url])
_WinHttpAddRequestHeaders($h_openrequest, "Content-Type: application/x-www-form-urlencoded")
_WinHttpSendRequest($h_openrequest, $WINHTTP_NO_ADDITIONAL_HEADERS, $data)
_WinHttpReceiveResponse($h_openrequest)
$data = ""
Do
$data &= _WinHttpReadData($h_openrequest, 0)
Until @error
FileDelete(@ScriptDir & '/fleet2.html')
FileWrite(@ScriptDir & '/fleet2.html', $data)
If $data <> 0 Then
Return 1
Else
Return 0
EndIf
EndFunc ;==>fleet2
Func fleet3($fleet3cel, $fleet3statki, $fleet3gala, $fleet3system, $fleet3pozycja, $fleet3szybkosc)
$data = "type=" & $fleet3cel & "&mission=0&union=0" & $fleet3statki & "&galaxy=" & $fleet3gala & "&system=" & $fleet3system & "&position=" & $fleet3pozycja & "&speed=" & $fleet3szybkosc
$h_openrequest = _WinHttpOpenRequest($hw_connect, "POST", "/game/index.php?page=fleet3")
_WinHttpAddRequestHeaders($h_openrequest, "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20100101 Firefox/16.0")
_WinHttpAddRequestHeaders($h_openrequest, "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
_WinHttpAddRequestHeaders($h_openrequest, "Accept-Language: pl,en-us;q=0.7,en;q=0.3")
_WinHttpAddRequestHeaders($h_openrequest, "Connection: keep-alive")
_WinHttpAddRequestHeaders($h_openrequest, "Referer: [url="http://uni106.ogame.pl/game/index.php?page=fleet2"]http://uni106.ogame....hp?page=fleet2"[/url])
_WinHttpAddRequestHeaders($h_openrequest, "Content-Type: application/x-www-form-urlencoded")
_WinHttpSendRequest($h_openrequest, $WINHTTP_NO_ADDITIONAL_HEADERS, $data)
_WinHttpReceiveResponse($h_openrequest)
FileDelete(@ScriptDir & '/fleet3.html')
$data = ""
Do
$data &= _WinHttpReadData($h_openrequest, 0)
Until @error
FileWrite(@ScriptDir & '/fleet3.html', $data)
$aha = _StringBetween($data, "name='token' value='", "' />")
If IsArray($aha) Then
$aha = $aha[0]
Return $aha
Else
Return 0
EndIf
EndFunc ;==>fleet3
Func fleet4($fleet4token, $fleet4gala, $fleet4system, $fleet4pos, $fleet4cel, $fleet4mission, $fleet4szybkosc, $fleet4statki, $fleet4surka)
$data = "holdingtime=1&expeditiontime=1&token=" & $fleet4token & "&galaxy=" & $fleet4gala & "&system=" & $fleet4system & "&position=" & $fleet4pos & "&type=" & $fleet4cel & "&mission=" & $fleet4mission & "&union2=0&holdingOrExpTime=0&speed=" & $fleet4szybkosc & $fleet4statki & $fleet4surka
$h_openrequest = _WinHttpOpenRequest($hw_connect, "POST", "/game/index.php?page=movement")
_WinHttpAddRequestHeaders($h_openrequest, "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20100101 Firefox/16.0")
_WinHttpAddRequestHeaders($h_openrequest, "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
_WinHttpAddRequestHeaders($h_openrequest, "Accept-Language: pl,en-us;q=0.7,en;q=0.3")
_WinHttpAddRequestHeaders($h_openrequest, "Connection: keep-alive")
_WinHttpAddRequestHeaders($h_openrequest, "Referer: [url="http://uni106.ogame.pl/game/index.php?page=fleet3"]http://uni106.ogame....hp?page=fleet3"[/url])
_WinHttpAddRequestHeaders($h_openrequest, "Content-Type: application/x-www-form-urlencoded")
_WinHttpSendRequest($h_openrequest, $WINHTTP_NO_ADDITIONAL_HEADERS, $data)
_WinHttpReceiveResponse($h_openrequest)
$data = ""
Do
$data &= _WinHttpReadData($h_openrequest, 0)
Until @error
FileDelete(@ScriptDir & '/htmlofsubmittedform2.html')
FileWrite(@ScriptDir & '/htmlofsubmittedform2.html', $data)
EndFunc ;==>fleet4



Func wczytajplanety($data)
$planety = _StringBetween($data, '"smallplanet" id="planet-', "</div>")
Global $listaplanet[uBound($planety)][2][2]
For $i = 0 To UBound($planety) - 1
$planetynazwa = _StringBetween($planety[$i], '<span class="planet-name ">', '</span>')
$listaplanet[$i][0][0] = $planetynazwa[0]
$planetyid = _StringBetween($planety[$i], "", " ")
$listaplanet[$i][0][1] = StringTrimRight($planetyid[0], 3)
If StringInStr($planety[$i], "moonlink") Then
$moon = _StringBetween($planety[$i], "moonlink", ">")
$moon = _StringBetween($moon[0], "cp=", '"')
$listaplanet[$i][1][0] = $moon[0]
Else
$listaplanet[$i][1][0] = ""
EndIf
Next
Return $listaplanet
EndFunc ;==>wczytajplanety
Func uzupelnianiecomboserw($uzupeln)
GUICtrlSetData($Combo1, "")
$data = ""
For $i = 0 To UBound($uzupeln) - 1
$data &= $uzupeln[$i][1] & "|"
Next
GUICtrlSetData($Combo1, $data)
consolewrites("Uzupelniono liste serwerow")
EndFunc ;==>uzupelnianiecomboserw
Func pobieranielistyserwerow()
$hw_connect = _WinHttpConnect($hw_open, "ogame.pl")
$h_openrequest = _WinHttpOpenRequest($hw_connect, "GET", "/")
_WinHttpAddRequestHeaders($h_openrequest, "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20100101 Firefox/16.0")
_WinHttpAddRequestHeaders($h_openrequest, "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
_WinHttpAddRequestHeaders($h_openrequest, "Accept-Language: pl,en-us;q=0.7,en;q=0.3")
_WinHttpAddRequestHeaders($h_openrequest, "Connection: keep-alive")
_WinHttpAddRequestHeaders($h_openrequest, "Referer: [url="http://uni106.ogame.pl/game/index.php?page=fleet1"]http://uni106.ogame....hp?page=fleet1"[/url])
_WinHttpAddRequestHeaders($h_openrequest, "Content-Type: application/x-www-form-urlencoded")
_WinHttpSendRequest($h_openrequest)
_WinHttpReceiveResponse($h_openrequest)
$data = ""
Do
$data &= _WinHttpReadData($h_openrequest, 0)
Until @error
$listaserw = _StringBetween($data, 'name="uni">', '</select>')
If Not IsArray($listaserw) Then
consolewrites("Blad pobierania serwerow")
Exit
EndIf
$listaserw = _StringBetween($listaserw[0], "<OPTION", "</OPTION>")
Global $listaserwerow[uBound($listaserw)][2]
For $i = 0 To UBound($listaserw) - 1
$linkserw = _StringBetween($listaserw[$i], "value=", ">")
$listaserwerow[$i][0] = StringReplace($linkserw[0], '"', "")
$nazwaserw = _StringBetween($listaserw[$i], ">", "")
$listaserwerow[$i][1] = StringTrimLeft(StringReplace($nazwaserw[0], " ", ""), 2)
Next
consolewrites("Pobrano liste serwerow")
Return $listaserwerow
EndFunc ;==>pobieranielistyserwerow

Func consolewrites($consolewrites)
$lol = _Date_Time_GetSystemTime()
FileWriteLine("log.txt", _Date_Time_SystemTimeToDateTimeStr($lol) & " " & $consolewrites)
ConsoleWrite($consolewrites & @CRLF)
_GUICtrlEdit_AppendText($Edit1, $consolewrites & @CRLF)
EndFunc ;==>consolewrites
Func login($serwer, $login, $haslo)
For $i = 1 To 5
Consolewrites($i & " Proba logowania.")
$hw_connect = _WinHttpConnect($hw_open, $serwer)
$h_openrequest = _WinHttpOpenRequest($hw_connect, "POST", "/game/reg/login2.php?login=" & $login & "&pass=" & $haslo)
_WinHttpAddRequestHeaders($h_openrequest, "User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20100101 Firefox/16.0")
_WinHttpAddRequestHeaders($h_openrequest, "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
_WinHttpAddRequestHeaders($h_openrequest, "Accept-Language: pl,en-us;q=0.7,en;q=0.3")
_WinHttpAddRequestHeaders($h_openrequest, "Connection: keep-alive")
_WinHttpAddRequestHeaders($h_openrequest, "Content-Type: application/x-www-form-urlencoded")
_WinHttpSendRequest($h_openrequest)
_WinHttpReceiveResponse($h_openrequest)
$data = ""
Do
$data &= _WinHttpReadData($h_openrequest, 0)
Until @error
FileDelete(@ScriptDir & '/logowanie.html')
FileWrite(@ScriptDir & '/logowanie.html', $data)
If StringInStr($data, "Ustawienia") Then
consolewrites("Zalogowano")
GUICtrlSetState($Button3, $GUI_ENABLE)
Return $data
ElseIf StringInStr($data, "Sorry, you tried more passwords than normal users should. To protect accounts with weak passwords you are locked out for a while. If you are not a password guessing bot please come back in three hours (and maybe use the password recovery email instead of guessing). See you later!") Then
consolewrites("Konto jest zbanowane na 3 godziny, przez wpisanie niepoprawnego hasla kilkakrotnie")
Exit
Else
consolewrites("Niezalogowano")
Sleep(2000)
EndIf
Next
consolewrites("5 niepowiedzionych prob logowania.")
EndFunc ;==>login
;$sResult = _WinHttpSimpleRequest($hw_connect, "POST", '/game/index.php?page=fleet2', '', $data)
;consolewrite($sresult)

 

 

Odnośnik do komentarza
Udostępnij na innych stronach

A wiesz jak przywrócić stara kolorystykę?

Bo ta jest zjebana

bo sciagnalem sobie wersje portable i na niej pisalem(tylko ze wersje bez dodatkow do scite, czyli brak podpowiedzi funkcji nazw zmiennych itd. brak tidy, generatora gui) i troszke lipnie bez tych funkcji

ktory plik odpowiada za kolorystyke? moze wystarczy podmienic :D

@down

dzięki :)

tuta napisze dopiero po 17, poniewaz niema mnie na chacie a szkoda mi transferu na wgrywanie zdjec

Odnośnik do komentarza
Udostępnij na innych stronach

Miło by było gdybyś tutorial napisał,nie rozumiem tego winhttp a potrzebuję napisać skrypt do restartowania routera [ie.au3 za wolne,czasem wywala error] patrzyłem już na tego UDF coś próbowałem ale nic nie wyszlo...

 

 

A odnośnie kolorystyki, to stwórz skrypt au3 i w Scite wciśnij kombinację CTRL+1 wtedy powinieneś zobaczyć nowe okno.

Odnośnik do komentarza
Udostępnij na innych stronach

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

  • Ostatnio przeglądający forum [Source][Winhttp.au3]rayOgameBot source   0 użytkowników
    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...