Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 14:34

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Ich find eine Vlaue nicht (autoit)

Discussion on Ich find eine Vlaue nicht (autoit) within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
Mr.Help's Avatar
 
elite*gold: 0
Join Date: Jun 2011
Posts: 217
Received Thanks: 17
Ich find eine Vlaue nicht (autoit)

Code:
#include<String.au3>
Msgbox ( 0, "Skylab Spezial Bot by E.N.I. 1.0.0", "Das ist der Skylab bot von E.N.I. (Mr.Help)" & @crlf & "Er hat eine coole Funktion bis jetzt ist es die einziege er schickt 24 rohstoffe jede min. wenn man 2400 auf ein mal schicken würde würde es ca. 5 Stunden dauern mit den trick kannst du statt 2400 in 5 Stunden ca. 6750 rüberschicken... Das ist mehr als das doppelte ca. 80% mehr. Du kannst dich mit dem Bot auf einnamen von 30kk gefasst machen statt 12-13kk.")
$server=InputBox("Login","Server:","Server z.B. de1")
$name=InputBox("Login","Username:","Username")
$passwort=InputBox("Login","Passwort:","Passwort")

TCPStartup()
$ip = TCPNameToIP('www.die-staemme.de')
TCPShutdown()





$post='user='&Change($name)&'&password='&Change($passwort)&'&clear=true'
$source=TCPRequest($ip,'www.die-staemme.de',0, '/index.php?action=login&server_de'&$server,$post, "")
$cookies=GetCookies($source)
msgbox ( 0, "test", $source)


  
$source=TCPRequest($ip,"de"&$server&".die-staemme.de",0, '/game.php?village=127944&screen=main&lgn=1',"",$cookies)
FileWrite("test.txt",$source) 

$session=_StringBetween($source,"upgrade_building&h=","&type=main")
$source=TCPRequest($ip,"de"&$server&".die-staemme.de",0, '/game.php?village=127944&screen=main&ajaxaction=upgrade_building&h='&$session&'&type=main&id=iron&force=1&destroy=',"",$cookies)
msgbox (0,"0",$session)






Func GetCookies($sQuellcode)
    Local $sCookies, $i, $aCookies
    $sCookies = ''
    $aCookies = _StringBetween($sQuellcode, 'Set-Cookie: ', ';', 1)
    For $i = 0 To UBound($aCookies) - 1
        $sCookies &= $aCookies[$i] & ';'
    Next
    Return $sCookies
EndFunc   ;==>GetCookies

Func TCPRequest($sIp, $sHost,$msg=0, $sSeite = "", $sPost = '', $sCookies = '', $sReferer = '', $iMaxTime = 10000)
    Local $sPacket, $iSocket, $iTimer

    If $sPost = '' Then
        $sPacket = 'GET /' & $sSeite & ' HTTP/1.1' & @CRLF
    Else
        $sPacket = 'POST /' & $sSeite & ' HTTP/1.1' & @CRLF
    EndIf
    $sPacket &= 'Host: ' & $sHost & @CRLF & _
            'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729)' & @CRLF & _
            'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' & @CRLF & _
            'Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3' & @CRLF & _
            'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7' & @CRLF & _
            'Keep-Alive: 300' & @CRLF & _
            'Content-Type: application/x-www-form-urlencoded' & @CRLF & _
            'Connection: keep-alive' & @CRLF
    If $sReferer <> '' Then
        $sPacket &= 'Referer: ' & $sReferer & @CRLF
    EndIf
    If $sCookies <> '' Then
        $sCookies=StringStripCR($sCookies)
        $sCookies=StringStripWS($sCookies,8)
        $sPacket &= 'Cookie: ' & $sCookies & @CRLF
    EndIf
    If $sPost <> '' Then
        $sPacket &= 'Content-Length: ' & StringLen($sPost) & @CRLF
    EndIf
    $sPacket &= @CRLF
    If $sPost <> '' Then
        $sPacket &= $sPost
    EndIf
    If $msg=1 Then
    MsgBox(0,"test",$sPacket)
    EndIf
    TCPStartup()
    If @error Then Return SetError(1, 0, "")
    $iSocket = TCPConnect($sIp, 80)
    If @error Then Return SetError(2, 0, "")
    TCPSend($iSocket, $sPacket)
    If @error Then Return SetError(3, 0, "")
    $iTimer = TimerInit()
    Do
        $sRecv = TCPRecv($iSocket, 1024)
        If TimerDiff($iTimer) > $iMaxTime Then Return SetError(4, 0, "")
    Until $sRecv <> ""
    Do
        $sRecv &= TCPRecv($iSocket, 1024)
    Until @error Or StringInStr($sRecv, '</html>')
    TCPCloseSocket($iSocket)
    TCPShutdown()
    Return $sRecv
EndFunc   ;==>TCPRequest

Func Change($string)
    $string = StringReplace($string, "%", "%25")
        $string = StringReplace($string, "†", "%E2%80%A0")
    $string = StringReplace($string, "ä", "%C3%A4")
    $string = StringReplace($string, "ö", "%C3%B6")
    $string = StringReplace($string, "ü", "%C3%BC")
    $string = StringReplace($string, "!", "%21")
    $string = StringReplace($string, '"', "%22")
    $string = StringReplace($string, "§", "%C2%A7")
    $string = StringReplace($string, "$", "%24")
    $string = StringReplace($string, "&", "%26")
    $string = StringReplace($string, "/", "%2F")
    $string = StringReplace($string, "+", "%2B")
    $string = StringReplace($string, " ", "+")
    $string = StringReplace($string, "(", "%28")
    $string = StringReplace($string, ")", "%29")
    $string = StringReplace($string, "=", "%3D")
    $string = StringReplace($string, "?", "%3F")
    $string = StringReplace($string, "[", "%5B")
    $string = StringReplace($string, "]", "%5D")
    $string = StringReplace($string, "{", "%7B")
    $string = StringReplace($string, "}", "%7D")
    $string = StringReplace($string, "ß", "%C3%9F")
    $string = StringReplace($string, ",", "%2C")
    $string = StringReplace($string, ":", "%3A")
    $string = StringReplace($string, ";", "%3B")
    $string = StringReplace($string, "#", "%23")
    $string = StringReplace($string, "~", "%7E")
    $string = StringReplace($string, "²", "%C2%B2")
    $string = StringReplace($string, "³", "%C2%B3")
    $string = StringReplace($string, "<", "%3C")
    $string = StringReplace($string, ">", "%3E")
    $string = StringReplace($string, "|", "%7C")
    $string = StringReplace($string, "^", "%5E")
    $string = StringReplace($string, "°", "%C2%B0")
    $string = StringReplace($string, "´", "%C2%B4")
    $string = StringReplace($string, "@", "%40")
    $string = StringReplace($string, "€", "%E2%82%AC")
    Return $string
EndFunc   ;==>Change
zwischen denn 2 sachen bei Stringbeetwen ist eine nummer die sich beim neu landen immer ändert. ich wollte es so machen wie shadow aber es geht nicht. er findent nix es kommt immer 0 wieso was hab ich falsch gemacht

Code:
$session=_StringBetween($source,"upgrade_building&h=","&type=main")
$source=TCPRequest($ip,"de"&$server&".die-staemme.de",0, '/game.php?village=127944&screen=main&ajaxaction=upgrade_building&h='&$session&'&type=main&id=iron&force=1&destroy=',"",$cookies)
Mr.Help is offline  
Old 04/18/2012, 22:37   #2
 
Achat's Avatar
 
elite*gold: 528
Join Date: Jan 2012
Posts: 2,127
Received Thanks: 2,403
Quote:
Originally Posted by Mr.Help View Post
es kommt immer 0 wieso was hab ich falsch gemacht
Code:
Success: A 0 based $array[0] contains the first found string. 
Failure: 0 
@error: 1 - No inbetween string found.
Ich würde den Quelltext der Seite irgendwo speichern und mal schauen, was sich da denn verändert hat, dass _StringBetween nichts mehr findet.

EDIT
Code:
Ich find eine [B]Vlaue[/B] nicht (autoit)
WTF? Du findest einen String nicht. Aber was ist eine "Vlaue" ?
Achat is offline  
Old 04/18/2012, 23:34   #3


 
Lawliet's Avatar
 
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
_stringbetween gibt glaub ein Array zurück. Versuch mal
Code:
if isArray($session) then 
$source=TCPRequest($ip,"de"&$server&".die-staemme.de",0, '/game.php?village=127944&screen=main&ajaxaction=upgrade_building&h='&$session[0]&'&type=main&id=iron&force=1&destroy=',"",$cookies)
Endif
Lawliet is offline  
Old 04/19/2012, 00:26   #4
 
Achat's Avatar
 
elite*gold: 528
Join Date: Jan 2012
Posts: 2,127
Received Thanks: 2,403
Da hat Lawliet! recht, du hast das Array nicht ausgelesen. Es ist nützlich, das @error auszulesen (consolewrite etc / Alt+D ? ), so hättest du dann herausgefunden, dass der Fehler nicht bei _Stringbetween, sondern wo anders liegt
Achat is offline  
Reply


Similar Threads Similar Threads
[Autoit] find memory adresse
05/18/2011 - CO2 Programming - 1 Replies
Hello everyone, can you tell me how to find the memory adresse of the x and y coordinate for conquer online LastCO private server , thank you



All times are GMT +1. The time now is 14:35.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.