Hey,
ich möchte wie im Titel beschrieben ein Bild rechts oder links IN der MsgBox drinne haben, also nicht dieses kleine Shortcut oben sondern beim Text. Wie kann ich das machen?
Mfg
Beiträge von Nakroma
-
-
also zu deinem problem mit dem button 1 hab ich was:
[autoit]Func list1()
[/autoit]
$search = FileFindFirstFile(".\music\*.*")
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
GUICtrlSetData($list1,$file)
WEnd
FileClose($search)
EndFuncEs findet alle Files in /music und kopiert sie in list1 bis keine datei mehr vorhanden ist

-
Spoiler anzeigen
[autoit]#cs ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]AutoIt Version: 3.3.6.1
[/autoit] [autoit][/autoit] [autoit]
Author: NakromaScript Function:
[/autoit] [autoit][/autoit] [autoit]
FightEnginge for Wave RPG#ce ----------------------------------------------------------------------------
[/autoit] [autoit][/autoit] [autoit]
Opt("GUIOnEventMode", 1)
#include <./au3/GDIpProgress.au3>$p_x = 300
[/autoit] [autoit][/autoit] [autoit]
$p_y = 300$e_x = 800
[/autoit] [autoit][/autoit] [autoit]
$e_y = 300$action = False
[/autoit] [autoit][/autoit] [autoit]
$stand = "right"
$enemystate = "live"HotKeySet("{ESC}", "close")
[/autoit] [autoit][/autoit] [autoit]
HotKeySet("d", "walk_right")
HotKeySet("a", "walk_left")
HotKeySet("w", "walk_up")
HotKeySet("s", "walk_down")
HotKeySet("{SPACE}", "sword")
HotKeySet("r", "fireball")$gui = GUICreate("Wave FightEngine", 1000, 864)
[/autoit] [autoit][/autoit] [autoit]
GUISetBkColor(0xFFFFFF)
$player = GUICtrlCreatePic("./poses/stand_right.gif", $p_x, $p_y, 24, 62)
$balken = GUICtrlCreatePic("./img/balken.gif", 0, 800, 1000, 64)
$w = GUICtrlCreatePic("./img/w.gif", 0, 800, 64, 64)
$progress1 = _ProgressCreate(70, 800, 200, 32, 0x3cb371)
$progress2 = _ProgressCreate(70, 832, 200, 32, 0x6495ed, 0x6495ed)
_ProgressSet($progress1, IniRead("./ini/stats.ini", "allgemein", "leben", 100))
_ProgressSet($progress2, IniRead("./ini/stats.ini", "allgemein", "mana", 100))
GUISetState(@SW_SHOW)
$mana = IniRead("./ini/stats.ini", "allgemein", "mana", 100)
$life = IniRead("./ini/stats.ini", "allgemein", "leben", 100)
read()
terrain_secretiland()While 1
[/autoit] [autoit][/autoit] [autoit]
WEndFunc close()
[/autoit] [autoit][/autoit] [autoit]
Exit
EndFuncFunc walk_right()
[/autoit] [autoit][/autoit] [autoit]
If $action = False Then
$action = True
$p_x += 10
If $p_x > 976 Then $p_x = 976
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/walk_right_right.gif", $p_x, $p_y, 24, 62)
$p_x += 10
If $p_x > 976 Then $p_x = 976
Sleep(100)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/walk_right_left.gif", $p_x, $p_y, 24, 62)
Sleep(100)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/stand_right.gif", $p_x, $p_y, 24, 62)
$stand = "right"
$action = False
Else
Return
EndIf
EndFuncFunc walk_left()
[/autoit] [autoit][/autoit] [autoit]
If $action = False Then
$action = True
$p_x -= 10
If $p_x < 0 Then $p_x = 0
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/walk_left_right.gif", $p_x, $p_y, 24, 62)
$p_x -= 10
If $p_x < 0 Then $p_x = 0
Sleep(100)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/walk_left_left.gif", $p_x, $p_y, 24, 62)
Sleep(100)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/stand_left.gif", $p_x, $p_y, 24, 62)
$stand = "left"
$action = False
Else
Return
EndIf
EndFuncFunc walk_up()
[/autoit] [autoit][/autoit] [autoit]
If $action = False Then
$action = True
$p_y -= 10
If $p_y < 0 Then $p_y = 0
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/walk_up_right.gif", $p_x, $p_y, 32, 62)
$p_y -= 10
If $p_y < 0 Then $p_y = 0
Sleep(100)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/walk_up_left.gif", $p_x, $p_y, 32, 62)
Sleep(100)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/stand_up.gif", $p_x, $p_y, 32, 62)
$stand = "up"
$action = False
Else
Return
EndIf
EndFuncFunc walk_down()
[/autoit] [autoit][/autoit] [autoit]
If $action = False Then
$action = True
$p_y += 10
If $p_y > 738 Then $p_y = 738
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/walk_down_right.gif", $p_x, $p_y, 32, 62)
$p_y += 10
If $p_y > 738 Then $p_y = 738
Sleep(100)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/walk_down_left.gif", $p_x, $p_y, 32, 62)
Sleep(100)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/stand_down.gif", $p_x, $p_y, 32, 62)
$stand = "down"
$action = False
Else
Return
EndIf
EndFuncFunc sword()
[/autoit] [autoit][/autoit] [autoit]
If $action = False Then
If $stand = "left" Then
$action = True
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/attack/left_sword1.gif", $p_x, $p_y, 52, 62)
Sleep(80)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/attack/left_sword2.gif", $p_x, $p_y, 48, 62)
Sleep(80)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/attack/left_sword3.gif", $p_x, $p_y, 32, 62)
Sleep(80)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/attack/left_sword4.gif", $p_x - 25, $p_y, 60, 62)
get_sword($p_x - 25, $p_y, 60, 62, $e_x, $e_y, 24, 62)
Sleep(80)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/attack/left_sword5.gif", $p_x - 29, $p_y, 64, 62)
get_sword($p_x - 29, $p_y, 64, 62, $e_x, $e_y, 24, 62)
Sleep(80)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/attack/left_sword6.gif", $p_x - 23, $p_y, 58, 62)
get_sword($p_x - 23, $p_y, 58, 62, $e_x, $e_y, 24, 62)
Sleep(80)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/stand_left.gif", $p_x, $p_y, 24, 62)
$action = False
ElseIf $stand = "right" Then
$action = True
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/attack/right_sword1.gif", $p_x - 27, $p_y, 52, 62)
Sleep(80)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/attack/right_sword2.gif", $p_x - 21, $p_y, 48, 62)
Sleep(80)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/attack/right_sword3.gif", $p_x, $p_y, 32, 62)
Sleep(80)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/attack/right_sword4.gif", $p_x, $p_y, 60, 62)
get_sword($p_x, $p_y, 60, 62, $e_x, $e_y, 24, 62)
Sleep(80)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/attack/right_sword5.gif", $p_x, $p_y, 64, 62)
get_sword($p_x, $p_y, 64, 62, $e_x, $e_y, 24, 62)
Sleep(80)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/attack/right_sword6.gif", $p_x, $p_y, 58, 62)
get_sword($p_x, $p_y, 58, 62, $e_x, $e_y, 24, 62)
Sleep(80)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/stand_right.gif", $p_x, $p_y, 24, 62)
$action = False
EndIf
Else
Return
EndIf
EndFuncFunc fireball()
[/autoit] [autoit][/autoit] [autoit]
If $action = False Then
If mana_take(10) = False Then Return
If $stand = "right" Then
$action = "true"
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/attack/right_fire.gif", $p_x, $p_y, 40, 62)
Sleep(100)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/stand_right.gif", $p_x, $p_y, 24, 62)
$s_x = $p_x + 24
$spell = GUICtrlCreatePic("./poses/attack/fireball_right.gif", $s_x, $p_y, 51, 31)
For $i = 0 To 20
Sleep(20)
$s_x += 10
GUICtrlSetPos($spell, $s_x, $p_y)
Next
GUICtrlDelete($spell)
ElseIf $stand = "left" Then
$action = "true"
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/attack/left_fire.gif", $p_x, $p_y, 40, 62)
Sleep(100)
GUICtrlDelete($player)
$player = GUICtrlCreatePic("./poses/stand_left.gif", $p_x, $p_y, 24, 62)
$s_x = $p_x - 24
$spell = GUICtrlCreatePic("./poses/attack/fireball_left.gif", $s_x, $p_y, 51, 31)
For $i = 0 To 20
Sleep(20)
$s_x -= 10
GUICtrlSetPos($spell, $s_x, $p_y)
Next
GUICtrlDelete($spell)
EndIf
$action = False
Else
Return
EndIf
EndFunc;~ Func zombie()
[/autoit] [autoit][/autoit] [autoit]
;~ If $enemystate = "live" Then
;~ $e_x -= 10
;~ If $e_x < 0 Then $e_x = 0
;~ GUICtrlDelete($enemy)
;~ $enemy = GUICtrlCreatePic("./poses/enemy/zombie/walk_left_right.gif", $e_x, $e_y, 24, 62)
;~ $e_x -= 10
;~ If $e_x < 0 Then $e_x = 0
;~ Sleep(150)
;~ GUICtrlDelete($enemy)
;~ $enemy = GUICtrlCreatePic("./poses/enemy/zombie/walk_left_left.gif", $e_x, $e_y, 24, 62)
;~ Sleep(150)
;~ GUICtrlDelete($enemy)
;~ $enemy = GUICtrlCreatePic("./poses/enemy/zombie/stand_left.gif", $e_x, $e_y, 24, 62)
;~ Sleep(1000)
;~ Else
;~ Return
;~ EndIf
;~ EndFuncFunc get_sword($x1, $y1, $b1, $h1, $x2, $y2, $b2, $h2)
[/autoit] [autoit][/autoit] [autoit]
If ($x1 + $b1 > $x2 And $y1 + $h1 > $y2 And $x1 < $x2 + $b2 And $y1 < $y2 + $h2) Then
If $enemystate = "live" Then
GUICtrlDelete($enemy)
$enemy = GUICtrlCreatePic("./poses/enemy/zombie/death1.gif", $e_x, $e_y + 42, 64, 24)
$enemystate = "death"
EndIf
Else
Return
EndIf
EndFuncFunc mana_take($take)
[/autoit] [autoit][/autoit] [autoit]
If $mana - $take < 0 Then
Return False
Else
Return True
$mana -= $take
write()
EndIf
EndFuncFunc read()
[/autoit] [autoit][/autoit] [autoit]
$mana = IniRead("./ini/stats.ini", "allgemein", "mana", 100)
$life = IniRead("./ini/stats.ini", "allgemein", "leben", 100)
EndFuncFunc write()
[/autoit] [autoit][/autoit] [autoit]
IniWrite("./ini/stats.ini", "allgemein", "mana", $mana)
IniWrite("./ini/stats.ini", "allgemein", "leben", $life)
_ProgressSet($progress1, IniRead("./ini/stats.ini", "allgemein", "leben", 100))
_ProgressSet($progress2, IniRead("./ini/stats.ini", "allgemein", "mana", 100))
EndFuncFunc terrain_secretiland()
[/autoit]
$house1 = GUICtrlCreatePic("./terrain/haus1.gif", 500, 500, 152, 272)
EndFuncIch will das Männchen(Player)vor House1 haben
-
Das Problem ist, ich erstell die Bilder(Wegen Laufbewegung)ja immer neu, also eig. immer NACH dem Gebäude, allerdings ist das Gebäude trotzdem immer vor der Figur
-
Und was wenn ich fragen darf?
-
Steht da, in einer GUI
-
Hey,
Ich hätte gerne das meine Figur IMMER vor allen anderen Bildern in der GUI steht. Also das die Figur im Vordergrund ist.
Gibts da irgendwas dafür?
Mfg -
Danke, das funktioniert nun
-
was sind in deinem beispiel h und b?
-
Also bei mir funktionierts nicht, wenn du willst kann ich dir meinen code schicken

-
Bei mir leider nicht
-
PosX1 ist Bild 1
PosX2 ist Bild 2
Mit Size genauso oder? -
Ja, die befinden sich auf einer GUI. Größe und so sind natürlich vorhanden.
-
Hey,
gibt es eine einfache Möglichkeit zu kontrollieren ob 2 Bilder sich berühren? Z.b. dein Schwert und ein Zombie?
Ich hab schon mehrere Sachen ausprobiert, allerdings funktioniert das nicht ganz recht.
Hilfe wäre nett,
Mfg -
Code:
[autoit]
[/autoit]
Func wavehit()
If $sWavehit = True Then
Sleep(1)
Else
$sWavehit = True
$mWavehit_x = $move_x - 2.25
$mWavehit_y = $move_y - 2.1
$iWavehit = GUICtrlCreatePic("./img/spells/wavehit.bmp", $move_x - 2.25, $move_y - 2.1, 25, 25)
Sleep(1000)
GUICtrlDelete($iWavehit)
$sWavehit = False
If $mWavehit_x < $hEnemy1max_x && > $hEnemy1min_x && $mWavehit_y > $hEnemy1min_y && $mWavehit_y < $hEnemy1max_y Then
MsgBox(0, "", "HIT")
EndIf
EndIf
EndFuncFehlermeldung:
Code>"S:\AutoIt\AutoItInstall\install\SciTe\..\autoit3.exe" /ErrorStdOut "S:\AutoIt\Yuna RPG\game.au3" S:\AutoIt\Yuna RPG\game.au3 (73) : ==> Error in expression.: If $mWavehit_x < $hEnemy1max_x && > $hEnemy1min_x && $mWavehit_y > $hEnemy1min_y && $mWavehit_y < $hEnemy1max_y Then If ^ ERROR >Exit code: 1 Time: 6.902weis echt nicht woran das liegt...
hilfe wär nett
mfg Nakroma -
)
Ja,
Und wenn man dann startet und -20 macht gehts trotzdem auf 80%.@Marsi:
Einfach Func Main und die erste Zeile dann in die While 1 oder was?Sorry bin noch nicht so bewandert in AutoIt
-
Ich mein, wo füg ich den dreisatz ein?
-
1. Autoit kann kein Multithreading. Gleichzeitiges ausführen is nicht möglich.
Evtl hilft dir aber Adlibregister
2. So wie ich das sehe suchst du nen einfachen Dreisatz

Wenn 30 Leben = 100%
dann ist 1 Leben 3,333 %
oder nicht?^^Also einfach die GDIpProgess auf ($aktuellesLeben/30)*100 setzen

Wie ist der Befehl dafür? ich mein, wenn man
_ProgressSet macht kommt ja am ende wieder 100 raus... -
Hi,
[autoit]
Meine erste Frage. Geht es quasi mehrere Whiles gleichzeitig nebeneinander zu haben? Also will das machen:
[/autoit]
If $cooldown = True Then
$cooldown = $cooldown -1
If $cooldown = 0 Then
$cooldown = False
EndIf
Sleep(500)
EndIf
;;;;;;;;;;;;;;;;
If $mana < 100 Then
$mana = $mana + 1
Sleep(500)
EndIf
;;;;;;;;;;;;;;;
If $life < 100 Then
$life = $life + 1
Sleep(500)
EndIfWie krieg ichs hin das die 3 Sachen nebeneinander in einer While funktionieren und auch gleichzeitig ausführen.
2. Frage:
http://www.autoitscript.com/forum/topic/74…r-with-gdiplus/
Geht es bei GDIpProgess einen anderen Wert als 100 einzustellen aber das es trotzdem prozentual ist. Also das 30 Life trotzdem 100% sind?Mfg Nakroma
-
Also in so etwa oder?
[autoit]
[/autoit]
While 1
_IsPressed(Taste)
Mache dies und dass
Wend