Ich schreibe grade einen kleinen KlickBot für ein Spiel (Client).
Ich möchte nun Vor Start des Scripts prüfen ob der Spielprozess Existiert, also aktiv ist oder nicht.
Falls nicht -> msgbox und programm beenden
Falls doch -> msgbox und das eigentliche programm fortführen, ebenfalls mit gui.
Wie kann ich das verwirklichen?
hatte bisher das:
Code:
While 1
If Not ProcessExists("game.exe") Then
MsgBox(0, "Connection Error", "Please Start game, first!")
_Exit()
EndIf
WEnd
While 1
Else If ProcessExists("game.exe") Then
MsgBox(0, "Sucess", "Welcome to game KlickBot!")
Sleep(10)
EndIf
WEnd
While 1
If Not ProcessExists("game.exe") Then
MsgBox(0, "Connection Error", "Please Start game, first!")
_Exit()
ElseIf ProcessExists("game.exe") Then
MsgBox(0, "Success", "Welcome to game KlickBot!")
Sleep(10)
EndIf
WEnd
So?
Wobei wenn ich das so mache wie du sagst eher:
Code:
#requireAdmin
If Not ProcessExists("game.exe") Then
MsgBox(0, "Connection Error", "Please Start game, first!")
_Exit()
ElseIf ProcessExists("game.exe") Then
MsgBox(0, "Success", "Welcome to game KlickBot!")
Sleep(10)
EndIf
While 1
;Gui etc. was auch immer
WEnd
Das ElseIf ProcessExists("game.exe") Then ist total unnötig, weil ProcessExists entweder 0 oder die PID returned, stattdessen kann man auch einfach Else nehmen.
Außerdem ist es dumm ständig danach abzufragen (While 1), weil entweder _Exit() eintritt oder der Bot weiterläuft.
While 1
If Not ProcessExists("game.exe") Then
MsgBox(0, "Connection Error", "Please Start game, first!")
_Exit()
ElseIf ProcessExists("game.exe") Then
MsgBox(0, "Success", "Welcome to game KlickBot!")
Sleep(10)
EndIf
WEnd
Wenn man davon ausgeht das _Exit das Programm schließt, dann bringt das While 1 - WEnd einfach nichts, weil entweder _Exit() ausgeführt wird oder der Bot "läuft", was in diesem Fall Sleep(10) wäre.
Anscheinend hast du noch nie etwas der gleichen geschrieben.
Was ich meinte mit dem Checken ist:
Code:
#requireAdmin
While 1 ;<----main schleife
If Not ProcessExists("game.exe") Then
MsgBox(0, "Connection Error", "Please Start game, first!")
_Exit()
ElseIf ProcessExists("game.exe") Then
Sleep(10)
EndIf
;<---gui
WEnd
Also wird das Programm durch den Bot selbst oder das Beenden des Spiels beendet.
Danke aber nun Spuckt er nur ständig das Success Fenster aus ...^^
Logisch, du hast die MsgBox() schließlich in einer While-Schleife.
Quote:
Originally Posted by Anubiz32
Kann ich es auch so einstellen das die Klicks nur innerhalb des prozesses ausgeführt werden? Also nur in dem Fenster?
Oder was anderes, kann autoit ein fenster selbständig in die richtige position schieben?
Zum klicken in einem bestimmten Fenster kannst du entweder meine PostMessage UDF (findest du hier im Forum) verwenden oder ControlSend().
Zum verschieben eines Fensters gibt es die Funktion WinMove().
Problem mit Process Explorer 10/13/2010 - S4 League - 11 Replies Hey also ich hab seid vorgestern ein Problem mit dem Process Explorer,
wenn ich den process explorer starte dannach dann S4 League starte seh ich nur ganz krz S4 Client und XTrap, nach 2sec verschwinden die sachen von S4 League also kann ich sie nicht mehr einfrieren.was mach ich falsch?:confused:
New problem (Error while opening this process) 05/13/2010 - Kal Online - 2 Replies Hi all Every time i try to open engine.exe with cheat engine its told me (Error while opening this process):mad: can any one tell me how to fix this problem but plz don't say change ur CE coz its the only one i can open it with out the hack shield detect me
Thnx alot
Windows 7 Process explorer problem 11/06/2009 - SRO Private Server - 4 Replies Hi!
I've got a promblem.I have Windows 7 64 bit. I start the silkroad in kombatibility XP SP2 or 3 as administrator. And process explorer don't show running files. Please help me.
http://i38.tinypic.com/ddtnk.jpg
write memory process problem 10/28/2009 - General Coding - 3 Replies Hey Leute
Habe mir ebem mal das tut von Blackfog angeschaut.
Verstehe es auch, bloss will mein compi nich so wie ich will XD
habe es au scho mit copy and paste versucht, das ding macht einfach nix
problem with Process explorer -.- 08/24/2009 - SRO Private Server - 5 Replies hey Guys,
i have a problem with process explorer
i did all the right steps
1.open bot
2.open sjsro original client
3.when i open process explorer and choose Threads..i cant find those 3 files with name (msvcr71.dll endthread+0x3e):mad:
can anyone help ?