Salut à tous, c'est la première fois que je poste sur ce forum donc soyez indulgent s'il vous plait
Avec un ami, nous faisons un bot pour un jeu, et nous nous avons fait un utilitaire pour enregistrer des mouvements.
Le problème, c'est que quand on exécute notre code de "mouvement", il y a des bugs, nous sommes obligé de corrigé à la main, ce qui est horrible. C'est pour ça que j'aimerais vous demander si vous aviez une idée pour enrengistrer quand la touche se BAISSE et se RELEVE meilleur que la mienne
► Afficher le texte
Code : Tout sélectionner
$go = False
$text = ""
$time1 = TimerInit()
$IsPressUp = False
$IsPressDown = False
$IsPressLeft = False
$IsPressRight = False
;~ 25 LEFT ARROW key
;~ 26 UP ARROW key
;~ 27 RIGHT ARROW key
;~ 28 DOWN ARROW key
Func PressLeft()
If $IsPressLeft == False And _IsPressed("25") Then
$IsPressLeft = True
$text = $text & 'Ld,'&Floor(TimerDiff($time1))&'|'
EndIf
EndFunc
Func PressUp()
If $IsPressUp == False And _IsPressed("26") Then
$IsPressUp = True
$text = $text & 'Ud,'&Floor(TimerDiff($time1))&'|'
EndIf
EndFunc
Func PressDown()
If $IsPressDown == False And _IsPressed("28") Then
$IsPressDown = True
$text = $text & 'Dd,'&Floor(TimerDiff($time1))&'|'
EndIf
EndFunc
Func PressRight()
If $IsPressRight == False And _IsPressed("27") Then
$IsPressRight = True
$text = $text & 'Rd,'&Floor(TimerDiff($time1))&'|'
EndIf
EndFunc
while 1
;If $go Then
PressUp()
PressDown()
PressLeft()
PressRight()
If $IsPressUp==True Then
If _IsPressed("26") == False Then
$IsPressUp = False
$text = $text & 'Uu,'&Floor(TimerDiff($time1))&'|'
EndIf
EndIf
If $IsPressDown==True Then
If _IsPressed("28") == False Then
$IsPressDown = False
$text = $text & 'Du,'&Floor(TimerDiff($time1))&'|'
EndIf
EndIf
If $IsPressRight==True Then
If _IsPressed("27") == False Then
$IsPressRight = False
$text = $text & 'Ru,'&Floor(TimerDiff($time1))&'|'
EndIf
EndIf
If $IsPressLeft==True Then
If _IsPressed("25") == False Then
$IsPressLeft = False
$text = $text & 'Lu,'&Floor(TimerDiff($time1))&'|'
EndIf
EndIf
;EndIf
WEnd
;~ 25 LEFT ARROW key
;~ 26 UP ARROW key
;~ 27 RIGHT ARROW key
;~ 28 DOWN ARROW key
Func Pause()
MsgBox(1,'Salut toi','La liste des touches utilisé : '& $text)
ConsoleWrite( $text )
$go = False
EndFunc
Func Go()
$text = ""
$go = True
$time1 = TimerInit()
EndFunc
Il n'y a pas tout le code, certain truc sont pas très bien fait ^^
Voici un exemple de ce que ça retourne :
► Afficher le texte
Code : Tout sélectionner
Ud,941|Uu,1460|Ld,1465|Ud,1582|Lu,1634|Rd,1720|Uu,1737|Ru,1832|Ld,2148|Ud,2199|Lu,2270|Rd,2295|Uu,2311|Ru,2337|Ld,2759|Ud,2866|Lu,2917|Uu,3056|Rd,3201|Ru,3290|Dd,3537|Du,5034|Ld,5241|Ud,5297|Lu,5365|Uu,5404|Dd,6409|Du,6469|
La touche, U(p), D(own), L(eft), R(ight), et la deuxième lettre, U(p) ou D(own) (si elle est appuyé ou relaché)
Et ensuite, les chiffres sont égal à quel moment par rapport a
$time1 = TimerInit() sont appuyés
Ce code marche bien mais au moment de le tester dans le code, certain moment sont mal faite, le joueur meurs car il rate un sol par exemple et ma question serait de savoir si vous connaissez un moyen meilleur ! Merci d'avance !