Ein AntiCheat Tool

  • Halli Hallo, alle AutoIt Scripter :D

    Ein Freund und Ich haben für ein bevorstehendes "Tournament", für das ComputerSpiel Star Wars Battlefront1,
    Ein sogenanntes AntiCheat Programm, programmiert.

    Es ist nichts besonderes, aber es reicht aus, um den allgemein beliebten Mini-Map-Hack (Gegner auf der Minikarte sehen) Etc. zu verhindern.

    Das Programm schiesst mittels der Ingame Funktion "P" einen Screenshot.

    Ich habe das ganze jetzt noch ein wenig 'benutzerfreundlicher' gestaltet.

    Hier einmal das Script, darunter steht dann meine Frage:

    [autoit]

    OPT("TrayMenuMode", 3)Opt("TrayOnEventMode", 1)MsgBox(0, "Battlefront Anti-Cheat [BETA]", "Let this program running until the match is finished." & @LF & "" & @LF & "!IMPORTANT! Make sure your hotkey for screenshot in battlefront is set to p" & @LF & "" & @LF & "Close BAC after your match by pressing ctrl+1 (only on desktop, NOT INGAME!).")HotKeySet("^1", "EXIT1")$ABOUTITEM = TrayCreateItem("About")TrayItemSetOnEvent(-1, "About1")$ABOUTITEM = TrayCreateItem("How to use")TrayItemSetOnEvent(-1, "HowToUse1")$EXITITEM = TrayCreateItem("Exit")TrayItemSetOnEvent(-1, "Exit1");----------------------------------Func ABOUT1() MsgBox(0, "Battlefront Anti-Cheat [BETA] - About", "designed for Battlefront eSports" & @LF & "" & @LF & "centuryclan.eu/battlefront-eSports.htm" & @LF & "" & @LF & "scripted by DEAGLE" & @LF & "" & @LF & "This is only a beta version!")EndFunc;-----------------------------------------------Func HOWTOUSE1() MsgBox(0, "Battlefront Anti-Cheat [BETA] - How to use", "!IMPORTANT! Make sure your hotkey for screenshot in battlefront is set to p" & @LF & "" & @LF & "How to use:" & @LF & "1. start Battlefront, connect to server" & @LF & "2. When the match is about to begin, start this program" & @LF & "3. When the match is finished, close the program by pressing ctrl+1 (or use the Exit button) !NOTE! you can not close the program via ctrl+1 if you're ingame! Close the game first!" & @LF & "" & @LF & "You only need to do the following steps if u won the match!" & @LF & "" & @LF & "4. Go into your game directory: Star Wars Battlefront\GameData\ScreenShots" & @LF & "5. zip all screenshots from the match using winzip, winrar or 7zip" & @LF & "6. Upload the zip file to >>webspace coming soon<<" & @LF & "7. Post the link to your uploaded file at the matchpage")EndFunc;-----------------------------------------------If ProcessExists("Battlefront.exe") ThenWhile 1 Sleep(30000) Send("p") Sleep(90000) Send("p") Sleep(120000) Send("p") Sleep(90000) Send("p") Sleep(60000) Send("p") Sleep(90000) Send("p") Sleep(120000) Send("p") Sleep(60000) Send("p") Sleep(90000) Send("p") Sleep(120000) Send("p") Sleep(90000) Send("p") Sleep(60000) Send("p") Sleep(30000) Send("p") Sleep(60000) Send("p") Sleep(90000) Send("p") Sleep(120000) Send("p") Sleep(90000) Send("p") Sleep(60000) Send("p") Sleep(30000) Send("p") Sleep(60000) Send("p") Sleep(90000) Send("p") Sleep(120000) Send("p") Sleep(90000) Send("p") Sleep(60000) Send("p") Sleep(30000) Send("p")WEndElse ;Hier fängt das ganze an ----------------------------------------------------------- $notingame=MsgBox(3, "Bf_eSports AntiCheat [Beta]", "You are not Ingame (anymore), should the program go on?")EndIf If $notingame = 7 Then ExitEndIfIf $notingame = 6 Then MsgBox(1, "Bf_eSports AntiCheat [Beta]", "Battlefront will start now") Run("Battlefront.exe") EndIf;-------------------Bis hier---------------------------------Func EXIT1() ExitEndFunc

    [/autoit]


    Okay. Als erstes, es tut mir EXTREM! leid, das das so unübersichtlich ist. Aber das sind ja nur die texte, die dann in den MessageBoxen stehen.

    So, (im Quelltext markiert.)
    Bei der einen Funktion, habe ich ein Problem,

    Alles Funktioniert einwandfrei, ausser das da unten:

    [autoit]

    Else ;Hier fängt das ganze an ----------------------------------------------------------- $notingame=MsgBox(3, "Bf_eSports AntiCheat [Beta]", "You are not Ingame (anymore), should the program go on?")EndIf If $notingame = 7 Then ExitEndIfIf $notingame = 6 Then MsgBox(1, "Bf_eSports AntiCheat [Beta]", "Battlefront will start now") Run("Battlefront.exe") EndIf;-------------------Bis hier---------------------------------

    [/autoit]


    Hier, soll gesagt werden, das der Prozess NICHT exestiert. Das geht ja auch. Allerdings möchte ich dann, das er fragt, ob dann Battlefront noch gestartet werden soll...
    Das Problem ist jetzt, dass er, wenn ich bei der letzten MessageBox vo er sagt: "Battlefront will start now" , auf 'JA' klicke, das er zwar das Game startet, aber dann das AntiCheat programm einfach beendet.

    Hier dann die Frage wie kann ich es scripten, dass wenn das Programm Battlefront gestartet hat, dass dann quasi das Script von "vorne" beginnt. Also das er alles ab dem Teil:

    [autoit]

    If ProcessExists("Battlefront.exe") ThenWhile 1 Sleep(30000) Send("p")

    [/autoit]

    .........................

    Weitermacht???!?!!

    Vielen Dank schonmal, und ich hoffe, dass ihr alle mein Problem verstanden habt :)


    Ach, Entschuldigung, ich sehe grade, dass das total komisch angezeigt wird, ich packe das nochmal in Spoiler:

    Spoiler anzeigen

    OPT("TrayMenuMode", 3)
    Opt("TrayOnEventMode", 1)
    MsgBox(0, "Battlefront Anti-Cheat [BETA]", "Let this program running until the match is finished." & @LF & "" & @LF & "!IMPORTANT! Make sure your hotkey for screenshot in battlefront is set to p" & @LF & "" & @LF & "Close BAC after your match by pressing ctrl+1 (only on desktop, NOT INGAME!).")
    HotKeySet("^1", "EXIT1")
    $ABOUTITEM = TrayCreateItem("About")
    TrayItemSetOnEvent(-1, "About1")
    $ABOUTITEM = TrayCreateItem("How to use")
    TrayItemSetOnEvent(-1, "HowToUse1")
    $EXITITEM = TrayCreateItem("Exit")
    TrayItemSetOnEvent(-1, "Exit1")
    ;----------------------------------
    Func ABOUT1()
    MsgBox(0, "Battlefront Anti-Cheat [BETA] - About", "designed for Battlefront eSports" & @LF & "" & @LF & "centuryclan.eu/battlefront-eSports.htm" & @LF & "" & @LF & "scripted by DEAGLE" & @LF & "" & @LF & "This is only a beta version!")
    EndFunc
    ;-----------------------------------------------
    Func HOWTOUSE1()
    MsgBox(0, "Battlefront Anti-Cheat [BETA] - How to use", "!IMPORTANT! Make sure your hotkey for screenshot in battlefront is set to p" & @LF & "" & @LF & "How to use:" & @LF & "1. start Battlefront, connect to server" & @LF & "2. When the match is about to begin, start this program" & @LF & "3. When the match is finished, close the program by pressing ctrl+1 (or use the Exit button) !NOTE! you can not close the program via ctrl+1 if you're ingame! Close the game first!" & @LF & "" & @LF & "You only need to do the following steps if u won the match!" & @LF & "" & @LF & "4. Go into your game directory: Star Wars Battlefront\GameData\ScreenShots" & @LF & "5. zip all screenshots from the match using winzip, winrar or 7zip" & @LF & "6. Upload the zip file to >>webspace coming soon<<" & @LF & "7. Post the link to your uploaded file at the matchpage")
    EndFunc
    ;-----------------------------------------------
    If ProcessExists("Battlefront.exe") Then
    While 1
    Sleep(30000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(30000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(30000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(30000)
    Send("p")
    WEnd
    Else
    $notingame=MsgBox(3, "Bf_eSports AntiCheat [Beta]", "You are not Ingame (anymore), should the program go on?")
    EndIf
    If $notingame = 7 Then
    Exit
    EndIf
    If $notingame = 6 Then
    MsgBox(1, "Bf_eSports AntiCheat [Beta]", "Battlefront will start now")
    Run("Battlefront.exe")

    EndIf
    ;------------------------------------------------------------------------------------
    Func EXIT1()
    Exit
    EndFunc


    Hier dann das nächste:

    Spoiler anzeigen

    Else
    $notingame=MsgBox(3, "Bf_eSports AntiCheat [Beta]", "You are not Ingame (anymore), should the program go on?")
    EndIf
    If $notingame = 7 Then
    Exit
    EndIf
    If $notingame = 6 Then
    MsgBox(1, "Bf_eSports AntiCheat [Beta]", "Battlefront will start now")
    Run("Battlefront.exe")

    EndIf


    Spoiler anzeigen

    If ProcessExists("Battlefront.exe") Then
    While 1
    Sleep(30000)
    Send("p")
    ............

  • Allerdings, kommt dann ja wieder die start MessageBox, mit der Einführung... ich möchte ja, dass es direkt bei dem Screenshot anfertigen anfängt :)

  • Kein Problem. Arbeite mit Startparametern.
    Wenn das Script mit dem Parameter SecondRun aufgerufen wird, dann wird der Teil übersprungen:

    [autoit]


    Run(@ScriptName & " SecondRun")

    [/autoit]


    Und der Bereich, der übersprungen werden soll, sieht so aus:

    [autoit]


    If $CmdLine[0] = 1 And Not $CmdLine[1] = "SecondRun" Then
    Dein Code hier (Wird übersprungen)
    EndIf
    Restlicher Code

    [/autoit]

    lg chess

  • Okay, klingt sehr gut, danke. Kannst du das ggf. mal in mein programm reinschreiben? ich bin noch recht neu, und muss mir so sachen immer erstmal richtig ansehen können :)

  • Versuch es mal so:

    Spoiler anzeigen
    [autoit]

    Opt("TrayMenuMode", 3)
    Opt("TrayOnEventMode", 1)
    MsgBox(0, "Battlefront Anti-Cheat [BETA]", "Let this program running until the match is finished." & @LF & "" & @LF & "!IMPORTANT! Make sure your hotkey for screenshot in battlefront is set to p" & @LF & "" & @LF & "Close BAC after your match by pressing ctrl+1 (only on desktop, NOT INGAME!).")
    HotKeySet("^1", "EXIT1")
    $ABOUTITEM = TrayCreateItem("About")
    TrayItemSetOnEvent(-1, "About1")
    $ABOUTITEM = TrayCreateItem("How to use")
    TrayItemSetOnEvent(-1, "HowToUse1")
    $EXITITEM = TrayCreateItem("Exit")
    TrayItemSetOnEvent(-1, "Exit1")
    ;----------------------------------
    Func ABOUT1()
    MsgBox(0, "Battlefront Anti-Cheat [BETA] - About", "designed for Battlefront eSports" & @LF & "" & @LF & "centuryclan.eu/battlefront-eSports.htm" & @LF & "" & @LF & "scripted by DEAGLE" & @LF & "" & @LF & "This is only a beta version!")
    EndFunc ;==>ABOUT1
    ;-----------------------------------------------
    Func HOWTOUSE1()
    MsgBox(0, "Battlefront Anti-Cheat [BETA] - How to use", "!IMPORTANT! Make sure your hotkey for screenshot in battlefront is set to p" & @LF & "" & @LF & "How to use:" & @LF & "1. start Battlefront, connect to server" & @LF & "2. When the match is about to begin, start this program" & @LF & "3. When the match is finished, close the program by pressing ctrl+1 (or use the Exit button) !NOTE! you can not close the program via ctrl+1 if you're ingame! Close the game first!" & @LF & "" & @LF & "You only need to do the following steps if u won the match!" & @LF & "" & @LF & "4. Go into your game directory: Star Wars Battlefront\GameData\ScreenShots" & @LF & "5. zip all screenshots from the match using winzip, winrar or 7zip" & @LF & "6. Upload the zip file to >>webspace coming soon<<" & @LF & "7. Post the link to your uploaded file at the matchpage")
    EndFunc ;==>HOWTOUSE1
    ;-----------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    If ProcessExists("Battlefront.exe") Then
    Sleep(30000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(30000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(30000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(30000)
    Send("p")
    Else
    $notingame = MsgBox(3, "Bf_eSports AntiCheat [Beta]", "You are not Ingame (anymore), should the program go on?")
    Switch $notingame
    Case 6
    MsgBox(1, "Bf_eSports AntiCheat [Beta]", "Battlefront will start now")
    Run("Battlefront.exe")
    Case 7
    ExitLoop
    EndSwitch
    EndIf
    Sleep(10)
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ;------------------------------------------------------------------------------------
    Func EXIT1()
    Exit
    EndFunc ;==>EXIT1

    [/autoit]
  • Dann stürtzt das game immer wieder ab.

    Und pz.b. Abbrechen funktioniert nicht, er bindet das in eine Schleife..

    Aber Danke

  • Das gerade hat so eh nicht funktioniert, da hatte ich was mit den NOT's vertauscht. ;)

    Dann sag mir mal eben, von welcher Zeile bis zu welcher Zeile du beim zweiten Mal nicht willst und in welcher Zeile "Neu gestartet" werden soll.

    lg chess

    Okay, also von der Zeile:
    If ProcessExists("Battlefront.exe") Then
    While 1
    Sleep(30000)
    Send("p")

    Bis:

    Sleep(30000)
    Send("p")
    WEnd
    Else
    $notingame=MsgBox(3, "Bf_eSports AntiCheat [Beta]", "You are not Ingame (anymore), should the program go on?")
    EndIf
    If $notingame = 7 Then
    Exit
    EndIf
    If $notingame = 6 Then
    MsgBox(1, "Bf_eSports AntiCheat [Beta]", "Battlefront will start now")
    Run("Battlefront.exe")

    EndIf

  • Ich weiß jetzt nich so genau was du meinst... Zeilennummern wären besser gewesen.
    Ich blick so oder so in dem Script nicht durch (Du solltest vielleicht mal ein bisschen auf Ordnung achten), deswegen weiß ich nicht ob das das ist, was du meinst:

    Code
    [autoit]


    OPT("TrayMenuMode", 3)
    Opt("TrayOnEventMode", 1)
    MsgBox(0, "Battlefront Anti-Cheat [BETA]", "Let this program running until the match is finished." & @LF & "" & @LF & "!IMPORTANT! Make sure your hotkey for screenshot in battlefront is set to p" & @LF & "" & @LF & "Close BAC after your match by pressing ctrl+1 (only on desktop, NOT INGAME!).")
    HotKeySet("^1", "EXIT1")
    $ABOUTITEM = TrayCreateItem("About")
    TrayItemSetOnEvent(-1, "About1")
    $ABOUTITEM = TrayCreateItem("How to use")
    TrayItemSetOnEvent(-1, "HowToUse1")
    $EXITITEM = TrayCreateItem("Exit")
    TrayItemSetOnEvent(-1, "Exit1")
    ;----------------------------------
    Func ABOUT1()
    MsgBox(0, "Battlefront Anti-Cheat [BETA] - About", "designed for Battlefront eSports" & @LF & "" & @LF & "centuryclan.eu/battlefront-eSports.htm" & @LF & "" & @LF & "scripted by DEAGLE" & @LF & "" & @LF & "This is only a beta version!")
    EndFunc
    ;-----------------------------------------------
    Func HOWTOUSE1()
    MsgBox(0, "Battlefront Anti-Cheat [BETA] - How to use", "!IMPORTANT! Make sure your hotkey for screenshot in battlefront is set to p" & @LF & "" & @LF & "How to use:" & @LF & "1. start Battlefront, connect to server" & @LF & "2. When the match is about to begin, start this program" & @LF & "3. When the match is finished, close the program by pressing ctrl+1 (or use the Exit button) !NOTE! you can not close the program via ctrl+1 if you're ingame! Close the game first!" & @LF & "" & @LF & "You only need to do the following steps if u won the match!" & @LF & "" & @LF & "4. Go into your game directory: Star Wars Battlefront\GameData\ScreenShots" & @LF & "5. zip all screenshots from the match using winzip, winrar or 7zip" & @LF & "6. Upload the zip file to >>webspace coming soon<<" & @LF & "7. Post the link to your uploaded file at the matchpage")
    EndFunc
    ;-----------------------------------------------
    If $CmdLine[0] = 0 Then ;If-Abfrage

    [/autoit] [autoit][/autoit] [autoit]

    If ProcessExists("Battlefront.exe") Then
    While 1
    Sleep(30000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(30000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(30000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(120000)
    Send("p")
    Sleep(90000)
    Send("p")
    Sleep(60000)
    Send("p")
    Sleep(30000)
    Send("p")
    WEnd
    Else
    $notingame=MsgBox(3, "Bf_eSports AntiCheat [Beta]", "You are not Ingame (anymore), should the program go on?")
    EndIf
    If $notingame = 7 Then
    Exit
    EndIf
    If $notingame = 6 Then
    MsgBox(1, "Bf_eSports AntiCheat [Beta]", "Battlefront will start now")
    Run("Battlefront.exe")

    [/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    EndIf;-> EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ;------------------------------------------------------------------------------------
    Func EXIT1()
    Exit
    EndFunc

    [/autoit]


    Wie gesagt: Ich blick da nicht durch. Das Starten mit Parameter funktioniert auch noch nicht, da ich nicht weiß, wo gestartet werden soll.
    Bau's dir am besten einfach selber ein.
    Nimm als If-Bedingung "$CmdLine[0] = 1" und als Startparameter irgendwas.

    lg chess

  • Ja, meine Scripts sind in der Regel auch komplett ordentlich, egal was ich mache, ob html, css etc...

    Hier hat das ein Freund, weil er besser Englisch kann Reingeschrieben...

    Ich werde das mal versuchen, danke

  • Ich habe eine Funktion, die z.B. ein Programm ausführen soll:


    Bsp:

    ---------------------------------------------------------------------------

    So, ich möchte die Funktion über eine MessageBox ausführen lassen, etwa so:


    $ausführen=MsgBox(0, "Titel", "Text der Box") ; Dann kommt die IF abfrage:(Ich habe den rückgabe wert des OK buttons vergessen, desshalb: 0(ist das richtig??))

    if $ausführen=0 Then
    ;Hier soll dann die Funktion aufgerufen werden (Func _start) (bzw. Gestartet)
    EndIf

    ;---------------------------------------------------------------------------


    Func _start()


    Run("Programm.exe")
    EndFunc


    ________________________________________________

    Ich hoffe ihr könnt mir da helfen? :DD

    • Offizieller Beitrag
    Zitat

    $ausführen=MsgBox(0, "Titel", "Text der Box") ; Dann kommt die IF abfrage:(Ich habe den rückgabe wert des OK buttons vergessen, desshalb: 0(ist das richtig??))

    if $ausführen=0 Then


    Sorry, aber was hällst du davon, einfach mal in der Hilfe nachzulesen.
    Ist eigentlich nicht zuviel verlangt.

  • Ich brauche nur hilfe dabei, das ich wenn ich in der MessageBox auf OK klicke, dann die Funktion gesatrtet wird...

    Nichts anderes als bei einem Hotkey. Nur weiß ich nicht, wie der code dann für diese MessageBox ist