Frage: Klickscript

02/20/2012 14:09 darkgolfr32#1
Ich suche ein Programm das alle 5 minuten zwischen 4 verschiedenen positionen einen klick mit der linken maustaste setzt und das in einer endlosschleife.

beispiel: pos 30/93 klick 5min pause pos 48/50klick 5min pause etc.

Am liebsten wäre es mir wenn ich das programm in einen einfachen editor bearbeiten kann um die positionen selbst zu bestimmen.
Ja ich weiss das es ein Kinderspiel ist und nein ich habe leider keine ahnung davon deshalb ja dieser post.

gruß
02/20/2012 17:37 Freddy​#2
Jo hier sollte sich von selbst erklären, Download im Anhang.

Habe ich mal vor edlichen Monaten geschrieben sollte aber noch funktionieren.
Hier die Source wenn du sie brauchst:

PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("MouseClickDelay","1")
Hotkeyset("{F5}","_Stop")
Global 
$Switch = False

#Region ### START Koda GUI section ### Form=
GUICreate("Klick", 175, 187, 232, 410)
GUICtrlCreateLabel("Position1", 8, 32, 47, 17)
GUICtrlCreateLabel("Position2", 8, 56, 47, 17)
GUICtrlCreateLabel("Position3", 8, 80, 47, 17)
GUICtrlCreateLabel("Position4", 8, 104, 47, 17)
$bko1 = GUICtrlCreateInput("", 56, 32, 49, 21)
$bko2 = GUICtrlCreateInput("", 56, 56, 49, 21)
$bko3 = GUICtrlCreateInput("", 56, 80, 49, 21)
$bko4 = GUICtrlCreateInput("", 56, 104, 49, 21)
GUICtrlCreateLabel("X", 72, 8, 11, 17)
$nko1 = GUICtrlCreateInput("", 112, 32, 49, 21)
$nko2 = GUICtrlCreateInput("", 112, 56, 49, 21)
$nko3 = GUICtrlCreateInput("", 112, 80, 49, 21)
$nko4 = GUICtrlCreateInput("", 112, 104, 49, 21)
GUICtrlCreateLabel("Y", 128, 8, 11, 17)
GUICtrlCreateLabel("Klickdelay in Millisek.", 8, 128, 103, 17)
$gDelay = GUICtrlCreateInput("", 112, 128, 49, 21)
$Start = GUICtrlCreateButton("Start", 8, 152, 155, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
         
Case $GUI_EVENT_CLOSE
            
Exit
         Case 
$Start
            _Start
()
    EndSwitch
WEnd

Func _Start
()
   
$xko1 = GUICtrlRead($bko1)
   
$xko2 = GUICtrlRead($bko2)
   
$xko3 = GUICtrlRead($bko3)
   
$xko4 = GUICtrlRead($bko4)
   
$yko1 = GUICtrlRead($nko1)
   
$yko2 = GUICtrlRead($nko2)
   
$yko3 = GUICtrlRead($nko3)
   
$yko4 = GUICtrlRead($nko4)
   
$Delay = GUICtrlRead($gDelay)
   While 
1
      MouseMove
($xko1,$yko1)
      
MouseClick("left")
      If 
$Switch = True then Exitloop
      Sleep
($Delay)
      
MouseMove($xko2,$yko2)
      
MouseClick("left")
      If 
$Switch = True then Exitloop
      Sleep
($Delay)
      
MouseMove($xko3,$yko3)
      
MouseClick("left")
      If 
$Switch = True then Exitloop
      Sleep
($Delay)
      
MouseMove($xko4,$yko4)
      
MouseClick("left")
      If 
$Switch = True then Exitloop
      Sleep
($Delay)
   
WEnd
EndFunc

Func _Stop
()
    
$Switch = True
 EndFunc 
PS: Mit F5 Pausierst du das Script
02/20/2012 18:19 CodeCobra#3
Quote:
Originally Posted by Snivel View Post
Jo hier sollte sich von selbst erklären, Download im Anhang.

Habe ich mal vor edlichen Monaten geschrieben sollte aber noch funktionieren.
Hier die Source wenn du sie brauchst:

PHP Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("MouseClickDelay","1")
Hotkeyset("{F5}","_Stop")
Global 
$Switch = False

#Region ### START Koda GUI section ### Form=
GUICreate("Klick", 175, 187, 232, 410)
GUICtrlCreateLabel("Position1", 8, 32, 47, 17)
GUICtrlCreateLabel("Position2", 8, 56, 47, 17)
GUICtrlCreateLabel("Position3", 8, 80, 47, 17)
GUICtrlCreateLabel("Position4", 8, 104, 47, 17)
$bko1 = GUICtrlCreateInput("", 56, 32, 49, 21)
$bko2 = GUICtrlCreateInput("", 56, 56, 49, 21)
$bko3 = GUICtrlCreateInput("", 56, 80, 49, 21)
$bko4 = GUICtrlCreateInput("", 56, 104, 49, 21)
GUICtrlCreateLabel("X", 72, 8, 11, 17)
$nko1 = GUICtrlCreateInput("", 112, 32, 49, 21)
$nko2 = GUICtrlCreateInput("", 112, 56, 49, 21)
$nko3 = GUICtrlCreateInput("", 112, 80, 49, 21)
$nko4 = GUICtrlCreateInput("", 112, 104, 49, 21)
GUICtrlCreateLabel("Y", 128, 8, 11, 17)
GUICtrlCreateLabel("Klickdelay in Millisek.", 8, 128, 103, 17)
$gDelay = GUICtrlCreateInput("", 112, 128, 49, 21)
$Start = GUICtrlCreateButton("Start", 8, 152, 155, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
         
Case $GUI_EVENT_CLOSE
            
Exit
         Case 
$Start
            _Start
()
    EndSwitch
WEnd

Func _Start
()
   
$xko1 = GUICtrlRead($bko1)
   
$xko2 = GUICtrlRead($bko2)
   
$xko3 = GUICtrlRead($bko3)
   
$xko4 = GUICtrlRead($bko4)
   
$yko1 = GUICtrlRead($nko1)
   
$yko2 = GUICtrlRead($nko2)
   
$yko3 = GUICtrlRead($nko3)
   
$yko4 = GUICtrlRead($nko4)
   
$Delay = GUICtrlRead($gDelay)
   While 
1
      MouseMove
($xko1,$yko1)
      
MouseClick("left")
      If 
$Switch = True then Exitloop
      Sleep
($Delay)
      
MouseMove($xko2,$yko2)
      
MouseClick("left")
      If 
$Switch = True then Exitloop
      Sleep
($Delay)
      
MouseMove($xko3,$yko3)
      
MouseClick("left")
      If 
$Switch = True then Exitloop
      Sleep
($Delay)
      
MouseMove($xko4,$yko4)
      
MouseClick("left")
      If 
$Switch = True then Exitloop
      Sleep
($Delay)
   
WEnd
EndFunc

Func _Stop
()
    
$Switch = True
 EndFunc 
PS: Mit F5 Pausierst du das Script
^this
Du solltest ihm vllt noch sagen , dass es in AutoIt geschrieben ist xD
So bringts ihm ja viel :3
02/20/2012 19:02 darkgolfr32#4
Vielen Dank :) funktioniert super.
02/20/2012 19:33 B-M.A.G.E#5
kann mir jemand das Script erklären :D? Sehe nicht ganz durch ^^
02/20/2012 21:23 Freddy​#6
Quote:
Originally Posted by B-M.A.G.E View Post
kann mir jemand das Script erklären :D? Sehe nicht ganz durch ^^
PHP Code:
;#################
;Include der .au3s
;#################
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("MouseClickDelay","1");Setzt Mausklickdelay auf 1 Millisekunde
Hotkeyset
("{F5}","_Stop");Setzt Hotkey (F5)
Global 
$Switch = False;Setz die $Switchvariable auf False


;#################
;Erstellen Gui (Label, Button, Inputboxen etc.)
;
#################
#Region ### START Koda GUI section ### Form=
GUICreate("Klick", 175, 187, 232, 410)
GUICtrlCreateLabel("Position1", 8, 32, 47, 17)
GUICtrlCreateLabel("Position2", 8, 56, 47, 17)
GUICtrlCreateLabel("Position3", 8, 80, 47, 17)
GUICtrlCreateLabel("Position4", 8, 104, 47, 17)
$bko1 = GUICtrlCreateInput("", 56, 32, 49, 21)
$bko2 = GUICtrlCreateInput("", 56, 56, 49, 21)
$bko3 = GUICtrlCreateInput("", 56, 80, 49, 21)
$bko4 = GUICtrlCreateInput("", 56, 104, 49, 21)
GUICtrlCreateLabel("X", 72, 8, 11, 17)
$nko1 = GUICtrlCreateInput("", 112, 32, 49, 21)
$nko2 = GUICtrlCreateInput("", 112, 56, 49, 21)
$nko3 = GUICtrlCreateInput("", 112, 80, 49, 21)
$nko4 = GUICtrlCreateInput("", 112, 104, 49, 21)
GUICtrlCreateLabel("Y", 128, 8, 11, 17)
GUICtrlCreateLabel("Klickdelay in Millisek.", 8, 128, 103, 17)
$gDelay = GUICtrlCreateInput("", 112, 128, 49, 21)
$Start = GUICtrlCreateButton("Start", 8, 152, 155, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg 
= GUIGetMsg()
    Switch 
$nMsg
         
Case $GUI_EVENT_CLOSE
            
Exit
         Case 
$Start
            _Start
();Wenn der Startbutton gedrückt wird, startet die Funktion _Start()
    EndSwitch
WEnd


Func _Start
();Start
   $xko1 
= GUICtrlRead($bko1);Liest Inputbox1
   $xko2 
= GUICtrlRead($bko2);Liest Inputbox2
   $xko3 
= GUICtrlRead($bko3);Liest Inputbox3
   $xko4 
= GUICtrlRead($bko4);Liest Inputbox4
   $yko1 
= GUICtrlRead($nko1);Liest Inputbox5
   $yko2 
= GUICtrlRead($nko2);Liest Inputbox6
   $yko3 
= GUICtrlRead($nko3);Liest Inputbox7
   $yko4 
= GUICtrlRead($nko4);Liest Inputbox8
   $Delay 
= GUICtrlRead($gDelay);Liest Inputbox9
   
While 1; Startet Endlosschleife
      MouseMove
($xko1,$yko1);Bewegt die Maus auf die in die Inputbox1 (X) und Inputbox2 (Y) eingegebenen Koordinaten
      MouseClick
("left");Mausklick links
      
If $Switch = True then Exitloop;Wenn F5 gedrückt wird (siehe Zeile 11), wird die Funktion _Stop aufgerufen (Zeile 82) und setzt $Switch von False auf True und wenn $Switch = True ist wird der Loop beendet
      Sleep
($Delay);Wartet die eingegebne Zeit
      MouseMove
($xko2,$yko2)
      
MouseClick("left")
      If 
$Switch = True then Exitloop
      Sleep
($Delay)
      
MouseMove($xko3,$yko3)
      
MouseClick("left")
      If 
$Switch = True then Exitloop
      Sleep
($Delay)
      
MouseMove($xko4,$yko4)
      
MouseClick("left")
      If 
$Switch = True then Exitloop
      Sleep
($Delay)
   
WEnd
EndFunc

Func _Stop
()
    
$Switch = True
EndFunc