Kleines Tool,need help

07/19/2010 03:04 Flasher2#1
Ich arbeite geradé an dem programm was im anhang ist ^^

Der Code sieht so aus:
Code:
#include <GUIConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 443, 261, 153)
GUISetBkColor(0xFF0000)
$Pic1 = GUICtrlCreatePic("untitled.bmp", 88, 24, 129, 121)
$Pic2 = GUICtrlCreatePic("untitled2.bmp", 360, 32, 129, 113)
$Label1 = GUICtrlCreateLabel("Son Goku (DBZ)", 96, 160, 83, 17)
$Label2 = GUICtrlCreateLabel("vs", 280, 160, 15, 17)
$Label3 = GUICtrlCreateLabel("Yugi Muto (Yu-gi-oh)", 368, 160, 100, 17)
$Progress1 = GUICtrlCreateProgress(80, 192, 145, 17)
GUICtrlSetData (-1,100)
$Progress2 = GUICtrlCreateProgress(352, 192, 145, 17)
GUICtrlSetData (-1,100)
$Button1 = GUICtrlCreateButton("Angriff", 80, 232, 145, 25, 0)
$Button2 = GUICtrlCreateButton("Angriff", 352, 232, 153, 25, 0)
$Button3 = GUICtrlCreateButton("Kame-Hame-Ha", 80, 264, 145, 25, 0)
$Button4 = GUICtrlCreateButton("Verteidigen", 80, 296, 145, 25, 0)
$Button5 = GUICtrlCreateButton("Black Magican holen", 352, 264, 153, 25, 0)
$Button6 = GUICtrlCreateButton("Verteidigen", 352, 296, 153, 25, 0)
$Button7 = GUICtrlCreateButton("Beenden", 232, 360, 121, 33, 0)
$Button8 = GUICtrlCreateButton("Mehr Anime Kaempfe", 232, 400, 121, 33, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg=GuiGetMsg()
If $msg=$Button1 then b1()
If $msg=$Button2 then b2()
If $msg=$Button3 then b3()
If $msg=$Button4 then b4()
If $msg=$Button5 then b5()
If $msg=$Button6 then b6()
If $msg=$Button7 then b7()
If $msg=$Button8 then b8() 
WEnd
Func b1()
EndFunc
Func b2()
EndFunc
Func b3()
EndFunc
Func b4()
EndFunc
Func b5()
EndFunc
Func b6()
EndFunc
Func b7()
Exit 
EndFunc
Func b8()
Exit
EndFunc
Ich hab das ja mit Progress`s gemacht,und ich wollte wissen wie ich das mache das,wenn ich z.b. auf Angreifen drücke er 20 von den 100 abzieht vom Progress und wenn ich nochmal draufdrücke er nochmal 20 abzieht?
07/19/2010 23:07 omer36#2
so:

PHP Code:
#include <GUIConstants.au3>

Global $Step1 100
Global $Step2 100

#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"625443261153)
GUISetBkColor(0xFF0000)
$Pic1 GUICtrlCreatePic("untitled.bmp"8824129121)
$Pic2 GUICtrlCreatePic("untitled2.bmp"36032129113)
$Label1 GUICtrlCreateLabel("Son Goku (DBZ)"961608317)
$Label2 GUICtrlCreateLabel("vs"2801601517)
$Label3 GUICtrlCreateLabel("Yugi Muto (Yu-gi-oh)"36816010017)
$Progress1 GUICtrlCreateProgress(8019214517)
GUICtrlSetData (-1,100)
$Progress2 GUICtrlCreateProgress(35219214517)
GUICtrlSetData (-1,100)
$Button1 GUICtrlCreateButton("Angriff"80232145250)
$Button2 GUICtrlCreateButton("Angriff"352232153250)
$Button3 GUICtrlCreateButton("Kame-Hame-Ha"80264145250)
$Button4 GUICtrlCreateButton("Verteidigen"80296145250)
$Button5 GUICtrlCreateButton("Black Magican holen"352264153250)
$Button6 GUICtrlCreateButton("Verteidigen"352296153250)
$Button7 GUICtrlCreateButton("Beenden"232360121330)
$Button8 GUICtrlCreateButton("Mehr Anime Kaempfe"232400121330)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg
=GuiGetMsg()
If 
$msg=$Button1 then b1()
If 
$msg=$Button2 then b2()
If 
$msg=$Button3 then b3()
If 
$msg=$Button4 then b4()
If 
$msg=$Button5 then b5()
If 
$msg=$Button6 then b6()
If 
$msg=$Button7 then b7()
If 
$msg=$Button8 then b8()
WEnd

Func b1
()
    
$Step2 -= 20
    GUICtrlSetData
($Progress2$Step2)
EndFunc
Func b2
()
    
$Step1 -= 20
    GUICtrlSetData
($Progress1$Step1)
EndFunc
Func b3
()
EndFunc
Func b4
()
EndFunc
Func b5
()
EndFunc
Func b6
()
EndFunc
Func b7
()
Exit
EndFunc
Func b8
()
Exit
EndFunc 
schreib das nächste mal gleich ins Autoit bereich, wird dir schneller geholfen
07/21/2010 18:33 Flasher2#3
Cool Danke ;)
und wie würde man es machen das wenn ein Progress aus 0 oder niederiger ist,eine meldung kommt, (... hat verloren) ?

If $Progress1 = 0 Then Msgbox (0,"title","hat verloren") geht nicht
07/21/2010 19:05 omer36#4
Quote:
Originally Posted by Flasher2 View Post
Cool Danke ;)
und wie würde man es machen das wenn ein Progress aus 0 oder niederiger ist,eine meldung kommt, (... hat verloren) ?

If $Progress1 = 0 Then Msgbox (0,"title","hat verloren") geht nicht
machs besser so, denn wenn du die anderen buttons auch belegst, mit mehr odeer weniger schaden, rechnet der es wieder von 100..also wirds nicht richtig laufen...
und mit der msgbox habs ich so gelöst, aber musst dann warscheinlich in jeder Func reinschreibne...

PHP Code:
#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Form1"625443261153)
GUISetBkColor(0xFF0000)
$Pic1 GUICtrlCreatePic("untitled.bmp"8824129121)
$Pic2 GUICtrlCreatePic("untitled2.bmp"36032129113)
$Label1 GUICtrlCreateLabel("Son Goku (DBZ)"961608317)
$Label2 GUICtrlCreateLabel("vs"2801601517)
$Label3 GUICtrlCreateLabel("Yugi Muto (Yu-gi-oh)"36816010017)
$Progress1 GUICtrlCreateProgress(8019214517)
GUICtrlSetData (-1,100)
$Progress2 GUICtrlCreateProgress(35219214517)
GUICtrlSetData (-1,100)
$Button1 GUICtrlCreateButton("Angriff"80232145250)
$Button2 GUICtrlCreateButton("Angriff"352232153250)
$Button3 GUICtrlCreateButton("Kame-Hame-Ha"80264145250)
$Button4 GUICtrlCreateButton("Verteidigen"80296145250)
$Button5 GUICtrlCreateButton("Black Magican holen"352264153250)
$Button6 GUICtrlCreateButton("Verteidigen"352296153250)
$Button7 GUICtrlCreateButton("Beenden"232360121330)
$Button8 GUICtrlCreateButton("Mehr Anime Kaempfe"232400121330)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg
=GuiGetMsg()
If 
$msg=$Button1 then b1()
If 
$msg=$Button2 then b2()
If 
$msg=$Button3 then b3()
If 
$msg=$Button4 then b4()
If 
$msg=$Button5 then b5()
If 
$msg=$Button6 then b6()
If 
$msg=$Button7 then b7()
If 
$msg=$Button8 then b8()
WEnd



Func b1
()
$ProgressBarAktuell GUICtrlRead($Progress2)
$Variable $ProgressBarAktuell "20"
GUICtrlSetData($Progress2$Variable)
If 
GUICtrlRead($Progress2) = "0" Then MsgBox("Info""Spieler 2","hatt verloren!")
EndFunc
Func b2
()
$ProgressBarAktuell GUICtrlRead($Progress1)
$Variable $ProgressBarAktuell "20"
GUICtrlSetData($Progress1$Variable)
If 
GUICtrlRead($Progress1) = "0" Then MsgBox("Info""Spieler 1","hatt verloren!")
EndFunc
Func b3
()
EndFunc
Func b4
()
EndFunc
Func b5
()
EndFunc
Func b6
()
EndFunc
Func b7
()
Exit
EndFunc
Func b8
()
Exit
EndFunc 
( [Only registered and activated users can see links. Click Here To Register...] )

MfG

noch ein tipp:
das "rot" als hintergrund sieht echt bischen sche**** aus :D
zu "aggresive" meiner meninung nach :D ;D
07/21/2010 19:35 Flasher2#5
Nice funzt auch toll,denke nehme das ;)
Hab aber immer noch paar Probleme O_o wäre nett wenn du helfen kannst

Brauche erklärungen wie das mit dem abspeichern von daten geht,z.b. das Level eines charakters speichern bei diesem Tool
Und dann z.b. wenn man genug Exp hat und man macht Levelup das der wert verändert im Programm angezeigt wird.
Ich kann mir denke wie des Script aussieht nur hab lange kein autoit benutzt und jetz wida anfangen is schwer ^^

Dann wie es möglich wäre den Chars Gold zu geben nach einem Kampf ,ich denke an ein zufallsscript was dem Char ,einen zufälligen betrag gibt zwischen zwei werten

Dann etwas eher schwieriges noch aber dazu muss man echt was können (AutoIT Profi)^^
So teil mit Inventar und so ,aber ich glaub ich lass das fürs erste ^^

Achja und wie ist es möglich das die Chars mehr als 100 Leben haben?denn wenn ich die Prozesse z.b. auf 400 änder,passiert nichts,da es anscheinend in % ist,wie kann ich machen das
es in normalen zahlen ist,also das einer auch 1207 leben haben kann z.b.
07/21/2010 21:05 omer36#6
zum speichern kanntst du es mt iniwrite machen, ich kenn mich da nicht besonders aus, "bladerofdarknes" könnte hierbei helfen, der würde am liebsten alles mit ini machen :D

mit den lv up undso.. hmmm nicht wirklich mein ding..

zu den über 100leben könntest du ein "label" unter dem progressbar machen zb 1000 und das dann abziehen lassen... müsste gehen...

ich reporte das mal und lass es zum [Only registered and activated users can see links. Click Here To Register...] verschieben, weil da einfach mehr heirrein schauen würden... ;)
07/21/2010 22:17 Flasher2#7
kk ich danke dir für deine hilfe ;),werde bescheidsagen wenn das Projekt fertig ist ;)
07/21/2010 22:42 omer36#8
kannst ja mal hier schauen,, als kleines beispiel zu den leben:

PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Test"538124178121)
$Progress1 GUICtrlCreateProgress(06450121)
GUICtrlSetData (-1,100)
GUICtrlSetColor(-10x00FF00)
$Label1 GUICtrlCreateLabel("Lebens-Punkte"0447617)
GUICtrlSetBkColor(-10xFF0000)
$Label2 GUICtrlCreateLabel("Spieler  1  "006620)
GUICtrlSetFont(-1104002"MS Sans Serif")
$Label3 GUICtrlCreateLabel("1000"240857428)
GUICtrlSetFont(-1144000"MS Sans Serif")
GUICtrlSetState(-1$GUI_DISABLE)
$schaden GUICtrlCreateButton("schaden"21048141$WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg 
GUIGetMsg()
Switch 
$nMsg
Case $GUI_EVENT_CLOSE
Exit
Case 
$schaden
schaden
()
EndSwitch
WEnd

Func schaden
()
GUICtrlSetData($Progress1GUICtrlRead($Progress1) - "10")
GUICtrlSetData($Label3GUICtrlRead($Label3) - "100")
If 
GUICtrlRead($Label3) = "0" Then MsgBox("""info""nur ein test...")
EndFunc 
und falls im oberen script dieser teil zu durcheinander ist:
PHP Code:
$ProgressBarAktuell GUICtrlRead($Progress1)
$Variable $ProgressBarAktuell "20"
GUICtrlSetData($Progress1$Variable
kannst es auch in das ändern:
PHP Code:
GUICtrlSetData($Progress1GUICtrlRead($Progress1) - "20"