InetGet Ausgabe in einer Wurst

  • Guten Tag,

    mein erster Post hier..

    Mein Problem beim InetGet Befehl ist, dass er der Inhalt der Zieldatei in einer Wurst geschrieben wird und die original Datei mit Enter in mehgrere Zeilen getrennt ist.

    [autoit]

    $hDownload1 = InetGet("http://www.kitestuff.at/weather_station/Out.txt",$localfile1,1,0)

    [/autoit]

    Ich danke euch jetzt schon und bitte um entschuldigung wenn ich blindes Huhn den Fehler nicht selber finde! 8|

    EDIT: eigenartigerweise funktioniert der zweite Befehl:

    [autoit]

    $hDownload2 = InetGet("http://www.kitestuff.at/weather_station/data.array",$localfile2,1,0)

    [/autoit]

    4 Mal editiert, zuletzt von palmers7 (14. Dezember 2012 um 11:10)

  • Soll/Original:

    Spoiler anzeigen

    2012.12.14
    07:54
    1037.8
    22.8
    35.0
    -11.6
    99.0
    0.0
    3
    ONO
    20.0
    0.0
    0

    Ist/Download:

    Spoiler anzeigen

    2012.12.1407:541037.822.835.0-11.699.00.03ONO20.00.00

  • der grund warum der zweite funktioniert ist der dateityp.

    wenn du den ersten download als out.blubb speicherst is der umruch mit drinne. wenn du es unbedingt als textdatei haben willst musst du den download wohl erst in eine variable packen und den umbruch selber noch mit reinhaun.. denk mal das entweder das \n oder das \r fehlt

    edit: (man bin ich blöd) speicher es am besten einfach als out.blubb und benenn die datei dann um in out.txt^^
    edit,edit: funktioniert garnich xD

    2 Mal editiert, zuletzt von SgtIgram (14. Dezember 2012 um 09:14)

  • @SgtIgram habe ich soeben versucht, doch habe das slebe Problem (mit notepad.exe)

    Öffne ich diese heruntergeladenen Dateien mit Wordpad sind sie wunderbar lesbar.

    Meine Funktion

    Spoiler anzeigen
    [autoit]

    $file = FileOpen("Out.text",0)
    $Datum = StringSplit(FileReadLine($file, 1),".") ;$Datum[1]=Jahr $Datum[2]=Monat $Datum[3]=Tag
    $Uhrzeit = StringSplit(FileReadLine($file, 2),":") ;$Uhrzeit[1]=Stunde $Uhrzeit[2]=Minute
    $temperatur1 = FileReadLine($file, 4)
    $temperatur2 = FileReadLine($file, 6)
    $windgeschwindigkeit = FileReadLine($file,
    $windrichtung = FileReadLine($file, 9)
    $windrichtungW = FileReadLine($file, 10)
    $windgust = FileReadLine($file, 12)
    $rain = FileReadLine($file, 13)
    FileClose("Out.text")

    [/autoit]

    kann es trotzdem nicht richtig lesen

  • Diese Datei am Server wir zuerst mit Autoit erstellt:

    Spoiler anzeigen
    [autoit]

    FileWriteLine($fileOut, $date)
    FileWriteLine($fileOut, $time)
    FileWriteLine($fileOut, $plesure)
    FileWriteLine($fileOut, $tempIn)
    FileWriteLine($fileOut, $feuchteIn)
    FileWriteLine($fileOut, $tempOut)
    FileWriteLine($fileOut, $feuchteOut)
    FileWriteLine($fileOut, $windSpeed)
    FileWriteLine($fileOut, $windDirN)
    FileWriteLine($fileOut, $windDirW)
    FileWriteLine($fileOut, $windChill)
    FileWriteLine($fileOut, $windGust)
    FileWriteLine($fileOut, $rain)

    [/autoit]

    Muss ich hierbei vlt noch @CRLF anhängen?


    Edit: Nun das Erstellscript mit &@CRLF erweitert, doch selbes Ergebnis nach download!

    Einmal editiert, zuletzt von palmers7 (14. Dezember 2012 um 10:25)

  • Erstellscript:

    Spoiler anzeigen
    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Res_Fileversion=1.2.0.0
    #AutoIt3Wrapper_Res_LegalCopyright=Palmers Julian
    #AutoIt3Wrapper_Res_Language=3079
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #cs ----------------------------------------------------------------------------
    AutoIt Version: 3.3.8.1
    Author: Palmers Julian
    Script Function:
    Aufbereitung der Rohdaten in lesefreundliches Format:
    Aufnahmedatum
    Aufnahmezeit
    Druck
    Temperatur innen
    Feuchtigkeit innen
    Temperatur außen
    Feuchtigkeit außen
    Windgeschwindigkeit
    Windrichtung nummerisch
    Windrichtung in Worten
    Windchill
    Windböen
    Regenmenge
    #ce ----------------------------------------------------------------------------
    #include <File.au3>
    While Sleep(1000)
    $In = FileFindFirstFile("Aufzeichnung*.txt")
    $In = FileFindNextFile($In)
    $Out = "Out.txt"
    $bool1 = 0
    $bool2 = 0
    #region In
    $fileIn = FileOpen($In, 0)
    If $fileIn = -1 Then
    ;MsgBox(0, "Error", "Unable to open "&$In)
    ;Exit
    Else
    ;Datum
    $line = FileReadLine($fileIn, 1)
    $line = StringTrimLeft($line, 22)
    $date = StringTrimRight($line, 6)
    ;MsgBox(0, "Line read:", $date)
    ;Uhrzeit
    $line = FileReadLine($fileIn, 1)
    $time = StringTrimLeft($line, 33)
    ;MsgBox(0, "Line read:", $time)
    ;Druck
    $line = FileReadLine($fileIn, 3)
    $plesure = StringTrimLeft($line, 7)
    ;MsgBox(0, "Line read:", $plesure)
    ;Temperatur innen
    $line = FileReadLine($fileIn, 8)
    $line = StringSplit($line, " ")
    $tempIn = $line[4]
    ;MsgBox(0, "Line read:", $tempIn)
    ;Feuchte innen
    $line = FileReadLine($fileIn, 8)
    $line = StringSplit($line, " ")
    $feuchteIn = $line[7]
    ;MsgBox(0, "Line read:", $feuchteIn)
    ;Temperatur außen
    $line = FileReadLine($fileIn, 9)
    $line = StringSplit($line, " ")
    $tempOut = $line[4]
    ;MsgBox(0, "Line read:", $tempOut)
    ;Feuchte außen
    $line = FileReadLine($fileIn, 9)
    $line = StringSplit($line, " ")
    $feuchteOut = $line[7]
    ;MsgBox(0, "Line read:", $feuchteOut)
    ;Niederschlag
    $line = FileReadLine($fileIn, 14)
    $rain = StringTrimLeft($line, 15)
    If $rain = "" Then
    $rain = 0
    EndIf
    ;MsgBox(0, "Line read:", $rain)
    ;Windgeschwindigkeit
    $line = FileReadLine($fileIn, 15)
    $line = StringSplit($line, " ")
    $windSpeed = $line[3]
    ;MsgBox(0, "Line read:", $windSpeed)
    ;Windrichtung
    $line = FileReadLine($fileIn, 15)
    $line = StringSplit($line, " ")
    Local $directions[16] = ["N", "NNO", "NO", "ONO", "O", "OSO", "SO", "SSO", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"]
    $windDirW = $directions[$line[5]]
    $windDirN = $line[5]
    ;MsgBox(0, "Line read:", $windDirW)
    ;MsgBox(0, "Line read:", $windDirN)
    ;Wind-Chill
    $line = FileReadLine($fileIn, 16)
    $line = StringSplit($line, " ")
    $windChill = $line[4]
    ;MsgBox(0, "Line read:", $windChill)
    ;Windböen
    $line = FileReadLine($fileIn, 16)
    $line = StringSplit($line, " ")
    $windGust = $line[8]
    ;MsgBox(0, "Line read:", $windGust)
    FileClose($fileIn)
    FileMove($In, @WorkingDir & "\log", 1)
    $bool1 = 1
    EndIf
    #endregion In
    #region Out
    If $bool1 Then
    $fileOut = FileOpen($Out, 2)
    If $fileOut = -1 Then
    MsgBox(0, "Error", "Unable to open "&$Out)
    $bool2=0
    ;Exit
    Else
    FileWriteLine($fileOut, $date&@CRLF)
    FileWriteLine($fileOut, $time&@CRLF)
    FileWriteLine($fileOut, $plesure&@CRLF)
    FileWriteLine($fileOut, $tempIn&@CRLF)
    FileWriteLine($fileOut, $feuchteIn&@CRLF)
    FileWriteLine($fileOut, $tempOut&@CRLF)
    FileWriteLine($fileOut, $feuchteOut&@CRLF)
    FileWriteLine($fileOut, $windSpeed&@CRLF)
    FileWriteLine($fileOut, $windDirN&@CRLF)
    FileWriteLine($fileOut, $windDirW&@CRLF)
    FileWriteLine($fileOut, $windChill&@CRLF)
    FileWriteLine($fileOut, $windGust&@CRLF)
    FileWriteLine($fileOut, $rain&@CRLF)
    FileClose($fileOut)
    FileSetTime($Out, FileGetTime($In))
    $bool2 = 1
    EndIf
    EndIf
    #endregion Out
    #region Array
    If $bool1 Then
    $Uhrzeit = StringSplit($time, ":") ;$Uhrzeit[1]=Stunde $Uhrzeit[2]=Minute)
    $hour = $Uhrzeit[1]
    $min = $Uhrzeit[2]
    $Zeit = $hour + ($min / 60) ;Uhrzeit im Dezimalformat
    $count = _FileCountLines("data.array")
    $fileData = FileOpen("data.array", 0)
    If $fileData = -1 Then
    $fileData = FileOpen("data.array", 1)
    FileClose($fileData)
    $fileData = FileOpen("data.array", 0)
    Else
    $temp1 = FileReadLine($fileData, $count - 1)
    $temp2 = StringSplit($temp1, ";")
    FileClose($fileData)
    If $temp2[1] > $Zeit Then
    FileDelete("data.array")
    EndIf
    $fileData = FileOpen("data.array", 1)
    If $fileData = -1 Then
    MsgBox(0, "Error", "Unable to open data.array.")
    ;Exit
    EndIf
    FileWriteLine($fileData, $Zeit & ";" & $windSpeed & ";" & $tempOut & ";" & $rain)
    FileClose($fileData)
    EndIf
    EndIf
    #endregion Array
    WEnd

    [/autoit]

    Downloadscript&Visio:

    Spoiler anzeigen
    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Res_Fileversion=1.0
    #AutoIt3Wrapper_Res_LegalCopyright=Palmers Julian
    #AutoIt3Wrapper_Res_Language=3079
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #cs ----------------------------------------------------------------------------
    AutoIt Version: 3.3.8.1
    Author: Palmers Julian
    Script Function:
    Dartsellung der Wetterdaten mit 5 Menütiger Aktualisierungsrate.
    Dabei muss das Wert-File folgende Struktur haben:
    Aufnahmedatum
    Aufnahmezeit
    Druck
    Temperatur innen
    Feuchtigkeit innen
    Temperatur außen
    Feuchtigkeit außen
    Windgeschwindigkeit
    Windrichtung nummerisch
    Windrichtung in Worten
    Windchill
    Windböen
    Regenmenge
    #ce ----------------------------------------------------------------------------
    #include <GDIP.au3>
    #include <GUIConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <Misc.au3>
    #include <GDIPlus.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <array.au3>
    #include <File.au3>
    $localfile1 = @TempDir&"\Out.text"
    $localfile2 = @TempDir&"\data.array"

    [/autoit] [autoit][/autoit] [autoit]

    Opt("GUIOnEventMode", 1)
    _HTTP()
    #Region Definitionen
    $sleeptime = 250 ;in ms
    $aktualisierungszeit = 0.25 ;in Minuten
    $iGUIColorBG = 0xFFEEEEEE
    $iGUIWidth = 520
    $iGUIHeight = 330
    $scaleUhr = 0.3
    $posxUhr = $iGUIWidth -75
    $posyUhr = 65
    $scaleTemp1 = 1.5
    $posxTemp1 = 60
    $posyTemp1 = 60*$scaleTemp1
    $scaleTemp2 = 1.5
    $posxTemp2 = 150
    $posyTemp2 = 60*$scaleTemp2
    $scaleTemp3 = 1.5
    $posxTemp3 = 240
    $posyTemp3 = 60*$scaleTemp3
    $posxWindR = 50
    $posyWindR = 230
    $scaleWindVy = 1.5
    $posxWindV = 150
    $posyWindV = 280
    $posxRain = 270
    $posyRain = 10
    #EndRegion Definitionen
    $hWnd = GUICreate("Wetter-Daten", $iGUIWidth, $iGUIHeight)
    GUISetState()
    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iGUIWidth, $iGUIHeight, $hGraphic)
    $hBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hBuffer, 2)
    $hGraphic2 = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    $hBitmap2 = _GDIPlus_BitmapCreateFromGraphics($iGUIWidth, $iGUIHeight, $hGraphic2)
    $hBuffer2 = _GDIPlus_ImageGetGraphicsContext($hBitmap2)
    _GDIPlus_GraphicsSetSmoothingMode($hBuffer2, 2)
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    $f = $aktualisierungszeit*60*(1000/$sleeptime)+1
    Local $Windverlauf[300][4]
    While Sleep($sleeptime)
    #Region Wertabfrage
    $temperatur3 = 0.0
    #EndRegion Wertabfrage
    $hPenHour = _GDIPlus_PenCreate(0xFF000000, 8*$scaleUhr)
    $hPenMin = _GDIPlus_PenCreate(0xFF000000, 4*$scaleUhr)
    $hPenSec = _GDIPlus_PenCreate(0xFFFF0000, 2*$scaleUhr)
    $hTemperatur = _GDIPlus_PenCreate(0xFF0000FF, 8)
    $hWindrichtung = _GDIPlus_PenCreate(0xFFFF0000, 6)
    $hEndCap = _GDIPlus_ArrowCapCreate(3,3)
    _GDIPlus_PenSetCustomEndCap ($hWindrichtung, $hEndCap)
    $hWindVBG = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
    $hTempV = _GDIPlus_BrushCreateSolid(0xFFFF0000)
    $hTempVN = _GDIPlus_PenCreate(0xFFFF0000, 1)
    $hTempVNN = _GDIPlus_PenCreate(0xFFFF9999, 1)
    $hRainV = _GDIPlus_BrushCreateSolid(0xFF0000FF)
    $hRainVN = _GDIPlus_PenCreate(0xFF0000FF)
    $hWindV = _GDIPlus_BrushCreateSolid(0xFF00FF00)
    $hWindVN = _GDIPlus_PenCreate(0xFF00FF00)
    If $f > ($aktualisierungszeit*60*(1000/$sleeptime))Then
    _HTTP()
    $file = FileOpen("Out.text",0)
    $Datum = StringSplit(FileReadLine($file, 1),".") ;$Datum[1]=Jahr $Datum[2]=Monat $Datum[3]=Tag
    $Uhrzeit = StringSplit(FileReadLine($file, 2),":") ;$Uhrzeit[1]=Stunde $Uhrzeit[2]=Minute
    $temperatur1 = FileReadLine($file, 4)
    $temperatur2 = FileReadLine($file, 6)
    $windgeschwindigkeit = FileReadLine($file, 8)
    $windrichtung = FileReadLine($file, 9)
    $windrichtungW = FileReadLine($file, 10)
    $windgust = FileReadLine($file, 12)
    $rain = FileReadLine($file, 13)
    FileClose("Out.text")
    $count = _FileCountLines("data.array")
    $fileWind = FileOpen("data.array",0)
    For $i = 1 To $count Step +1
    $temp1 = StringSplit(FileReadLine($fileWind, $i),";")
    ;MsgBox(0,"Info", $temp1[1]&" "&$temp1[2])
    $Windverlauf[$i][0] = $temp1[1]
    $Windverlauf[$i][1] = $temp1[2]
    $Windverlauf[$i][2] = $temp1[3]
    $Windverlauf[$i][3] = $temp1[4]
    ;MsgBox(0,"Info", $Windverlauf[$i][0]&" "&$Windverlauf[$i][1])
    _GDIPlus_GraphicsFillEllipse($hBuffer2, $posxWindV+$Windverlauf[$i][0]*10.2, $posyWindV-2-$Windverlauf[$i][1]*$scaleWindVy, 2, 2,$hWindV) ;Windverlauf Graph
    _GDIPlus_GraphicsFillEllipse($hBuffer2, $posxWindV+$Windverlauf[$i][0]*10.2, $posyWindV-62-$Windverlauf[$i][2]*$scaleWindVy*2, 2, 2,$hTempV) ;Außentemperaturverlauf Graph
    _GDIPlus_GraphicsFillEllipse($hBuffer2, $posxWindV+$Windverlauf[$i][0]*10.2, $posyWindV-2-$Windverlauf[$i][3]*$scaleWindVy, 2, 2,$hRainV) ;Regenverlauf Graph
    Next
    FileClose("data.array")
    $f = 0
    EndIf
    $f = $f+1
    _GDIPlus_GraphicsClear($hBuffer, $iGUIColorBG)
    #Region Uhr
    _GDIPlus_GraphicsDrawString($hBuffer,@HOUR&":"&@MIN&":"&@SEC&" "&@MDAY&"."&@MON&"."&@YEAR,$iGUIWidth-140, 130)
    _GDIPlus_GraphicsDrawString($hBuffer,"Aufnahmezeitp.: "&$Uhrzeit[1]&":"&$Uhrzeit[2]&":00 "&$Datum[3]&"."&$Datum[2]&"."&$Datum[1],$iGUIWidth-240, 155)
    _GDIPlus_GraphicsDrawLineWithAngle($hBuffer, $posxUhr, $posyUhr, 0, 0, 0, -170*$scaleUhr, @SEC * 6, $hPenSec)
    _GDIPlus_GraphicsDrawLineWithAngle($hBuffer, $posxUhr, $posyUhr, 0, 0, 0, -190*$scaleUhr, @MIN * 6, $hPenMin)
    _GDIPlus_GraphicsDrawLineWithAngle($hBuffer, $posxUhr, $posyUhr, 0, 0, 0, -140*$scaleUhr, @HOUR * 30 + @MIN * 0.5, $hPenHour)
    _GDIPlus_GraphicsFillEllipse($hBuffer, $posxUhr - (10*$scaleUhr), $posyUhr - (10*$scaleUhr), 20*$scaleUhr, 20*$scaleUhr)
    For $i=360 To 0 Step -30
    _GDIPlus_GraphicsDrawLineWithAngle($hBuffer, $posxUhr, $posyUhr, 0, 180*$scaleUhr, 0, 165*$scaleUhr, $i)
    Next
    #EndRegion Uhr
    #Region Temp1
    For $i=-30 To 30 Step +10
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxTemp1-10,$posyTemp1+$i*$scaleTemp1,$posxTemp1+10,$posyTemp1+$i*$scaleTemp1) ;Scala
    Next
    For $i=35 To -25 Step -10
    _GDIPlus_GraphicsDrawString($hBuffer,$i-5&"°", $posxTemp1-40, $posyTemp1-$i*$scaleTemp1)
    Next
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxTemp1-15,$posyTemp1+0*$scaleTemp1,$posxTemp1+15,$posyTemp1+0*$scaleTemp1) ;Scala 0°C
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxTemp1,$posyTemp1,$posxTemp1,$posyTemp1-$temperatur1*$scaleTemp1,$hTemperatur)
    _GDIPlus_GraphicsDrawString($hBuffer,"In: "&$temperatur1&" °C", $posxTemp1-50, 10)
    #EndRegion Temp1
    #Region Temp2
    For $i=-30 To 30 Step +10
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxTemp2-10,$posyTemp2+$i*$scaleTemp2,$posxTemp2+10,$posyTemp2+$i*$scaleTemp2) ;Scala
    Next
    For $i=35 To -25 Step -10
    _GDIPlus_GraphicsDrawString($hBuffer,$i-5&"°", $posxTemp2-40, $posyTemp2-$i*$scaleTemp2)
    Next
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxTemp2-15,$posyTemp2+0*$scaleTemp2,$posxTemp2+15,$posyTemp2+0*$scaleTemp2) ;Scala 0°C
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxTemp2,$posyTemp2,$posxTemp2,$posyTemp2-$temperatur2*$scaleTemp2,$hTemperatur)
    _GDIPlus_GraphicsDrawString($hBuffer,"Out: "&$temperatur2&" °C", $posxTemp2-50, 10)
    #EndRegion Temp2
    #Region Temp3
    For $i=-30 To 30 Step +10
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxTemp3-10,$posyTemp3+$i*$scaleTemp3,$posxTemp3+10,$posyTemp3+$i*$scaleTemp3) ;Scala
    Next
    For $i=35 To -25 Step -10
    _GDIPlus_GraphicsDrawString($hBuffer,$i-5&"°", $posxTemp3-40, $posyTemp3-$i*$scaleTemp3)
    Next
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxTemp3-15,$posyTemp3+0*$scaleTemp3,$posxTemp3+15,$posyTemp3+0*$scaleTemp3) ;Scala 0°C
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxTemp3,$posyTemp3,$posxTemp3,$posyTemp3-$temperatur3*$scaleTemp3,$hTemperatur)
    _GDIPlus_GraphicsDrawString($hBuffer,"Temp3: "&$temperatur3, $posxTemp3-50, 10)
    #EndRegion Temp3
    #Region Regen
    _GDIPlus_GraphicsDrawString($hBuffer,"Regen: "&$rain&" mm", $posxRain, $posyRain)
    #EndRegion Regen
    #Region Windrichtung
    _GDIPlus_GraphicsDrawLineWithAngle($hBuffer, $posxWindR, $posyWindR, 0, -28, 0, 28, 360/16*$windrichtung, $hWindrichtung)
    For $i=360 To 0 Step -22.5
    _GDIPlus_GraphicsDrawLineWithAngle($hBuffer, $posxWindR, $posyWindR, 0, 30, 0, 28, $i)
    Next
    _GDIPlus_GraphicsDrawString($hBuffer,"N", $posxWindR-5, $posyWindR-45)
    _GDIPlus_GraphicsDrawString($hBuffer,"O", $posxWindR+30, $posyWindR-10)
    _GDIPlus_GraphicsDrawString($hBuffer,"S", $posxWindR-5, $posyWindR+30)
    _GDIPlus_GraphicsDrawString($hBuffer,"W", $posxWindR-45, $posyWindR-10)
    _GDIPlus_GraphicsDrawString($hBuffer,"Windrichtung: ", $posxWindR-40, 160)
    _GDIPlus_GraphicsDrawString($hBuffer,$windrichtungW, $posxWindR-15, $posyWindR-8)
    #EndRegion Windrichtung
    #Region Windgeschwindigkeit
    _GDIPlus_GraphicsDrawString($hBuffer,"Ø"&$windgeschwindigkeit&" km/h", $posxWindR-30, $posyWindR+50)
    _GDIPlus_GraphicsDrawString($hBuffer,"^ "&$windgust&" km/h", $posxWindR-30, $posyWindR+65)
    #EndRegion Windgeschwindigkeit
    #Region Windverlauf
    _GDIPlus_GraphicsFillRect($hBuffer, $posxWindV,175,$posxWindV+120,105,$hWindVBG) ;Hintergrund
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxWindV,$posyWindV+5,$posxWindV,$posyWindV-110,$hWindVN) ;Windachse
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxWindV+270,$posyWindV+5,$posxWindV+270,$posyWindV-110,$hTempVN) ;Temperaturachse
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxWindV+10,$posyWindV-40*$scaleWindVy,$posxWindV+270,$posyWindV-40*$scaleWindVy,$hTempVNN) ;Temperatur 0°C
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxWindV+320,$posyWindV+5,$posxWindV+320,$posyWindV-110,$hRainVN) ;Regenachse
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxWindV-5,$posyWindV,$posxWindV+275,$posyWindV) ;Zeitachse
    For $i=0 To 70 Step +10
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxWindV-5,$posyWindV-$i*$scaleWindVy,$posxWindV+2,$posyWindV-$i*$scaleWindVy,$hWindVN) ;Scala Wind
    _GDIPlus_GraphicsDrawString($hBuffer,$i, $posxWindV-25, $posyWindV-($i+5)*$scaleWindVy)
    Next
    _GDIPlus_GraphicsDrawString($hBuffer,"km/h", $posxWindV-25, $posyWindV-($i+5)*$scaleWindVy)
    For $i=$posxWindV To $posxWindV+270 Step +($posxWindV+270)/20.1
    _GDIPlus_GraphicsDrawLine($hBuffer,$i,$posyWindV-2,$i,$posyWindV+5) ;Scala Zeit
    Next
    ;-------------
    For $i=-20 To 10 Step +10
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxWindV+268,$posyWindV-($i+20)*$scaleWindVy*2,$posxWindV+275,$posyWindV-($i+20)*$scaleWindVy*2,$hTempVN) ;Scala Temperatur
    _GDIPlus_GraphicsDrawString($hBuffer,$i, $posxWindV+275, $posyWindV+5-($i+25)*$scaleWindVy*2)
    Next
    _GDIPlus_GraphicsDrawString($hBuffer,"°C", $posxWindV+290, $posyWindV-70*$scaleWindVy)
    ;-------------
    For $i=0 To 70 Step +10
    _GDIPlus_GraphicsDrawLine($hBuffer,$posxWindV+318,$posyWindV-($i)*$scaleWindVy,$posxWindV+325,$posyWindV-($i)*$scaleWindVy,$hRainVN) ;Scala Regen
    _GDIPlus_GraphicsDrawString($hBuffer,$i, $posxWindV+325, $posyWindV-($i+5)*$scaleWindVy)
    Next
    _GDIPlus_GraphicsDrawString($hBuffer,"mm", $posxWindV+340, $posyWindV-70*$scaleWindVy)
    ;-------------
    For $i=0 To 24 Step 2
    _GDIPlus_GraphicsDrawString($hBuffer,$i, ($posxWindV+$i*10.2)-5, $posyWindV+10)
    Next
    _GDIPlus_GraphicsDrawString($hBuffer,"Uhr", $posxWindV+260, $posyWindV+10)
    #EndRegion Windverlauf
    _GDIPlus_GraphicsDrawLine($hBuffer,0,150,$iGUIWidth,150)
    _GDIPlus_GraphicsDrawLine($hBuffer,$iGUIWidth-150,0,$iGUIWidth-150,150)
    _GDIPlus_GraphicsDrawString($hBuffer,"© Palmers Julian 2012", $iGUIWidth - 140, $iGUIHeight - 20)
    ;hier weitere Sachen einfügen
    _GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $iGUIWidth, $iGUIHeight)
    _GDIPlus_GraphicsDrawImageRect($hGraphic2, $hBitmap2, 0, 0, $iGUIWidth, $iGUIHeight)
    WEnd
    Func _Exit()
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_GraphicsDispose($hBuffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hGraphic2)
    _GDIPlus_GraphicsDispose($hBuffer2)
    _GDIPlus_BitmapDispose($hBitmap2)
    _GDIPlus_PenDispose($hPenHour)
    _GDIPlus_PenDispose($hPenSec)
    _GDIPlus_PenDispose($hPenMin)
    _GDIPlus_Shutdown()
    Exit
    EndFunc ;==>_Exit
    Func _GDIPlus_GraphicsDrawLineWithAngle($hGraphics, $iX_Rotate, $iY_Rotate, $iX_Point1, $iY_Point1, $iX_Point2, $iY_Point2, $iAngle, $hPen = 0)
    _GDIPlus_GraphicsTranslateTransform($hGraphics, $iX_Rotate, $iY_Rotate)
    _GDIPlus_GraphicsRotateTransform($hGraphics, $iAngle)
    _GDIPlus_GraphicsDrawLine($hGraphics, $iX_Point1, $iY_Point1, $iX_Point2, $iY_Point2, $hPen)
    _GDIPlus_GraphicsResetTransform($hGraphics)
    EndFunc ;==>_GDIPlus_GraphicsDrawLineWithAngle
    Func _HTTP()
    $hDownload1 = InetGet("http://www.kitestuff.at/weather_station/Out.txt",$localfile1,1,0)
    InetClose($hDownload1)
    $hDownload2 = InetGet("http://www.kitestuff.at/weather_station/data.array",$localfile2,1,0)
    InetClose($hDownload2)
    EndFunc

    [/autoit]
  • Nutze zum downloaden

    [autoit]

    $hDownload1 = InetRead("http://www.kitestuff.at/weather_station/Out.txt",1)
    $content = BinaryToString($hDownload1)
    $content = StringSplit($content,@CRLF)
    $file = FileOpen("muh.txt",34)
    For $i = 1 To UBound($content)-1
    FileWriteLine($file,$content[$i])
    Next
    FileClose($file)

    [/autoit]
  • Ja, das "muh.txt" hat mich drauf gebracht dass ich ne doofe Kuh bin und natürlich die AnzeigeFunktion nicht auf runtergeladenen Daten zugegriffen hat sondern Daten aus nem Schwarzen loch fischen wollte. Notepad zeigt es immer noch in einer Schlange an, doch das Script funktioniert jetzt.

    :wacko:

    Danke für die Mühe und großen Dank an SgtIgram!

  • Das hier langt völlig:

    [autoit]


    $hDownload1 = InetRead("http://www.kitestuff.at/weather_station/Out.txt",1)
    FileWrite($localfile1,StringReplace(BinaryToString($hDownload1),@LF,@CRLF))

    [/autoit]

    Die Zeilenumbrüche werden serverseitig nur als @LF dargestellt (oder das @CR geht unterwegs verloren....), was unter Windows bzw im Notepad dann eben wie eine Zeile ausschaut. ;)