Hast du die bat denn auch grade mit einem anderen Programm offen?
Beiträge von TheShadowAE
-
-
Könnte man nicht eigentlich auch Run() benutzen? Oder wo ist der Unterschied zwischen shellexecute und run??
-
Schade Schade weitere Probleme diesmal sag ich was ich vorhab.
Also ich versuche Eine Art Taskmanager zu bauen.
Zu meinen Problemen:
Wenn ich die Fenster auflisten will seh ich
1. die erstmal gar nicht bis ich den anderen Tab anklicke und wieder den Anderen und
2. sehe ich nur viele gleiche Texte aber nicht die Fenstertitel die ich haben will.Spoiler anzeigen
[autoit]#NoTrayIcon
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <GuiTab.au3>$title="Taskmanaer V0.1 by TheShadowAE"
[/autoit] [autoit][/autoit] [autoit]#Region ### START Koda GUI section ### Form=D:\Progen\AutoIt\Meine\Forms\Tasks.kxf
[/autoit] [autoit][/autoit] [autoit]
$Form1 = GUICreate($title, 633, 457, 190, 120, BitOR($WS_SYSMENU,$WS_MINIMIZEBOX))
$Tab1 = GUICtrlCreateTab(8, 8, 617, 433)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("Tasks")
$List1 = GUICtrlCreateList("", 24, 40, 585, 344)
$Button1 = GUICtrlCreateButton("Button1", 24, 392, 81, 25, 0)
$TabSheet2 = GUICtrlCreateTabItem("Prozesse")
GUICtrlSetState(-1,$GUI_SHOW)
$List2 = GUICtrlCreateList("", 24, 40, 585, 344)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###$liste=winlist()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
for $x=1 to $liste[0][0]
;~ if IsVisible($liste[$x][1]) then
guictrlsetdata($List1,$liste[$x][0]&"|")
;~ EndIf
next_GUICtrlTab_SetCurSel($Tab1, 0)
[/autoit] [autoit][/autoit] [autoit]While 1
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
ExitEndSwitch
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
WEndFunc IsVisible($handle)
[/autoit] [autoit][/autoit] [autoit]
If BitAnd( WinGetState($handle), 2 ) Then
Return 1
Else
Return 0
EndIfEndFunc
[/autoit]PS: Bin noch in den Anfängen wie man sieht
-
Ich würde sagen das ist am besten mit nem Host oder einem Server
-
Ok Danke nochmal ging schnell
-
Wie in der Iberschrift geschireben versuche ich ein Tab zu aktieivern in meinem GUI.
[autoit]
Erstmal ich habe ein Tab mit 2 Tabsheets. AutoitAktiviert aber das zweite bei der Erstellung und ich krige es nicht hin das rückgängig zu machen.
In der Suche habe ich leider noch nichts gefunden.$Form1 = GUICreate($title, 633, 457, 190, 120, BitOR($WS_SYSMENU,$WS_MINIMIZEBOX))
[/autoit]
$Tab1 = GUICtrlCreateTab(8, 8, 617, 433)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("Tasks")
$List1 = GUICtrlCreateList("", 24, 40, 585, 344)
$Button1 = GUICtrlCreateButton("Button1", 24, 392, 81, 25, 0)
$TabSheet2 = GUICtrlCreateTabItem("Prozesse")
GUICtrlSetState(-1,$GUI_SHOW)
$List2 = GUICtrlCreateList("", 24, 40, 585, 344)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW) -
Ich glaub ich hab mit 11 angefangen zu programmieren. Allerdings erstmal mit DOS(QuickBasic)
(und würde ich nicht auch heute erst ins Forum gekommen sein würde ich jetzt sagen: "Herzlich Willkommen") -
syne
Dafür sind ja die Schweierigkeitsgrade
Und ich weiß nicht ob es gut ist wenn die Steine nach 10 Punkten neu setzen. Schließlichhat man dann vielleicht direkt einen vor der Nase Aber ich werde es versuchen, dass man es nicht vor die nase kriegt. -
-
Ja als ich die Funktion gemacht hab war ich noch in einer andren Programmiersprache und habe es dan einfach übersetzt, da hab ich mich noch nicht so viel mit Autoit beschäftigt
-
Ja ich habs mit der alten Version verändert und dan erst aktualisiert deswegen ist das leider jetzt noch alt^^
und danke für die Komplimente auch wenn ich nich so viel dazu gemcaht hab habs ja nur verbessert -
Hallo erstmal,
Ich bin 13 programmiere gerne (hauptsächlich blitzbasic und autoit aber auch manchmal c++ java php batch (html))
Ich bin deutsch und natürlich noch in der Schule -
hm naja stand so auf der Forumsseite vorne habe ich nicht gesehen.
-
Soweit ich das verstanden habe, willst nurein paar Mausklicks machen und dan herunterfahren.
[autoit]
[/autoit]
Mouseclick("left",xbutton1,ybutton1)
winclose("titel") oder winclose(wingettitle("")) ;titel oder aktuelles Fesnter schließen
shutdown(1)
Dann muss noch die Zeit eingebaut werden. -
Nimm doch Shellexecutewait
Und für den Ordner:
Lösch den Ordner und erstell ihn neu. -
Ich habe hier mal ein Snake gemacht angelehnt an ein Snake beim Wettbewerb (ich glaube 2006) bei dem mir etwas nicht gefallen hat und ich habe auch ein paar Sachen hinzugefügt.
Kommentar zum Dateianhang:
Snake_p.au3 ist mit Bildern.
Snake.au3 ist ohne Bilder.Code Snake.au3:
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
;left arrow 25
;up arrow 26
;right arrow 27
;down arrow 28
;space bar 20
#include <GuiConstants.au3>
#include <Array.au3>
#include <file.au3>Opt("GuiOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]if fileexists("Highscore.dat") then
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$file = FileOpen("Highscore.dat", 0)
$rett=""
while @error<>-1
$rett = $rett & FileReadLine($file) & @CRLF
wend
fileclose($file)
MsgBox(0, "Highscore", $rett)
$ertt = MsgBox(260, "Highscore", "Möchtest du die Highscore löschen?")
if $ertt=6 then
filedelete("Highscore.dat")
EndIf
endif
MsgBox(0, "Directions", "Benutze die Pfeiltasten um das Spiel zu starten, um die Schlange aufzuwachen. Benutze [SPACE] um zu pausieren.")$gui = GUICreate("Snake", 400, 420)
[/autoit] [autoit][/autoit] [autoit]
$MenuItem1 = GUICtrlCreateMenu("Schwierigkeitsgrad")
$MenuItem3 = GUICtrlCreateMenuItem("Leicht", $MenuItem1)
$MenuItem4 = GUICtrlCreateMenuItem("Mittel", $MenuItem1)
$MenuItem5 = GUICtrlCreateMenuItem("Schwer", $MenuItem1)
$men = GUICtrlCreateMenuItem("Standard", $MenuItem1)
$MenuItem2 = GUICtrlCreateMenu("Map")
$MenuItem6 = GUICtrlCreateMenuItem("Ohne Wände", $MenuItem2)
$MenuItem7 = GUICtrlCreateMenuItem("Mit Rand", $MenuItem2)
$MenuItem8 = GUICtrlCreateMenuItem("Wände", $MenuItem2)
$MenuItem9 = GUICtrlCreateMenuItem("Zufall", $MenuItem2)
$help = GUICtrlCreateMenu("Hilfe")
$about = GUICtrlCreateMenuItem("About", $help)guiseticon("fire.ico")
[/autoit] [autoit][/autoit] [autoit]
GUISetBkColor(0x005500)
GUISetState()GUISetOnEvent($gui_event_close, "_Exit")
[/autoit] [autoit][/autoit] [autoit]
GUIctrlSetOnEvent($MenuItem3,"seteasy")
GUIctrlSetOnEvent($MenuItem4,"setmid")
GUIctrlSetOnEvent($MenuItem5,"setdiff")
GUIctrlSetOnEvent($men,"setstan")GUIctrlSetOnEvent($MenuItem6,"mapno")
[/autoit] [autoit][/autoit] [autoit]
GUIctrlSetOnEvent($MenuItem7,"maprand")
GUIctrlSetOnEvent($MenuItem8,"mapwand")
GUIctrlSetOnEvent($MenuItem9,"mapzufall")GUIctrlSetOnEvent($about,"ab")
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Global $dx = 0
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Global $dy = -1
Global $clientsize = WinGetClientSize($gui)
Global $speeddef = 250
Global $speedder = 250
Global $high=50
Global $food
Global $snakelength = 1
Global $walls = 160
Dim $board[40][40]; tracks the board
Dim $snake[$snakelength + 1][3]; positions and parts of the snake
Dim $food_location[2]; not possible for multiple food locations?
Dim $wall[$walls]
Dim $wall_location[$walls][2]
Dim $map[40][40]$op = DllOpen("user32.dll")
[/autoit] [autoit][/autoit] [autoit]
mapzufall();
[/autoit] [autoit][/autoit] [autoit]
AdlibEnable("my",2500)
HotKeySet("{esc}","_Exit")
;While 1
[/autoit] [autoit][/autoit] [autoit]
Sleep($speedder)If _IsPressed(25) Then
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
if $dx<>1 Then
$dx = -1
$dy = 0
endif
EndIf
If _IsPressed(27) Then
if $dx<>-1 Then
$dx = 1
$dy = 0
EndIf
EndIf
If _IsPressed(26) Then
if $dy<>1 Then
$dx = 0
$dy = -1
EndIf
EndIf
If _IsPressed(28) Then
if $dy<>-1 Then
$dx = 0
$dy = 1
EndIf
EndIf
move()
If _IsPressed(20) Then
_sleep()
EndIf
WEndFunc _start()
[/autoit] [autoit][/autoit] [autoit]
$snakelength = 1
ReDim $snake[$snakelength + 1][3]
Local $x, $y, $a, $b, $pos
$a = Int(Random(3, 36))
$b = Int(Random(3, 36))
$snake[0][2] = GUICtrlCreateLabel("", $a * 10, $b * 10, 10, 10)
$snake[1][2] = GUICtrlCreateLabel("", $a * 10, ($b+1) * 10, 10, 10)
GUICtrlSetBkColor($snake[0][2], "0xFFFF00")
GUICtrlSetBkColor($snake[1][2], "0xFFFFFF")
$pos = ControlGetPos($gui, "", $snake[0][2])
$snake[0][0] = Int($pos[0] / 10)
$snake[0][1] = Int($pos[1] / 10)
$pos = ControlGetPos($gui, "", $snake[1][2])
$snake[1][0] = Int($pos[0] / 10)
$snake[1][1] = Int($pos[1] / 10)
;MsgBox (0, "Diagnostic", $snake[0][0] & ", " & $snake[0][1])
$board[$a][$b] = 0; snake simplifies the "can I go there?" logic
$board[$a][$b+1] = 0Do
[/autoit] [autoit][/autoit] [autoit]
$a = Int(Random(0, 39))
$b = Int(Random(0, 39))
Until $board[$a][$b] = 1; empty
$food = GUICtrlCreateLabel("", $a * 10, $b * 10, 10, 10)
$pos2 = ControlGetPos($gui, "", $food)
$food_location[0] = $pos2[0] / 10
$food_location[1] = $pos2[1] / 10
GUICtrlSetBkColor($food, "0xFF0000")
$board[$a][$b] = 2; food
EndFunc ;==>_startFunc move()
[/autoit] [autoit][/autoit] [autoit]Local $newhead[3]
[/autoit] [autoit][/autoit] [autoit]
$newhead[0] = $snake[0][0] + $dx
$newhead[1] = $snake[0][1] + $dyLocal $oldtail[3]
[/autoit] [autoit][/autoit] [autoit]
$oldtail[0] = $snake[$snakelength][0]
$oldtail[1] = $snake[$snakelength][1]
$oldtail[2] = $snake[$snakelength][2]if $newhead[0] < 0 then $newhead[0]=39
[/autoit] [autoit][/autoit] [autoit]
if $newhead[0] > 39 then $newhead[0]=0
if $newhead[1] < 0 then $newhead[1]=39
if $newhead[1] > 39 then $newhead[1]=0Select
[/autoit] [autoit][/autoit] [autoit]
Case $board[$newhead[0]][$newhead[1]]=1 or $board[$newhead[0]][$newhead[1]]=2; OK to go there
$newhead[2] = GUICtrlCreateLabel("", $newhead[0] * 10, $newhead[1] * 10, 10, 10)
GUICtrlSetBkColor($newhead[2], "0xFFFF00")
If $board[$newhead[0]][$newhead[1]] = 2 Then; Ate Food
; Move food
Do
$a = Int(Random(0, 39))
$b = Int(Random(0, 39))
Until $board[$a][$b] = 1; empty
$board[$a][$b] = 2; food
GUICtrlSetPos($food, $a * 10, $b * 10)
$snakelength = $snakelength + 1
ReDim $snake[$snakelength + 1][3]
ElseIf $board[$newhead[0]][$newhead[1]] = 5 Then;wall
If $snakelength > 1 Then
MsgBox(0, "Your snake ate the wall.", "VERLOREN! Deine Schlange war "& ($snakelength + 1) & " punkte lang")
$input = InputBox("Highscrore", "Dein Name")
FileWrite("Highscore.dat", $input & " hat "& ($snakelength + 1) & " Punkte erreicht!" & @CRLF)
Else
MsgBox(0, "Your snake ate the wall.", "You should play with your snake more.")
EndIf
_cleanup()
Else
GUICtrlDelete($oldtail[2])
$board[$oldtail[0]][$oldtail[1]] = 1
EndIf
$board[$newhead[0]][$newhead[1]] = 0
For $i = $snakelength To 1 Step - 1; Array shift
$snake[$i][0] = $snake[$i - 1][0]
$snake[$i][1] = $snake[$i - 1][1]
$snake[$i][2] = $snake[$i - 1][2]
GUICtrlSetBkColor($snake[$i][2],"0xFFFFFF")
Next
$snake[0][0] = $newhead[0]
$snake[0][1] = $newhead[1]
$snake[0][2] = $newhead[2]
Case Else
If $snakelength > 1 Then
MsgBox(0, "Your snake ate the wall.", "VERLOREN! Deine Schlange war "& ($snakelength + 1) & " punkte lang")
$input = InputBox("Highscrore", "Dein Name")
FileWrite("Highscore.dat", $input & " hat "& ($snakelength + 1) & " Punkte erreicht!" & @CRLF)
Else
MsgBox(0, "Your snake ate the wall.", "You should play with your snake more.")
EndIf
_cleanup()
EndSelect
EndFunc ;==>moveFunc _cleanup()
[/autoit] [autoit][/autoit] [autoit]
For $x=0 to $walls-1
GUICtrlDelete($wall[$x])
Next$zahl=0
[/autoit] [autoit][/autoit] [autoit]
For $x = 0 To 39
For $y = 0 To 39
$board[$x][$y] = $map[$x][$y]
if $map[$x][$y]=5 then
if $zahl+1>$walls then _Exit()
$wall[$zahl] = GUICtrlCreateLabel("", $x * 10, $y * 10, 10, 10)
$pos3 = ControlGetPos($gui, "", $wall[$zahl])
$wall_location[$zahl][0] = $pos3[0] / 10
$wall_location[$zahl][1] = $pos3[1] / 10
GUICtrlSetBkColor($wall[$zahl], "0x00FF00")
$zahl=$zahl+1
endif
Next
NextGUICtrlDelete($food)
[/autoit] [autoit][/autoit] [autoit]For $i = 0 To $snakelength
[/autoit] [autoit][/autoit] [autoit]
GUICtrlDelete($snake[$i][2])
Next$speedder=$speeddef
[/autoit] [autoit][/autoit] [autoit]
$dx=0
$dy=-1_start() ; This is going to choke after 300 something calls
[/autoit] [autoit][/autoit] [autoit]
_sleep()
EndFunc ;==>_cleanupFunc _Exit()
[/autoit] [autoit][/autoit] [autoit]
DllClose($op)
AdlibDisable()
Exit
EndFunc ;==>_ExitFunc _sleep()
[/autoit] [autoit][/autoit] [autoit]
AdlibDisable()
Do
Do
Sleep(100)
Until _IsPressed(25) Or _IsPressed(26) Or _IsPressed(27) Or _IsPressed(28)
If _IsPressed(25) Then
if $dx<>1 Then
$dx = -1
$dy = 0
endif
EndIf
If _IsPressed(27) Then
if $dx<>-1 Then
$dx = 1
$dy = 0
EndIf
EndIf
If _IsPressed(26) Then
if $dy<>1 Then
$dx = 0
$dy = -1
EndIf
EndIf
If _IsPressed(28) Then
if $dy<>-1 Then
$dx = 0
$dy = 1
EndIf
EndIf
Until _IsPressed(25) Or _IsPressed(26) Or _IsPressed(27) Or _IsPressed(28)
AdlibEnable("my",2500)
EndFunc ;==>_sleepFunc _IsPressed($hexkey)
[/autoit] [autoit][/autoit] [autoit]
Local $ar, $brv
$hexkey = '0x' & $hexkey
$ar = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexkey)If $ar[0] <> 0 Then
[/autoit] [autoit][/autoit] [autoit]
$brv = 1
Else
$brv = 0
EndIfReturn $brv
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_IsPressed;
[/autoit] [autoit][/autoit] [autoit]
Func my()
if $speedder>$high then $speedder=$speedder-5
EndFuncFunc seteasy()
[/autoit] [autoit][/autoit] [autoit]
$speeddef=250
$speedder=250
$high=150
_cleanup()
EndFuncFunc setmid()
[/autoit] [autoit][/autoit] [autoit]
$speeddef=150
$speedder=150
$high=100
_cleanup()
EndFuncFunc setdiff()
[/autoit] [autoit][/autoit] [autoit]
$speeddef=100
$speedder=100
$high=50
_cleanup()
EndFuncFunc setstan()
[/autoit] [autoit][/autoit] [autoit]
$speeddef=250
$speedder=250
$high=50
_cleanup()
EndFuncFunc mapno()
[/autoit] [autoit][/autoit] [autoit]
for $x=0 to 39
for $y=0 to 39
$map[$x][$y]=1
Next
Next_cleanup()
[/autoit] [autoit][/autoit] [autoit]
EndFuncFunc maprand()
[/autoit] [autoit][/autoit] [autoit]
for $x=0 to 39
for $y=0 to 39
$map[$x][$y]=1
Next
Nextfor $x=0 to 39
[/autoit] [autoit][/autoit] [autoit]
$map[$x][0]=5
next
for $y=0 to 39
$map[0][$y]=5
next
for $x=0 to 39
$map[$x][39]=5
next
for $y=0 to 39
$map[39][$y]=5
next_cleanup()
[/autoit] [autoit][/autoit] [autoit]
EndFuncFunc mapwand()
[/autoit] [autoit][/autoit] [autoit]
for $x=0 to 39
for $y=0 to 39
$map[$x][$y]=1
Next
Nextfor $x=7 to 14
[/autoit] [autoit][/autoit] [autoit]
$map[$x][14]=5
next
for $y=7 to 14
$map[14][$y]=5
next
for $x=7 to 14
$map[$x][27]=5
next
for $y=7 to 14
$map[27][$y]=5
nextfor $x=23 to 30
[/autoit] [autoit][/autoit] [autoit]
$map[$x][10]=5
next
for $y=23 to 30
$map[10][$y]=5
next
for $x=23 to 30
$map[$x][23]=5
next
for $y=23 to 30
$map[23][$y]=5
next_cleanup()
[/autoit] [autoit][/autoit] [autoit]
EndFuncFunc mapzufall()
[/autoit] [autoit][/autoit] [autoit]
for $x=0 to 39
for $y=0 to 39
$map[$x][$y]=1
Next
Nextfor $x=0 to 39
[/autoit] [autoit][/autoit] [autoit]
Do
$a = Int(Random(0, 39))
$b = Int(Random(0, 39))
Until $map[$a][$b] = 1; empty
$map[$a][$b] = 5; wall
next_cleanup()
[/autoit] [autoit][/autoit] [autoit]
EndFuncFunc ab()
[/autoit]
msgbox(0,"About","Version: 2.0")
EndFunc
EDIT:
Das Icon hab ich leider verloren, aber das macht ja zum Glück keinen Fehler -
Nicht sehr groß nd nützlich, aber für bestimmte Zwecke zu gebrauchen.
Ist auch schon was älter. -
Carsten
Wenn du
if _isPressed(hex($i,4)) then MyExit($i)
durch
if _isPressed(hex($i,4)) then MyExit(chr($i))
ersetzt sieht man auch direkt welche Taste