Stringsplit sollte dir helfen:
[autoit]
#include <Array.au3>
$string = "XX:XX²:XX³"
$asplit = StringSplit($string, ":")
_ArrayDisplay($asplit)
Stringsplit sollte dir helfen:
[autoit]
#include <Array.au3>
$string = "XX:XX²:XX³"
$asplit = StringSplit($string, ":")
_ArrayDisplay($asplit)
$fileread = "12334" &"i" & "dfhdfhdfh" &"i" &"3445" &"i" & "fffffffggg" &"iii"
$search = "i"
$count = 0
$pos = 1
While 1
$searchpos = StringInStr($fileread, $search, 0, 1, $pos)
If $searchpos Then
$count += 1
$pos = $searchpos + 1
Else
ExitLoop
EndIf
WEnd
MsgBox (0, "", "Anzahl von " & $search & " : " & $count)
[/autoit]
Etwas optimiert.
Oder auch mit Stringsplit:
[autoit]
$fileread = "12334" &"i" & "dfhdfhdfh" &"i" &"3445" &"i" & "fffffffggg" &"iii"
$search = "i"
$asplit = StringSplit($fileread, $search)
MsgBox (0, "", "Anzahl von " & $search & " : " & $asplit[0] -1)
Sehr cool, eröffnet ganz neue Möglichkeiten zur Mediaverwaltung, Diashow usw.
Der nächste Schritt wäre eine Kreisbewegung zu simulieren, vielleicht mit 3D Effekt?
Und funktioniert die UDF?
So?
#include <GUIConstantsEx.au3>
GUICreate(" Uhrzeit")
$gui = GUICreate('', 200, 200, -1, -1)
$Button1 = GUICtrlCreateButton("Klick Mich", 48, 164, 104, 17, 0)
$1 = GUICtrlCreateLabel("", 48, 124, 64, 17)
$2 = GUICtrlCreateLabel("", 48, 144, 84, 17)
; "" kein Eintrag, da hier die Uhrzeit eingesetzt wird
GUISetState()
_a1(); Beginn der Funktion mit Start des Programms ! einmalig !
AdlibEnable("_a1", 1000); Start der Funktion ! alle 1000 ms !
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Button1
_Funktion1()
_Funktion2()
EndSwitch
WEnd
Func _a1()
GUICtrlSetData($2, @HOUR & ":" & @MIN & ":" & @SEC)
GUICtrlSetData($1, @MDAY & "." & @MON & "." & @YEAR)
; Ende
EndFunc ;==>a1
Func _Funktion1()
;Dein Code
endfunc
Func _Funktion2()
;Dein Code
endfunc
Hm ok. Meinst du sowas? Ist ein Risiko, denn wenn es keine Lösung gibt hängt das Skript in der Schleife fest
global $x = 0
while 1
;Term: 2x +1 = 9
if $x <> (9-1)/2 Then
$x += 1
else
MsgBox(1, "Lösung", "Die Lösung ist: " & $x)
ExitLoop
EndIf
Sleep(100)
wend
exit
[/autoit]
Vielleicht hat Stilgar da ne Idee.
Sieht so aus: YouTube -API Schnittstelle für FireFox (FF.au3)
Könntest du das Problem mathematisch umschreiben? Vielleicht gibts was viel besseres als ausprobieren.
Der erste Versuch (schon wieder rausgenommen) war fehlerhaft.
So ungefähr klappts jetzt ![]()
Bsp.: (Skripte natürlich noch trennen)
;Script2 -> Sender
#include "MessageHandler.au3"
$Local_ReceiverID_Name = "Script2sReceiverID";This is the ID that the other script will use to send data
$Remote_ReceiverID_Name = "Script1sReceiverID";This is the ID of the script we want to send data too
$hwnd = _SetAsReceiver($Local_ReceiverID_Name)
ConsoleWrite("hwnd of the Local_ReceiverID_Name is " & $hwnd & @crlf)
$myFunc = _SetReceiverFunction("_MyFunc2")
ConsoleWrite("My data receiver function is " & $myFunc & @crlf)
$Str = InputBox(@ScriptName," I am " & @ScriptName & @crlf & "Enter some data to be sent to the other script")
[/autoit] [autoit][/autoit] [autoit]$iSent = _SendData($Str,$Remote_ReceiverID_Name)
[/autoit] [autoit][/autoit] [autoit]While 1
sleep(100)
WEnd
Func _MyFunc2($vText)
Msgbox(0,@ScriptName,@ScriptName & " has received a message" & @crlf & $vText)
Exit
EndFunc
;Script1 -> Empfänger
#include "MessageHandler.au3"
$Local_ReceiverID_Name = "Script1sReceiverID";This is the ID that the other script will use to send data
$Remote_ReceiverID_Name = "Script2sReceiverID";This is the ID of the script we want to send data too
$hwnd = _SetAsReceiver($Local_ReceiverID_Name)
ConsoleWrite("hwnd of the Local_ReceiverID_Name is " & $hwnd & @crlf)
$myFunc = _SetReceiverFunction("_MyFunc2")
ConsoleWrite("My data receiver function is " & $myFunc & @crlf)
While 1
Sleep(1000)
WEnd
Func _MyFunc2($vText)
Msgbox(0,@ScriptName,"I am " & @ScriptName & " I have received some data" & @crlf & @crlf & $vText & @crlf & @crlf & "And now I'm sending the data back")
$iSent = _SendData($vText,$Remote_ReceiverID_Name)
Exit
EndFunc
Nee das ist der Beweis, dass es Sinn machen kann eine aufwendige Funktion in ein zweites Skript auszulagern.
Autoit ist nicht Multithread-fähig.
Die Anzeige ist irreführend.
Hö? Du hast mit deinem Skript einen Kern 100% ausgelastet.
Mach mal 2 von den Skripten und weise jedes einem Core zu.
Dann sinds 100% Auslastung ![]()
Hab mein Vorschlag mal in Code umgesetzt.
Ist total buggy, komme jetzt zeitlich leider nicht zu mehr.
Zum veranschaulichen aber vielleicht praktisch.
edit \ So ists schöner:
#include <WindowsConstants.au3>
#Include <Constants.au3>
#include <GuiConstants.au3>
#include <Misc.au3>
#include <IE.au3>
#include <Array.au3>
#include <WinAPI.au3>
#include <GuiConstantsEx.au3>
#include <Color.au3>
#include <IrrlichtPluginUtils.au3>
#NoTrayIcon
Opt ('MouseCoordMode', 0)
[/autoit] [autoit][/autoit] [autoit]HotKeySet('{Esc}', '_Ende')
[/autoit] [autoit][/autoit] [autoit]Global Const $opt_binken = False
Global Const $opt_spiegelung = True
Global $Titel = "Spiele Center by Moritz1243 ;-)"
[/autoit] [autoit][/autoit] [autoit]Global Const $INI = @ScriptDir & "\Info.ini"
Global Const $CONFIG = @ScriptDir & "\Config.ini"
Global Const $Bilder_dir = @ScriptDir & "\Bilder\"
Global Const $Spiel_dir = @ScriptDir & "\Verknüpfungen\"
Global $datei[1][1], $icon[1], $name[1], $position, $mouse_pos, $mouse_pos_now, $max, $bewegung, $bewegung_letzte
Global $button_autostart, $button_exit
Local $aktuelles_spiel, $letztes_spiel, $spiel_blinken
Local $Icon_Position[1]
Global $Icon_Distance = 30
Local $msg
;Local $Font = "Comic Sans MS"
Local $Font = "Arial"
Global $icolor_red = Number(IniRead(@scriptdir & "\config.ini","Config","Hintergrund Farbe Rot",-1))
Global $icolor_green = Number(IniRead(@scriptdir & "\config.ini","Config","Hintergrund Farbe Gruen",-1))
Global $icolor_blue = Number(IniRead(@scriptdir & "\config.ini","Config","Hintergrund Farbe Blau",-1))
If $icolor_red = -1 Then
IniWrite($CONFIG,"Config","Hintergrund Farbe Rot",64)
IniWrite($CONFIG,"Config","Hintergrund Farbe Gruen",64)
IniWrite($CONFIG,"Config","Hintergrund Farbe Blau",255)
$icolor_red = 64
$icolor_green = 64
$icolor_blue = 255
EndIf
Global $switch[4]
[/autoit] [autoit][/autoit] [autoit]Global $Reload
[/autoit] [autoit][/autoit] [autoit]Global $width = 1024
Global $height = 600
Global $Flow_type = IniRead($CONFIG,"Config","Flow Type",-1)
If $Flow_type = -1 Then
IniWrite($CONFIG,"Config","Flow Type",1)
$Flow_type = 1
EndIf
Global $Window_type = IniRead($CONFIG,"Config","Window_type",-1)
If $Window_type = -1 Then
IniWrite($CONFIG,"Config","Window_type",1)
$Window_type = 1
EndIf
Global $BK_type = IniRead($CONFIG,"Config","BK_type",-1)
If $BK_type = -1 Then
IniWrite($CONFIG,"Config","BK_type",1)
$BK_type = 1
EndIf
If $Window_type = 0 Then Global $Hwnd = CreateLayeredDevice("SpieleCenter", 0,@DesktopHeight * 1 / 8, @DesktopWidth, @DesktopHeight * 6 / 8,255, 0, 128, 0 )
If $Window_type = 1 Then Global $Hwnd = CreateDevice($EDT_DIRECT3D9, 1024, 600, 16, 0, 0, 0)
If $Window_type = 2 Then Global $Hwnd = CreateDevice($EDT_DIRECT3D9, @DesktopWidth,@DesktopHeight, 32, True, 0, 0)
SetWindowCaption($Titel)
WinSetOnTop($Hwnd, "", 1 )
Global $Timer_aktive = IniRead($CONFIG,"Config","Timer",-1)
If $Timer_aktive = -1 Then
IniWrite($CONFIG,"Config","Timer",1)
$Timer_aktive = 1
EndIf
Local $compare[2]
[/autoit] [autoit][/autoit] [autoit]Global $Camera = AddCameraSceneNode(0, 0, 0, 250, 0, 0, 0)
[/autoit] [autoit][/autoit] [autoit]Global $Light1 = AddLightSceneNode( 0, -1000, 1000, -1000, 0, 0, 0, 0 )
Global $SLight = AddNewSLight( 1, 50, 1, 500, 3000, $ELT_POINT)
SetSLightSpecularColor( $SLight, 0.1, 0.1, 0.1 )
SetLightData( $Light1, $SLight )
Global $Light2 = AddLightSceneNode( 0, 1000, 1000, 1000, 0, 0, 0, 0 )
SetLightData( $Light2, $SLight )
Global $Bilder[1]
Global $Node[1]
Global $Node_Back[1]
Global $Bilder_alpha[1]
Global $search_txt
[/autoit] [autoit][/autoit] [autoit]Global $Info_Text = AddStaticText("", 422, 200, 602, 400); [, Border [, WordWrap [, iParent [, FillBackground ]]]] )
Global $Button_Einstellungen = AddImage(GetTexture($Bilder_dir & "einstellungen.png"), $width - 58, $height - 58)
draw(0)
Global $anzahl_spiele
Spiele_laden()
Global $Particle[1][4]
Global $Node_Particle[1]
Global $Anzahl_Particle = 120
Global $Partikel_onoff = IniRead($CONFIG,"Config","Partikel",-1)
If $Partikel_onoff = -1 Then
IniWrite($CONFIG,"Config","Partikel",1)
$Partikel_onoff = 1
EndIf
If $Partikel_onoff = 1 Then _particle_create()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]ReDim $icon[$max + 1]
ReDim $name[$max + 1]
ReDim $Icon_Position[$max + 1]
draw(0)
[/autoit] [autoit][/autoit] [autoit]AdlibEnable("_bus",12)
[/autoit] [autoit][/autoit] [autoit]While True
[/autoit] [autoit][/autoit] [autoit]If WinActive($Titel) Then
[/autoit] [autoit][/autoit] [autoit]If _IsPressed("0D") Then Spiel_starten($aktuelles_spiel)
[/autoit] [autoit][/autoit] [autoit]; $compare[0] = GUICtrlRead($search)
[/autoit] [autoit][/autoit] [autoit]If $compare[0] <> $compare[1] Then
$compare[1] = $compare[0]
;If $compare[0] <> "search" And $compare[0] <> "" Then
For $i = 0 To $Max Step 1
$search_txt = $compare[0]
If StringLeft($datei[$i][2],StringLen($compare[0])) = StringLeft($compare[0],StringLen($compare[0])) Then
$Bewegung = $Icon_Distance * -$i
$position = $bewegung
;draw($Bewegung)
$aktuelles_spiel = Int((-$bewegung + 15) / $Icon_Distance)
If $aktuelles_spiel > $max - 1 Then $aktuelles_spiel = $max - 1
If $aktuelles_spiel < 0 Then $aktuelles_spiel = 0
; GUICtrlSetData($info_titel, $datei[$aktuelles_spiel][2])
ExitLoop
EndIf
Next
;EndIf
EndIf
If _IsPressed ("01") Then
$mouse_pos_now = MouseGetPos()
If $mouse_pos_now[0] > $width - 58 And $mouse_pos_now[0] < $width - 10 Then
If $mouse_pos_now[1] > $height - 58 And $mouse_pos_now[1] < $height - 10 Then einstellungen()
EndIf
If Mod(-$Bewegung,$Icon_Distance) = 0 Then
SetText($info_text,"")
SetRotation($Node[$aktuelles_spiel],0,0,0)
EndIf
$mouse_pos = MouseGetPos(0)
Local $coll = GetSceneNodeFromScreenCoordinatesBB(MouseGetPos(0),MouseGetPos(1))
For $i = 0 To $max Step 1
If $coll = $Node[$i] Or $coll = $Node_Back[$i] Then Spiel_starten($i)
Next
Do
$mouse_pos_now = MouseGetPos(0)
$bewegung = ($mouse_pos_now - $mouse_pos) + $position
If $bewegung < -($max - 1) * $Icon_Distance Then $bewegung = -($max - 1) * $Icon_Distance
If $bewegung > 0 Then $bewegung = 0
ConsoleWrite($bewegung & @CRLF)
$aktuelles_spiel = Int((-$bewegung + 15) / $Icon_Distance)
If $aktuelles_spiel > $max - 1 Then $aktuelles_spiel = $max - 1
If $aktuelles_spiel < 0 Then $aktuelles_spiel = 0
If $aktuelles_spiel <> $letztes_spiel Then
$letztes_spiel = $aktuelles_spiel
EndIf
If $bewegung <> $bewegung_letzte Then
$bewegung_letzte = $bewegung
ConsoleWrite($bewegung & @CRLF)
draw($Bewegung)
EndIf
Sleep(5)
[/autoit] [autoit][/autoit] [autoit]Until Not _IsPressed ("01")
[/autoit] [autoit][/autoit] [autoit]$position = $bewegung
EndIf
If _IsPressed ("02") Then
$mouse_pos = MouseGetPos(0)
Local $coll = GetSceneNodeFromScreenCoordinatesBB(MouseGetPos(0),MouseGetPos(1))
While Mod(-$Bewegung,$Icon_Distance) <> 0
If Mod(-$Bewegung,$Icon_Distance) < $Icon_Distance / 2 Then
$Bewegung += 1
Else
$Bewegung -= 1
EndIf
draw($Bewegung)
; ToolTip($Bewegung & " Mod: " & Mod(-$Bewegung,$Icon_Distance) & " < " & $Icon_Distance)
WEnd
$aktuelles_spiel = Int((-$bewegung + 15) / $Icon_Distance)
For $i = 0 To $max Step 1
If $coll = $Node[$i] Then;-329 49 < 70
For $deg = 0 To 180 Step 5
BeginScene(True, True, 0, $icolor_red,$icolor_green,$icolor_blue)
SetRotation($Node[$aktuelles_spiel],0,$deg,0)
SceneDraw()
GuiDraw()
EndScene()
Sleep(5)
Next
Local $process = StringSplit ($datei[$aktuelles_spiel][0], "\")
Local $Spielzeit = IniRead(@ScriptDir & "\info.ini","Log",$process[$process[0]],0)
SetText($info_text,"Spiel: " & $datei[$aktuelles_spiel][2] & @LF _
& @LF _
& "Spielzeit: " & _sec_to_time_string($Spielzeit) & @LF _
& "Gespielt: " & IniRead(@ScriptDir & "\info.ini","Spiele",$datei[$aktuelles_spiel][2],0) - 1 & " mal" & @LF _
& "Dateipfad: " & $datei[$aktuelles_spiel][0])
EndIf
If $coll = $Node_Back[$i] Then
SetText($info_text,"")
For $deg = 180 To 360 Step 5
BeginScene(True, True, 0, $icolor_red,$icolor_green,$icolor_blue)
SetRotation($Node[$aktuelles_spiel],0,$deg,0)
SceneDraw()
GuiDraw()
EndScene()
Sleep(5)
Next
EndIf
Next
EndIf
If _IsPressed("27") then
sleep(50)
ConsoleWrite($bewegung & @CRLF)
If $bewegung=0 then
do
$bewegung -=10
draw($bewegung)
until $bewegung= -($max - 1) * $Icon_Distance
;draw($bewegung)
Else
for $i = 1 to 14
$bewegung += 5
Draw($bewegung)
next
EndIf
endif
If _IsPressed("25") then
sleep(50)
ConsoleWrite($bewegung & @CRLF)
If $bewegung=-($max - 1) * $Icon_Distance then
do
$bewegung +=10
draw($bewegung)
until $bewegung=0
;draw($bewegung)
Else
for $i = 1 to 14
$bewegung -= 5
Draw($bewegung)
next
EndIf
endif
; draw($Bewegung)
EndIf
[/autoit] [autoit][/autoit] [autoit]Sleep(5)
[/autoit] [autoit][/autoit] [autoit]WEnd
[/autoit] [autoit][/autoit] [autoit]Func Spiele_laden()
[/autoit] [autoit][/autoit] [autoit]Local $search, $desti, $compare
; $Ordner = FileSelectFolder("Ordner wählen", "",2)
; $Ordner = "C:\Dokumente und Einstellungen\Moritz\Desktop\Spiele"
Local $isearch = FileFindFirstFile($Spiel_dir & "*.lnk")
If $isearch = -1 Then Return 0
While True
Local $type = FileFindNextFile($isearch)
If @error Then ExitLoop
$anzahl_spiele += 1
WEnd
FileClose($search)
$search = FileFindFirstFile($Spiel_dir & "*.lnk")
[/autoit] [autoit][/autoit] [autoit]While 1
ReDim $datei[$max + 1][5]
ReDim $Bilder[$max + 1]
ReDim $Bilder_alpha[$max + 1]
ReDim $node[$max + 1]
ReDim $Node_Back[$max + 1]
$datei[$max][0] = FileFindNextFile($search)
If @error Then ExitLoop
$datei[$max][1] = $datei[$max][1]
$datei[$max][2] = StringTrimRight ($datei[$max][0], 4)
If IniRead($INI,"Spiele",$datei[$max][2],0) = 0 Then
$Reload = True
IniWrite($INI,"Spiele",$datei[$max][2],1)
EndIf
If StringRight ($datei[$max][0],3) = "lnk" Then
$desti = FileGetShortcut($Spiel_dir & $datei[$max][0])
$datei[$max][0] = $desti[0]
$datei[$max][1] = $desti[1]
$datei[$max][3] = $desti[4]
$datei[$max][4] = $desti[5]
EndIf
$Node[$max] = AddCubeSceneNode(100)
$Node_Back[$max] = AddCubeSceneNode(101,$Node[$max])
SetMaterialTexture($Node_Back[$max], 0, GetTexture($Bilder_dir & "\back.jpg"))
SetPosition($Node_Back[$max],0,0,-5)
SetScale($Node[$max], 1, 1.5, 0.1)
$Bilder[$max] = GetTexture($Bilder_dir & "\" & $datei[$max][2] & ".jpg")
SetMaterialTexture($Node[$max], 0, $Bilder[$max])
SetMaterialFlag($Node[$max], $EMF_LIGHTING, 0 )
SetScale($Node[$max], 1, 1.5, 0.1)
; $Bilder[$max] = _GDIPlus_ImageLoadFromFile($Ordner & "\temp\" & $datei[$max][2] & ".jpg")
; $Bilder_alpha[$max] = _GDIPlus_ImageLoadFromFile($Ordner & "\temp\" & $datei[$max][2] & "_alpha.jpg")
; MsgBox(0,"",$bilder[$max])
$max += 1
ToolTip("Load ... " & Int($max / $anzahl_spiele * 100) & "%")
WEnd
ToolTip("")
; _ArrayDisplay($datei)
FileClose($search)
EndFunc
[/autoit] [autoit][/autoit] [autoit]Func Draw($wegi)
[/autoit] [autoit][/autoit] [autoit]BeginScene(True, True, 0, $icolor_red,$icolor_green,$icolor_blue)
; $icolor_red = Mod($icolor_red + random(0,5,1),255)
; $icolor_green = Mod($icolor_green + random(0,5,1),255)
; $icolor_blue = Mod($icolor_blue + random(0,5,1),255)
Local $pi_div_180 = 4 * ATan(1) / 180
Local $xi, $yi
Local $aktuelles = Int((-$bewegung + 15) / $Icon_Distance)
[/autoit] [autoit][/autoit] [autoit]Switch $flow_type
[/autoit] [autoit][/autoit] [autoit]Case 0
$Icon_Distance = 30
For $i = 0 To $max Step 1
$Icon_Position[$i] = $wegi + $i * $Icon_Distance
If $Icon_Position[$i] > -90 And $Icon_Position[$i] < 90 Then
SetVisible($Node[$i], 1)
$xi = Sin (-$Icon_Position[$i] * $pi_div_180) * 200
$yi = Cos (-$Icon_Position[$i] * $pi_div_180) * 60
SetPosition( $Node[$i], $xi / 2 * 8/10,0,$yi)
[/autoit] [autoit][/autoit] [autoit]Else
SetVisible($Node[$i], 0)
EndIf
Next
[/autoit] [autoit][/autoit] [autoit]Case 1
$Icon_Distance = 70
For $i = 0 To $max Step 1
; If $Icon_Position[$i] > -90 And $Icon_Position[$i] < 0 Then $bewegung += 1
$Icon_Position[$i] = $wegi + $i * $Icon_Distance
; If $i > $aktuelles Then $Icon_Position[$i] += 50
; If $i < $aktuelles Then $Icon_Position[$i] -= 50
; If $Icon_Position[$i] > -45 And $Icon_Position[$i] < 0 Then
; $bewegung += 1
; ElseIf $Icon_Position[$i] < 45 And $Icon_Position[$i] > 0 Then
; $bewegung -= 1
; EndIf
If $Icon_Position[$i] > -90 And $Icon_Position[$i] < 90 Then
SetRotation($Node[$i],0,-$Icon_Position[$i],0)
SetPosition($Node[$i],$Icon_Position[$i],0,(90 - Abs($Icon_Position[$i])) / 2)
ElseIf $Icon_Position[$i] > 0 Then
SetRotation($Node[$i],0,-90,0)
SetPosition($Node[$i],$Icon_Position[$i],0,0)
Else
SetRotation($Node[$i],0,90,0)
SetPosition($Node[$i],$Icon_Position[$i],0,0)
EndIf
Next
EndSwitch
SceneDraw( )
GuiDraw( )
EndScene( )
[/autoit] [autoit][/autoit] [autoit]EndFunc
[/autoit] [autoit][/autoit] [autoit]Func _Bus()
BeginScene(True, True, 0, $icolor_red,$icolor_green,$icolor_blue)
If $BK_type = 1 Then _bk_change_color()
If $Partikel_onoff = 1 Then _particle()
SceneDraw()
GuiDraw()
EndScene()
EndFunc
Func Spiel_starten($iSpiel)
If MsgBox(4,"","Wollen Sie " & $datei[$iSpiel][2] & " wirklich starten?") = 6 Then
IniWrite($INI,"Spiele",$datei[$iSpiel][2],IniRead($INI,"Spiele",$datei[$iSpiel][2],1) + 1)
ShellExecute($datei[$iSpiel][0],"",$datei[$iSpiel][1])
FileDelete(@scriptdir & "\commandline.cl")
If $Timer_aktive = 1 Then
Local $string = StringSplit ($datei[$iSpiel][0], "\")
FileWrite(@scriptdir & "\commandline.cl",$String[$string[0]])
ShellExecute("timer.exe","",@ScriptDir)
EndIf
Exit
EndIf
EndFunc
Func _bk_change_color()
If $switch[3] = 0 Then
$switch[3] = 5
If $switch[0] = 0 Then
$icolor_red += 1
Else
$icolor_red -= 1
EndIf
If $icolor_red >= 255 Then
$icolor_red = 255
$switch[0] = 1
EndIf
If $icolor_red <= 0 Then
$icolor_red = 0
$switch[0] = 0
EndIf
If $switch[1] = 0 Then
$icolor_green += 2
Else
$icolor_green -= 2
EndIf
If $icolor_green >= 255 Then
$icolor_green = 255
$switch[1] = 1
EndIf
If $icolor_green <= 0 Then
$icolor_green = 0
$switch[1] = 0
EndIf
If $switch[2] = 0 Then
$icolor_blue += 3
Else
$icolor_blue -= 3
EndIf
If $icolor_blue >= 255 Then
$icolor_blue = 255
$switch[2] = 1
EndIf
If $icolor_blue <= 0 Then
$icolor_blue = 0
$switch[2] = 0
EndIf
Else
$switch[3] -= 1
EndIf
EndFunc
[/autoit] [autoit][/autoit] [autoit]Func Einstellungen()
[/autoit] [autoit][/autoit] [autoit]AdlibDisable()
[/autoit] [autoit][/autoit] [autoit]Local $Gui_Ein = GUICreate("Einstellungen",280,400)
Local $check_partikel = GUICtrlCreateCheckbox("Partikel",10,10,200,20)
If IniRead($CONFIG,"Config","Partikel",0) = 1 Then GUICtrlSetState($check_partikel, $GUI_CHECKED)
Local $check_bkchange = GUICtrlCreateCheckbox("Hintergrundfarbenwechsel",10,50,200,20)
If IniRead($CONFIG,"Config","BK_type",0) = 1 Then GUICtrlSetState($check_bkchange, $GUI_CHECKED)
Local $check_timer = GUICtrlCreateCheckbox("Timer",10,90,200,20)
If IniRead($CONFIG,"Config","Timer",0) = 1 Then GUICtrlSetState($check_timer, $GUI_CHECKED)
Local $button_save = GUICtrlCreateButton("Speichern",100,300,80,40)
GUICtrlCreateLabel("BK Farbe",150,135,50,20)
Local $input_c_red = GUICtrlCreateInput($icolor_red,10,130,40,20)
Local $input_c_green = GUICtrlCreateInput($icolor_green,60,130,40,20)
Local $input_c_blue = GUICtrlCreateInput($icolor_blue,110,130,40,20)
Local $set[4]
GUISetState(@SW_SHOW)
While True
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $button_save
If GUICtrlRead($check_partikel) = 4 Then
$set[0] = 0
Else
$set[0] = 1
EndIf
IniWrite($CONFIG,"Config","Partikel",$set[0])
If $Partikel_onoff <> $set[0] Then
If $Partikel_onoff = 0 Then
_particle_create()
Else
_particle_delete()
EndIf
$Partikel_onoff = $set[0]
EndIf
If GUICtrlRead($check_bkchange) = 4 Then
$set[1] = 0
Else
$set[1] = 1
EndIf
IniWrite($CONFIG,"Config","BK_type",$set[1])
$BK_type = $set[1]
If GUICtrlRead($check_timer) = 4 Then
$set[2] = 0
Else
$set[2] = 1
EndIf
IniWrite($CONFIG,"Config","Timer",$set[2])
$Timer_aktive = $set[2]
$icolor_red = Number(GUICtrlRead($input_c_red))
$icolor_green = Number(GUICtrlRead($input_c_green))
$icolor_blue = Number(GUICtrlRead($input_c_blue))
IniWrite(@scriptdir & "\config.ini","Config","Hintergrund Farbe Rot",$icolor_red)
IniWrite(@scriptdir & "\config.ini","Config","Hintergrund Farbe Gruen",$icolor_green)
IniWrite(@scriptdir & "\config.ini","Config","Hintergrund Farbe Blau",$icolor_blue)
EndSwitch
WEnd
GUIDelete($Gui_Ein)
AdlibEnable("_bus",12)
EndFunc
Func _particle_create()
[/autoit] [autoit][/autoit] [autoit]ReDim $Node_Particle[$Anzahl_Particle]
ReDim $Particle[$Anzahl_Particle][4]
For $i = 0 To 119 Step 1
$Node_Particle[$i] = AddCubeSceneNode(Random(1,4,1))
; $Node_Particle[$i] = AddSphereSceneNode(Random(1,2,1), 20)
$particle[$i][0] = Random(-200,200,1)
$particle[$i][1] = Random(-200,200,1)
$particle[$i][2] = Random(-200,300,1)
$particle[$i][3] = Random(1,4,1)
SetPosition($Node_Particle[$i],$particle[$i][0],$particle[$i][1],-$particle[$i][2])
Next
EndFunc
[/autoit] [autoit][/autoit] [autoit]Func _particle()
[/autoit] [autoit][/autoit] [autoit]For $i = 0 To UBound($particle) - 1 Step 1
If $particle[$i][2] < -300 Then ; Wenn es auf der z-achse kleiner also -200 ist
$particle[$i][0] = Random(-200,200,1)
$particle[$i][1] = Random(-200,200,1)
$particle[$i][2] = Random(200,300,1)
$particle[$i][3] = Random(1,4,1)
Else
$particle[$i][2] -= $particle[$i][3]
EndIf
SetPosition($Node_Particle[$i],$particle[$i][0],$particle[$i][1],-$particle[$i][2])
Next
EndFunc
Func _particle_delete()
For $i = 0 To UBound($Node_Particle) - 2 Step 1
Remove($Node_Particle[$i])
Next
SetVisible($Node_Particle[UBound($Node_Particle) - 1],0)
EndFunc
Func _Bild_Suche($iTitel)
[/autoit] [autoit][/autoit] [autoit]_IEErrorHandlerRegister ()
[/autoit] [autoit][/autoit] [autoit]$oIE = _IECreateEmbedded ()
GUICreate("Embedded Web control Test", 640, 480, _
(@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)
$GUI_Button_Back = GUICtrlCreateButton("Back", 10, 420, 100, 30)
$GUI_Button_Forward = GUICtrlCreateButton("Forward", 120, 420, 100, 30)
$GUI_Button_Home = GUICtrlCreateButton("Home", 230, 420, 100, 30)
$GUI_Button_Stop = GUICtrlCreateButton("Stop", 340, 420, 100, 30)
GUISetState()
[/autoit] [autoit][/autoit] [autoit]_IENavigate ($oIE, "http://images.google.de/")
$oForm = _IEFormGetObjByName($oIE, "f")
$oQuery = _IEFormElementGetObjByName($oForm, "q")
_IEFormElementSetValue($oQuery, $iTitel)
_IEFormSubmit($oForm)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_Button_Home
_IENavigate ($oIE, "http://images.google.de/")
Case $msg = $GUI_Button_Back
_IEAction ($oIE, "back")
Case $msg = $GUI_Button_Forward
_IEAction ($oIE, "forward")
Case $msg = $GUI_Button_Stop
_IEAction ($oIE, "stop")
EndSelect
WEnd
GUIDelete()
[/autoit] [autoit][/autoit] [autoit]EndFunc
[/autoit] [autoit][/autoit] [autoit]Func _sec_to_time_string($isec)
Local $string = Int($isec / 3600) & " h " & Int(Mod($isec,3600) / 60) & " min " & Mod(Mod($isec,3600),60) & " sec"
Return $string
EndFunc
Func _Ende()
Exit
EndFunc
Grml jetzt gehts. Könnte schwören vorhin kam ne Fehlermeldung ![]()
Also mein Vorschlag wäre schon Anzahl unbhängig gedacht. Eben damit man nicht an ein rechtes / linkes Ende stößt, sondern sich im Kreis bewegt.
Vielleicht kann ich morgen mal ein Bsp. machen.
P.S. Bei mir meckert Winrar wegen dem fehlenden dritten part (bei der neustens Version).
Mhm Bildbearbeitung am PC ist nicht so meine Stärke.
Im "Standardflowmodus" bewegt man die Bilder mit der gedrückten Maustatse (links).
Irgendwann ist dann eines der Bilder zentriert, diese Position könnte man auch mit den Pfeiltasten erreichen (ohne fließenden Übergang zwischen den Bildern).
Für die Kreisdrehung mal ein Bild im Anhang
Zahlen = Bilder, Pfeile sollen Bewegung darstellen.
Auch cool wäre wenn sich die Bilder quasi im Kreis drehen würden (letztes Bild erreicht -> weiter gehts mit dem ersten) und man mit den Pfeiltasten zum nächsten Springen könnte.
Kann man auch selbst einbauen, imho aber nicht sooo unsinnig ![]()
P.S. Die Irrlichtengine ist auf jeden Fall super, danke für das Beispiel!
Genau und Ubound brauchst du auch nicht.
Definiere eine Variable durch GUICtrlRead($Input_Bis)
Mit dieser wird dann das Array deklariert und die Schleife festgelegt.