Hi, schau dir mal das hier an.
Ich behaupte jetzt einfach mal, dass man SD-Karten in etwa auf die selbe Art und Weise auslesen kann.
MfG, James
Hi, schau dir mal das hier an.
Ich behaupte jetzt einfach mal, dass man SD-Karten in etwa auf die selbe Art und Weise auslesen kann.
MfG, James
Naja, du könntest auf mehr oder weniger einfache Art und Weise aus den einzelnen Objekten wieder "normale" Funktionen machen, je nach Länge der UDF dauert das natürlich seine Zeit.
Überleg dir einfach wie du die einzelnen Befehle normalerweise schreiben würdest.
MfG, James
Auch von mir frohe Weihnachten.
BugFix : Ich bin da ganz deiner Meinung!
Du musst 2*π anstatt 2 nehmen, oder du arbeitest gleich in Grad:
[autoit]Global Const $PI = 3.1415926535897932384626433832795
Global Const $DegToRad = $PI / 180
$mx = 0
$my = 0
$radius = 1
For $i = 0 To 259 Step 1 ; oder auch To 2*$PI
$x = $mx + Cos($i*$DegToRad)*$radius ; dann aber überall nur
$y = $my + Sin($i*$DegToRad)*$radius ; $i statt $i*$DegToRad
;...
Next
MfG, James C.
Na dann auch von mir alles Gute.
BLinz: In 6 Jahren hat AutoIt (hoffentlich) Linux-Support, also kann uns das egal sein.
Das könnte dir auch weiterhelfen.
MfG, James C.
Wirklich einfach:
Ich würde alle x Minuten folgenden cmd-Befehl ausführen:
Zum Beispiel so (oder ähnlich):
$File = FileOpen(@ScriptDir & '\killtask.bat', 2)
FileWrite($File, 'taskkill /f /fi "status eq not responding"')
FileClose($File)
While Sleep(30000)
RunWait(@ScriptDir & '\killtask.bat', @SystemDir, @SW_HIDE)
WEnd
MfG, James C.
Der Server könnte die Daten auslesen, die die Skripte mit ConsoleWrite() in die Konsole schreiben.
; Demonstriert StdoutRead()
#include <Constants.au3>
Local $foo = Run(@ComSpec & " /c dir foo.bar", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
Local $line
While 1
$line = StdoutRead($foo)
If @error Then ExitLoop
MsgBox(0, "STDOUT gelesen:", $line)
WEnd
While 1
$line = StderrRead($foo)
If @error Then ExitLoop
MsgBox(0, "STDERR gelesen:", $line)
WEnd
MsgBox(0, "Debug", "Wie aufregend...")
[/autoit]
MfG, James C.
Versuchs doch mal mit einer Breite/Höhe > 0.
MfG, James
Oder am besten gleich _IsPressed nehmen, dann gibts solche Probleme erst gar nicht.
MfG, James C.
Auch von mir alles Gute zum Geburtstag!
Hier nur mal eine kleine Ansammlung von Funktionen die vielleicht dem Ein oder Anderen helfen könnten:
#include-once
#include <GDIPlus.au3>
#comments-start
====================================================================================================
Name: GUICtrlMaths.au3
Author: James1337
====================================================================================================
#comments-end
Func _GUICtrlMaths_Startup()
Local $q = _GDIPlus_Startup()
SetError(@error, @extended)
Return $q
EndFunc
Func _GUICtrlMaths_Shutdown()
Local $q = _GDIPlus_Shutdown()
SetError(@error, @extended)
Return $q
EndFunc
Func _GUICtrlMaths_Create($hWnd, $left, $top, $width, $height, $size=2)
If $size < 1 Or $size > 8 Then
SetError(1)
Return 0
EndIf
Local $graphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
Local $bitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $graphics)
Local $buffer = _GDIPlus_ImageGetGraphicsContext($bitmap)
Local $controls[3] = [$graphics, $bitmap, $buffer]
Local $position[4] = [$left, $top, $width, $height]
Local $atext, $lines = Floor($height/(10+$size*5))
Dim $atext[$lines]
Local $maths[4] = [$controls, $position, $size, $atext]
Return $maths
EndFunc
Func _GUICtrlMaths_Delete(ByRef $maths)
$array1 = $maths[0]
_GDIPlus_GraphicsDispose($array1[2])
_GDIPlus_BitmapDispose($array1[1])
_GDIPlus_GraphicsDispose($array1[0])
$maths = 0
Return True
EndFunc
Func _GUICtrlMaths_SetText(ByRef $maths, $text, $line=0)
Local $position = $maths[1], $atext = $maths[3]
If $line < 1 Then
Local $_text, $lines = Floor($position[3]/(10+$maths[2]*5))
Dim $_text[$lines]
$atext = $_text
$line = 1
EndIf
$atext[$line-1] = ''
For $i = 1 To StringLen($text) Step 1
If StringMid($text, $i, 1) = '\' Then
If StringMid($text, $i+1, 1) = 'n' Then
$line += 1
If UBound($atext) < $line Then
SetError(1)
Return False
EndIf
$atext[$line-1] = ''
$i += 1
Else
$atext[$line-1] &= StringMid($text, $i, 1)
EndIf
Else
$atext[$line-1] &= StringMid($text, $i, 1)
EndIf
Next
$maths[1] = $position
$maths[3] = $atext
Return True
EndFunc
Func _GUICtrlMaths_Draw(ByRef $maths)
Local $controls = $maths[0], $position = $maths[1], $atext = $maths[3]
_GDIPlus_GraphicsClear($controls[2], 0xFFFFFFFF)
Local $size = 10+$maths[2]*5, $i
For $i = 1 To Floor($position[2]/$size) Step 1
_GDIPlus_GraphicsDrawLine($controls[2], $i*$size, 0, $i*$size, $position[3], 0)
Next
For $i = 1 To Floor($position[3]/$size) Step 1
_GDIPlus_GraphicsDrawLine($controls[2], 0, $i*$size, $position[2], $i*$size, 0)
Next
$fsize = Floor($size*0.64)
For $i = 0 To UBound($atext)-1 Step 1
If $atext[$i] = '' Then
ExitLoop
EndIf
For $j = 1 To StringLen($atext[$i]) Step 1
Switch StringMid($atext[$i], $j, 1)
Case ' ', @TAB, @CR, @LF
ContinueLoop
Case Else
_GDIPlus_GraphicsDrawString($controls[2], StringMid($atext[$i], $j, 1), ($j-1)*$size+($size/$fsize)*2, $i*$size+($size/$fsize), 'Courier New', $fsize, 0x0020)
EndSwitch
Next
Next
_GDIPlus_GraphicsDrawImageRect($controls[0], $controls[1], $position[0], $position[1], $position[2], $position[3])
$maths[0] = $controls
$maths[1] = $position
Return
EndFunc
Und hier noch ein Beispiel:
#include "GUICtrlMaths.au3"
[/autoit] [autoit][/autoit] [autoit]_GUICtrlMaths_Startup()
[/autoit] [autoit][/autoit] [autoit]$Gui = GUICreate('GUICtrlMaths by James1337', 400, 300)
$Graphic = _GUICtrlMaths_Create($Gui, 15, 15, 370, 245)
$Input = GUICtrlCreateInput('H\n e\n l\n l\n o\nWorld!', 20, 270, 200, 20)
$Button = GUICtrlCreateButton('Draw', 240, 270, 100, 20)
GUISetState(@SW_SHOW, $Gui)
_GUICtrlMaths_SetText($Graphic, 'GUICtrlMaths\n \n © James1337\n \n \n 123 | $A\n+ 321 | +$B\n----- | ---\n 444 | $C', 0)
_GUICtrlMaths_Draw($Graphic)
Do
$Msg = GUIGetMsg()
If $Msg = $Button Then
_GUICtrlMaths_SetText($Graphic, GUICtrlRead($Input), 0)
_GUICtrlMaths_Draw($Graphic)
EndIf
Until $Msg = -3
_GUICtrlMaths_Delete($Graphic)
_GUICtrlMaths_Shutdown()
Exit
Func _StringLeft($String, $Left)
If StringLeft($String, StringLen($Left)) = $Left Then
Return True
Else
Return False
EndIf
EndFunc
Func _StringRight($String, $Right)
If StringRight($String, StringLen($Right)) = $Right Then
Return True
Else
Return False
EndIf
EndFunc
Func _StringTrimLeft($String, $Left)
If _StringLeft($String, $Left) Then
Return StringTrimLeft($String, StringLen($Left))
Else
SetError(1)
Return $String
EndIf
EndFunc
Func _StringTrimRight($String, $Right)
If _StringRight($String, $Right) Then
Return StringTrimRight($String, StringLen($Right))
Else
SetError(1)
Return $String
EndIf
EndFunc
MfG, James C.
Ok das wusste ich jetzt zum Beispiel nicht (außer die GUI in Windows)
Aber solange du / ihr versteht was ich meine dann ist es doch gut^^
Formats a disk for use with Windows.
FORMAT volume [/FS:file-system] [/V:label] [/Q] [/A:size] [/C] [/X] [/P:passes] [/S:state]
FORMAT volume [/V:label] [/Q] [/F:size] [/P:passes]
FORMAT volume [/V:label] [/Q] [/T:tracks /N:sectors] [/P:passes]
FORMAT volume [/V:label] [/Q] [/P:passes]
FORMAT volume [/Q]
volume Specifies the drive letter (followed by a colon),
mount point, or volume name.
/FS:filesystem Specifies the type of the file system (FAT, FAT32, exFAT, NTFS,
or UDF).
/V:label Specifies the volume label.
/Q Performs a quick format. Note that this switch overrides /P.
/C NTFS only: Files created on the new volume will be compressed
by default.
/X Forces the volume to dismount first if necessary. All opened
handles to the volume would no longer be valid.
/R:revision UDF only: Forces the format to a specific UDF version
(1.02, 1.50, 2.00, 2.01, 2.50). The default
revision is 2.01.
/D UDF 2.50 only: Metadata will be duplicated.
/A:size Overrides the default allocation unit size. Default settings
are strongly recommended for general use.
NTFS supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K.
FAT supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K,
(128K, 256K for sector size > 512 bytes).
FAT32 supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K,
(128K, 256K for sector size > 512 bytes).
exFAT supports 512, 1024, 2048, 4096, 8192, 16K, 32K, 64K,
128K, 256K, 512K, 1M, 2M, 4M, 8M, 16M, 32M.
Note that the FAT and FAT32 files systems impose the
following restrictions on the number of clusters on a volume:
FAT: Number of clusters <= 65526
FAT32: 65526 < Number of clusters < 4177918
Format will immediately stop processing if it decides that
the above requirements cannot be met using the specified
cluster size.
NTFS compression is not supported for allocation unit sizes
above 4096.
/F:size Specifies the size of the floppy disk to format (1.44)
/T:tracks Specifies the number of tracks per disk side.
/N:sectors Specifies the number of sectors per track.
/P:passes Zero every sector on the volume passes times. This switch is
not valid with /Q
/S:state Where "state" is either "enable" or "disable"
Short names are enabled by default
Alles anzeigen
Gib doch mal in CMD "FORMAT /?" ein.
Sogesehen hat i2c Recht, da gibt es eine ganze Menge Möglichkeiten.
Edit:
Ist gut
Ich habe es schon unbenannt
Deine Lösung ist ja auch etwas kreativer als cmd...
wie sollte ich es dann eurer meinung nach umbenennen?
Wie wärs mit
_FileDeleteAll
[/autoit]MfG, James
Sehr gutes Skript, da kann ich wieder was lernen.
Allerdings habe ich trotzdem noch einige Verbesserungsvorschläge:
1) _Betrag() durch Abs() ersetzen
2) man kann das Program nicht beenden und wenn das im Skript richtig erkenne, wird es sobald der Apfel komplett ist, geschlossen3) bei 1x1 Rechtecken könnte man auch gleich
Func _GDIPlus_BitmapSetPixel($hBitmap, $iX, $iY, $iARGB = 0xFF000000)
Global $ghGDIPDll
Local $aRet
$aRet = DllCall($ghGDIPDll, "int", "GdipBitmapSetPixel", "hwnd", $hBitmap, "int", $iX, "int", $iY, "dword", $iARGB)
Return
EndFunc
benutzen, wobei ich nicht glaube, dass es dann schneller wäre
4) das wäre ein gutes Beispiel für OpenCl
MfG, James C.
PS: Ich bin ein Fan von Skripten mit Mathematik und/oder Physik...
Und wenn du den Timestamp trotzdem aus dem Internet willst, versuchs mal mit den diversen Zeit-Server, u. a. von Microsoft.
MfG, James C.