Brauche hilfe xD

05/26/2014 22:33 bs_destroyer#1
Huhu,

bin was AutoIT betrifft noch ein totaler Neuling wollte mir heute für Seafight ein Tool schreiben was mir anzeigt ob eine gegnerische ID auf rot ist ( Inputbox usw...
Code:
If $input = "14263930" Then
MsgBox (0, "Rot!!!", "ROT!!!!")
ElseIf $input = "" Then
MsgBox (0, "Nein", "Nicht rot")
Else
MsgBox (0, "", "Nicht auf rot")
EndIf
usw das immer wieder mit jeder ID die auf rot ist... Das Problem ist das die alle andren msgboxen auch ihre Antwort werfen und nicht nur die wie kann ich das ändern?
05/26/2014 22:42 alpines#2
Dein Problem ist in dem Snippet nicht erkennbar.
05/26/2014 23:22 bs_destroyer#3
Code:
$input = InputBox ("Gib bitte nur die ID ein", "Gib bitte nur die ID ein"&@CRLF&"(Gib bitte nur die ID ein")

;----------------------------------------Elite-------------------------------------------
If $input = "13861470"  Then
MsgBox (0, "Rot!!!", "ROT!!!!")
ElseIf $input = "Kevin" Then
MsgBox (0, "Er hat ihn geschrieben ", "Easteregg ;D")
Else
MsgBox (0, "", "Nicht auf rot")
EndIf



If $input = "14263930" Then
MsgBox (0, "Rot!!!", "ROT!!!!")
ElseIf $input = "" Then
MsgBox (0, "Nein", "Nicht rot")
Else
MsgBox (0, "", "Nicht auf rot")
EndIf
If $input = "16098480" Then
MsgBox (0, "Rot!!!", "ROT!!!!")
ElseIf $input = "" Then
MsgBox (0, "Nein", "Nicht rot")
Else
MsgBox (0, "", "Nicht auf rot")
EndIf
If $input = "16586136" Then
MsgBox (0, "Rot!!!", "ROT!!!!")
ElseIf $input = "" Then
MsgBox (0, "Nein", "Nicht rot")
Else
MsgBox (0, "", "Nicht auf rot")
EndIf
So geht das immer weiter

ich Tippe die erste ID in die Inputbox ein diese beantwortet er richtig danach gibt er noch ca. 100 mal die Antwort nicht auf rot...
05/26/2014 23:26 butter123#4
den rest löschen wäre eine alternative.
ohne zu wissen was passieren soll, kann man da wenig helfen...
05/27/2014 00:27 bs_destroyer#5
Achso ^^ ehm ja ich will die ID in die Inputbox eintippen Das tool soll dann die ID erkennne und mir sagen ob die auf rot ist ( die ID´s die auf rot sind sind in dem tool gespeichert)
05/27/2014 00:56 lolkop#6
Quote:
Originally Posted by bs_destroyer View Post
Achso ^^ ehm ja ich will die ID in die Inputbox eintippen Das tool soll dann die ID erkennne und mir sagen ob die auf rot ist ( die ID´s die auf rot sind sind in dem tool gespeichert)
Code:
Dim $validIDs[4] = [13861470,14263930,16098480,16586136], $text[2]=["Nicht rot","Rot!!!"]
While True
	$valid = False
	$current = InputBox("Gib bitte nur die ID ein!", "Gib bitte nur die ID ein"&@CRLF&"(Gib bitte nur die ID ein")
	If @error Then ExitLoop
	For $i=0 To UBound($validIDs)-1
		If $current = $validIDs[$i] Then
			$valid = True
			ExitLoop
		EndIf
	Next
	MsgBox(0, $text[$valid], $text[$valid])
WEnd
05/27/2014 01:42 bs_destroyer#7
So funktioniert es irgendwie nicht mehr sry das ich so wenig ahnung habe ^^

Code:
Dim $validIDs[46] = [13861470,14263930,16098480,16586136,17743088,20066435,20356797,21526855,21778477,22158798,24218120,39475857,41784968,41795232,15374638,25414798,29481402,30980209,15011324,31626550,39193224,40412834,41779276,41797527,41798780,21682439,36387081,41795791,24407985,39193224,16712282,41799855,41801252,21537127,41781350,41779276,33235811,32974622,23150430,13557928,19580290,20103156,32495941,41801147,19424011,17635071,], $text[2]=["Nicht rot","Rot!!!"]
While True
	$valid = False
	$current = InputBox("Gib bitte nur die ID ein!", "Gib bitte nur die ID ein"&@CRLF&"(Gib bitte nur die ID ein")
	If @error Then ExitLoop
	For $i=0 To UBound($validIDs)-1
		If $current = $validIDs[$i] Then
			$valid = True
			ExitLoop
		EndIf
	Next
	MsgBox(0, $text[$valid], $text[$valid])
WEnd
05/27/2014 05:08 Requi#8
Im Array ist ganz am Ende ein Komma was da nicht hingehört.