Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[PYTANIE] Autoit- jeździ myszka i wciska


Rekomendowane odpowiedzi

Opublikowano

Siema, coś ostatnio mnie do autoit ciągnie i jestem teraz ciekawy jak zrobić takie coś, ze np mamy 3 pola, wciskamy przycisk ustawiamy pozycję myszki (Automatycznie ustawia autoit) i on będzie nam poruszał myszką i wciskał LPM. Czytałem o MouseMove, ale to nie to

 

@edit1

Dokładnie chodzi mi o coś takiego podobnego jak w nextbot

6fc086389b796c47.jpg
Siedzę na mpc gdy jest czas, dzięki temu dużo się od was uczę dzięki!!

Opublikowano

Siema, coś ostatnio mnie do autoit ciągnie i jestem teraz ciekawy jak zrobić takie coś, ze np mamy 3 pola, wciskamy przycisk ustawiamy pozycję myszki (Automatycznie ustawia autoit) i on będzie nam poruszał myszką i wciskał LPM. Czytałem o MouseMove, ale to nie to

 

@edit1

Dokładnie chodzi mi o coś takiego podobnego jak w nextbot

 

MouseClick ( "left" [, 0, 0 [, 1 [, 100]]] ) = Wykonuje przycisk lewym przyciskiem myszki pozycja 0,0 na monitorze ( Lewy górny róg ), 1 odpowiada za ilość kliknięć, a 100 odpowiada za prędkość ale przy jednym kliknięciu to nie ma znaczenia. 100 = 1 sek.

 

Możesz też skorzystać z opcji MouseMove do poruszania się myszką a Send do użycia przycisku np. Enter lub LPM

Nukereq.png
Opublikowano

Kiope no ok ale 1000ms to 1s. A mialbys to zrobic klikanie myszka i poruszanie nia. Jakis nowy kod. Bo czy mi to wypali to nw. Ake wiem skad 0 0 wezme. Sory ale na telefonie teraz jestem.

6fc086389b796c47.jpg
Siedzę na mpc gdy jest czas, dzięki temu dużo się od was uczę dzięki!!

Opublikowano

A mógłbym poprosić, aby ktoś zrobił jakiś krótki kodzik, bo x y to wiem jak znaleźć.

6fc086389b796c47.jpg
Siedzę na mpc gdy jest czas, dzięki temu dużo się od was uczę dzięki!!

Opublikowano

a po co ma przesuwać myszkę i dopiero klikać, chcesz zaśmiecać dodatkowym i zbędnym kodem program ? mouseclick robi to samo bez zbędnego tracenia czasu na zmianę położenia i klika bezpośrednio wykonując mousemove w poleceniu

If you = stupid then

insert(foot.in.your.ass)

end if

licznik-54-96732-stat.png

Opublikowano

No ale, to ma np klikać w 3 miejscach. i co wtedy?? Musi przesunąć myszkę, bynajmniej jest taki mój tok myślenia. Jeśli można to dalej proszę o kodzik :)

 

@edit1

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 303, 303, 192, 124)
$Input1 = GUICtrlCreateInput("x", 8, 8, 49, 21)
$Input2 = GUICtrlCreateInput("y", 72, 8, 49, 21)
$Group1 = GUICtrlCreateGroup("", 8, 32, 281, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("", 136, 8, 1, 289)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input3 = GUICtrlCreateInput("y", 216, 8, 49, 21)
$Input4 = GUICtrlCreateInput("x", 152, 8, 49, 21)
$Input5 = GUICtrlCreateInput("x", 8, 48, 49, 21)
$Input6 = GUICtrlCreateInput("y", 72, 48, 49, 21)
$Group3 = GUICtrlCreateGroup("", 8, 80, 281, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Info", 240, 280, 49, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
MsgBox(0, "Info", "lol" & @CRLF & "lol" & @CRLF & "lol")
EndSwitch

WEnd

 

Na razie tylko GUI zrobiłem :)

 

@edit2

Co ja źle robię wywala mi:

>Running AU3Check (1.54.22.0) from:D:\Program Files (x86)\AutoIt3

D:\myszkaklik.au3(34,22) : ERROR: syntax error

MouseClick ( "left", [

~~~~~~~~~~~~~~~~~~~~~^

 

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 303, 303, 192, 124)
$Input1 = GUICtrlCreateInput("x", 8, 8, 49, 21)
$Input2 = GUICtrlCreateInput("y", 72, 8, 49, 21)
$Group1 = GUICtrlCreateGroup("", 8, 32, 281, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("", 136, 8, 1, 289)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input3 = GUICtrlCreateInput("y", 216, 8, 49, 21)
$Input4 = GUICtrlCreateInput("x", 152, 8, 49, 21)
$Input5 = GUICtrlCreateInput("x", 8, 48, 49, 21)
$Input6 = GUICtrlCreateInput("y", 72, 48, 49, 21)
$Group3 = GUICtrlCreateGroup("", 8, 80, 281, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Info", 240, 280, 49, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
 Case $GUI_EVENT_CLOSE
  Exit
   Case $Button1
  MsgBox(0, "Info", "lol" & @CRLF & "lol" & @CRLF & "lol")
EndSwitch
MouseClick ( "left" [, 0, 0 [, 1 [, 100]]] )
WEnd

6fc086389b796c47.jpg
Siedzę na mpc gdy jest czas, dzięki temu dużo się od was uczę dzięki!!

Opublikowano

Udało się, ale co teraz zrobić aby pobierało miejsce kliknięcie z input1 i input2

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 303, 303, 192, 124)
$Input1 = GUICtrlCreateInput("x", 8, 8, 49, 21)
$Input2 = GUICtrlCreateInput("y", 72, 8, 49, 21)
$Group1 = GUICtrlCreateGroup("", 8, 32, 281, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("", 136, 8, 1, 289)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input3 = GUICtrlCreateInput("y", 216, 8, 49, 21)
$Input4 = GUICtrlCreateInput("x", 152, 8, 49, 21)
$Input5 = GUICtrlCreateInput("x", 8, 48, 49, 21)
$Input6 = GUICtrlCreateInput("y", 72, 48, 49, 21)
$Group3 = GUICtrlCreateGroup("", 8, 80, 281, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Info", 240, 280, 49, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
HotKeySet("{F5}", "start")
HotKeySet("{F6}", "stop")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
 Case $GUI_EVENT_CLOSE
  Exit
   Case $Button1
  MsgBox(0, "Info", "lol" & @CRLF & "lol" & @CRLF & "lol")
EndSwitch
WEnd
Func start()
MouseClick ( "left", "$Input1", "$Input2", "1", "100" )
EndFunc   ;==>start
Func stop()
MouseClick ( "left", "0", "0", "1", "100" )
EndFunc   ;==>stop

6fc086389b796c47.jpg
Siedzę na mpc gdy jest czas, dzięki temu dużo się od was uczę dzięki!!

Opublikowano

Ehh... PODSTAWOWE RZECZY!

Odczytywanie wartości z kontrolek: GUICtrlRead...

Poprawiony kod (zamiast pętli z guigetmsg, dałem tryb OnEvent):

#include <GUIConstantsEx.au3>
HotKeySet("{F3}", "start")
HotKeySet("{F4}", "stop")

;deklaracja tabliy które posłuzy za uchwyty do inputów
Global $Input[6]

Opt ("GuiOnEventMode", 1) ;uruchomienie trybu onevent
$Form1 = GUICreate("Form1", 303, 303, 192, 124)
$Input[0] = GUICtrlCreateInput("x", 8, 8, 49, 21)
$Input[1] = GUICtrlCreateInput("y", 72, 8, 49, 21)
$Group1 = GUICtrlCreateGroup("", 8, 32, 281, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("", 136, 8, 1, 289)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input[2] = GUICtrlCreateInput("x", 152, 8, 49, 21)
$Input[3] = GUICtrlCreateInput("y", 216, 8, 49, 21)
$Input[4] = GUICtrlCreateInput("x", 8, 48, 49, 21)
$Input[5] = GUICtrlCreateInput("y", 72, 48, 49, 21)
$Group3 = GUICtrlCreateGroup("", 8, 80, 281, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetOnEvent ($GUI_EVENT_CLOSE, "wyjscie") ;przypisanie funkcji 'wyjscie' do przycisku 'x' na belce tytułowej GUI
GUISetState(@SW_SHOW)

Func wyjscie()
   Exit
EndFunc

Func start()
   ;tablica która posłuzy do odczytania danych z inputów
   Local $Read[6]

   ;odczytanie wartosci z inputów do tablicy
   For $i = 0 To 5 Step +1
       $Read[$i] = GUICtrlRead($Input[$i])
   Next

   For $i = 0 To 5 Step +2
       MouseClick("left", $Read[$i], $Read[$i+1]) ;kliknij myszka
   Next
EndFunc

Func stop()
   MouseClick("left", 0, 0)
EndFunc

While 1
   Sleep (100)
WEnd

 

Jakbyś miał jeszcze jakieś uwagi, to pisz...

Sory za ewentualne bugi w skryptach, ale jest wpół do północy, i nie mam łba do tego w tym momencie...

846331404756772371599.jpeg
Opublikowano

No tak, ale u ciebie nie zapętla i nie wyłącza się, czyli jak wcisnę F4 to na nowo się włącza. No ok u ciebie bynajmniej pobiera dane z $Input, ale siedziałem do nocy i też mi nie zapętla i nie wyłącza.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("Form1", 274, 305, 192, 124)
$Input1 = GUICtrlCreateInput("x", 8, 152, 49, 21)
$Input2 = GUICtrlCreateInput("y", 72, 152, 49, 21)
$Group1 = GUICtrlCreateGroup("", 8, 176, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("", 136, 8, 1, 289)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input5 = GUICtrlCreateInput("x", 8, 192, 49, 21)
$Input6 = GUICtrlCreateInput("y", 72, 192, 49, 21)
$Group3 = GUICtrlCreateGroup("", 8, 216, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Info", 200, 280, 49, 17)
$Input9 = GUICtrlCreateInput("y", 72, 232, 49, 21)
$Input10 = GUICtrlCreateInput("x", 8, 232, 49, 21)
$Group4 = GUICtrlCreateGroup("", 8, 256, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input11 = GUICtrlCreateInput("ilosc klik", 144, 232, 49, 21)
$Input12 = GUICtrlCreateInput("speed", 208, 232, 49, 21)
$Input7 = GUICtrlCreateInput("ilosc klik", 144, 192, 49, 21)
$Input8 = GUICtrlCreateInput("speed", 208, 192, 49, 21)
$Input3 = GUICtrlCreateInput("ilosc klik", 144, 152, 49, 21)
$Input4 = GUICtrlCreateInput("speed", 208, 152, 49, 21)
$Group5 = GUICtrlCreateGroup("", 8, 136, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pozycja = GUICtrlCreateButton("Pozycja", 8, 272, 57, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
HotKeySet("{F5}", "start")
HotKeySet("{F6}", "stop")

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
MsgBox(0, "Info", "lol" & @CRLF & "lol" & @CRLF & "lol")
Case $Pozycja
Local $x, $y, $title
$title = "To jest tytuł okna."
$x = MouseGetPos(0)
$y = MouseGetPos(1)
MsgBox(0, $title, "Pozycja myszy to: " & @LF & $x &", " & $y & "!")
EndSwitch
WEnd
Func start()
MouseClick ( "left", 630, 465, 2, 100 )
MouseClick ( "left", 918, 523, 2, 100 )
EndFunc ;==>start
Func stop()
MouseClick ( "left", 630, 465, 2, 100 )
MouseClick ( "left", 918, 523, 2, 100 )
EndFunc ;==>stop

 

@edit, ale działa chodziarz przycisk info i działa też Pozycja. No i ty też do nocy :) i tez ci nie zapętla i nie "Stopuje". Ciulowa noc widocznie była :) Ale jakbyś mógł ten teraz kod co ja narzuciłem coś z nim podobnego zrobić to nw :), bo próbowałem tak jak ty ale, gdy dodam kolejną opcje klikania to cos mi się chrzani, działa ale nie jeździ tam gdzie ma.

6fc086389b796c47.jpg
Siedzę na mpc gdy jest czas, dzięki temu dużo się od was uczę dzięki!!

Opublikowano
Opublikowano

Tak mam jakieś pojęcie ale nie takie ogromne. GUI wiadomo co robi, przycisk info pokaże jakieś napisy. Przycisk Pozycja pokazuje pozycję myszki. MouseClick jedzie i naciska 2x w danym miejscu lewy. Tylko ja nie jestem jeszcze taki zajebis*y, Klikacza z wpisywaniem czasu i przycisków itp do inputa zrobię już sam, ale takiego czegoś jeszcze nie. nie chciałem prosić o gotowca bo jak uczyłem się na PW o klikaczu to ja dałem trochę kodu i tam mi zrobił i się pytałem co to robi co tamto i tak się nauczyłem. No to niech będzie. Czy mógłby ktoś mi zrobić gotowca?

 

@edit

i tak widziałem to:

^^ Świetne podejście do sprawy, jeśli dla global moderatora pomoc to dawanie ludziom gotowego kodu, to możemy śmiało zmienić nazwę działu na "AutoIt - tutaj znajdziesz sobie leszcza który odwali za ciebie całą robotę"!

 

Ale trzeba patrzeć że jedni mają mózg dobry do tego a inni do tego, łatwiej zapamiętają to a inni to. Ja już wg nic nie rozumiem.

6fc086389b796c47.jpg
Siedzę na mpc gdy jest czas, dzięki temu dużo się od was uczę dzięki!!

Opublikowano
Ale trzeba patrzeć że jedni mają mózg dobry do tego a inni do tego, łatwiej zapamiętają to a inni to. Ja już wg nic nie rozumiem.

Ale niestety tacy jak ty muszą zapłacić.

Opublikowano

To chyba tylko ty :). To po co jest ten dział?? To dajcie nazwe AutoIt dział płatny.

 

@edit

Sam zasugerowałeś że chcę gotowca, wiec proszę :). Tak to jest jak się nie myśli tylko piszę, albo nie czyta tematu od początku tylko od ostatniego postu.

 

@edit2

Ja tylko chcę żeby to się chociaż w nieskończoność zapętlało i nic więcej wtedy nie chcę. Tylko żeby była pętla nieskończona dopóki nie wciśnie się F6. Bo właśnie te 2 rzeczy mi nie chodzą, nie wyłącza się tylko się włącza na nowo i robi to tylko raz, a ma zapętlać dopóki się tego nie wyłączy.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("Klikacz Myszki", 274, 305, 192, 124)
$Input1 = GUICtrlCreateInput("x", 8, 152, 49, 21)
$Input2 = GUICtrlCreateInput("y", 72, 152, 49, 21)
$Group1 = GUICtrlCreateGroup("", 8, 176, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("", 136, 8, 1, 289)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input5 = GUICtrlCreateInput("x", 8, 192, 49, 21)
$Input6 = GUICtrlCreateInput("y", 72, 192, 49, 21)
$Group3 = GUICtrlCreateGroup("", 8, 216, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Info", 200, 280, 49, 17)
$Input9 = GUICtrlCreateInput("y", 72, 232, 49, 21)
$Input10 = GUICtrlCreateInput("x", 8, 232, 49, 21)
$Group4 = GUICtrlCreateGroup("", 8, 256, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input11 = GUICtrlCreateInput("ilosc klik", 144, 232, 49, 21)
$Input12 = GUICtrlCreateInput("speed", 208, 232, 49, 21)
$Input7 = GUICtrlCreateInput("ilosc klik", 144, 192, 49, 21)
$Input8 = GUICtrlCreateInput("speed", 208, 192, 49, 21)
$Input3 = GUICtrlCreateInput("ilosc klik", 144, 152, 49, 21)
$Input4 = GUICtrlCreateInput("speed", 208, 152, 49, 21)
$Group5 = GUICtrlCreateGroup("", 8, 136, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pozycja = GUICtrlCreateButton("Pozycja", 8, 272, 57, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
HotKeySet("{F5}", "start")
HotKeySet("{F6}", "stop")

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
 Case $GUI_EVENT_CLOSE
  Exit
   Case $Button1
  MsgBox(0, "Info", "lol" & @CRLF & "lol" & @CRLF & "lol")
  Case $Pozycja
  Local $x, $y, $title
$title = "Pozycja Myszy."
$x = MouseGetPos(0)
$y = MouseGetPos(1)
MsgBox(0, $title, "Pozycja myszy to: " & @LF & $x &", " & $y & "!")
EndSwitch
WEnd
Func start()
MouseClick ( "left", 598, 388, 2, 80 )
MouseClick ( "left", 819, 400, 2, 80 )
MouseClick ( "left", 1009, 393, 2, 80 )
EndFunc   ;==>start
Func stop()
MouseClick ( "left", 598, 388, 2, 80 )
MouseClick ( "left", 819, 400, 2, 80 )
MouseClick ( "left", 1009, 393, 2, 80 )
EndFunc   ;==>stop

6fc086389b796c47.jpg
Siedzę na mpc gdy jest czas, dzięki temu dużo się od was uczę dzięki!!

Opublikowano

 

 

$spam = True
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("Klikacz Myszki", 275, 306, 192, 124)
$Input1 = GUICtrlCreateInput("x", 8, 152, 49, 21)
$Input2 = GUICtrlCreateInput("y", 72, 152, 49, 21)
$Group1 = GUICtrlCreateGroup("", 8, 176, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("", 136, 8, 1, 289)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input5 = GUICtrlCreateInput("x", 8, 192, 49, 21)
$Input6 = GUICtrlCreateInput("y", 72, 192, 49, 21)
$Group3 = GUICtrlCreateGroup("", 8, 216, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Info", 200, 280, 49, 17)
$Input9 = GUICtrlCreateInput("y", 72, 232, 49, 21)
$Input10 = GUICtrlCreateInput("x", 8, 232, 49, 21)
$Group4 = GUICtrlCreateGroup("", 8, 256, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input11 = GUICtrlCreateInput("ilosc klik", 144, 232, 49, 21)
$Input12 = GUICtrlCreateInput("speed", 208, 232, 49, 21)
$Input7 = GUICtrlCreateInput("ilosc klik", 144, 192, 49, 21)
$Input8 = GUICtrlCreateInput("speed", 208, 192, 49, 21)
$Input3 = GUICtrlCreateInput("ilosc klik", 144, 152, 49, 21)
$Input4 = GUICtrlCreateInput("speed", 208, 152, 49, 21)
$Group5 = GUICtrlCreateGroup("", 8, 136, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pozycja = GUICtrlCreateButton("Pozycja", 8, 272, 57, 25)
$stop = GUICtrlCreateButton("stop", 72, 280, 49, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
HotKeySet("{F5}", "start")
HotKeySet("{F6}", "stop")
Global Const $time = 200
Global Const $kl1 = "{15500}"

While $spam = True
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
MsgBox(0, "Info", "lol" & @CRLF & "lol" & @CRLF & "lol")
Case $Pozycja
Local $x, $y, $title
$title = "Pozycja Myszy."
$x = MouseGetPos(0)
$y = MouseGetPos(1)
MsgBox(0, $title, "Pozycja myszy to: " & @LF & $x &", " & $y & "!")
Case $stop
$spam = False
EndSwitch
WEnd
Func start()
MouseClick ( "left", 598, 388, 2, 80 )
MouseClick ( "left", 819, 400, 2, 80 )
MouseClick ( "left", 1009, 393, 2, 80 )
EndFunc ;==>start
Func stop()
MouseClick ( "left", 598, 388, 2, 80 )
MouseClick ( "left", 819, 400, 2, 80 )
MouseClick ( "left", 1009, 393, 2, 80 )
EndFunc ;==>stop

 

 

Czyli to ma wyglądać jakoś tak? Czy coś źle. Bo niby się włącza. I tak myślę bo zrobiłem na $stop (Button) to chyba nie wypali, bo skoro będzie zapętlać w nieskończoność, to ja myszką tam nie ruszę.

 

@edit1

Coś źle zrobiłem bo gdy włączę to pojawia mi się MsgBox spod while 1 "Info" jak usunę info to pojawi się pozycja myszy itd. Czy mógłby ktoś cos doradzić

Kod:

 

 

#NoTrayIcon
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$spam = false
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Info", 200, 280, 49, 17)
$Input9 = GUICtrlCreateInput("y", 72, 232, 49, 21)
$Input10 = GUICtrlCreateInput("x", 8, 232, 49, 21)
$Group4 = GUICtrlCreateGroup("", 8, 256, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input11 = GUICtrlCreateInput("ilosc klik", 144, 232, 49, 21)
$Input12 = GUICtrlCreateInput("speed", 208, 232, 49, 21)
$Input7 = GUICtrlCreateInput("ilosc klik", 144, 192, 49, 21)
$Input8 = GUICtrlCreateInput("speed", 208, 192, 49, 21)
$Input3 = GUICtrlCreateInput("ilosc klik", 144, 152, 49, 21)
$Input4 = GUICtrlCreateInput("speed", 208, 152, 49, 21)
$Group5 = GUICtrlCreateGroup("", 8, 136, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pozycja = GUICtrlCreateButton("Pozycja", 8, 272, 57, 25)
$stop = GUICtrlCreateButton("stop", 72, 280, 49, 17)
$start = GUICtrlCreateButton("start", 72, 264, 49, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
 Case $GUI_EVENT_CLOSE
  Exit
 Case $Button1
  MsgBox(0, "Info", "Klikacz by" & @CRLF & "xxx- trochę kodu i całe GUI" & @CRLF & "xxx - Większość Kodu")
  Case $Pozycja
  Local $x, $y, $title
$title = "Pozycja Myszy."
$x = MouseGetPos(0)
$y = MouseGetPos(1)
MsgBox(0, $title, "Pozycja myszy to: " & @LF & $x &", " & $y & "!")
case $start
$spam = true
case $stop
$spam = false
EndSwitch
if $spam then
MouseClick ( "left", 598, 388, 2, 80 )
MouseClick ( "left", 1009, 393, 2, 80 )
MouseClick ( "left", 819, 400, 2, 80 )
endif
WEnd

 

 

6fc086389b796c47.jpg
Siedzę na mpc gdy jest czas, dzięki temu dużo się od was uczę dzięki!!

Opublikowano

Używanie pętli GUIGetMsg w tym przypadku jest nieco kijowym pomysłem, bo kod się staje nieczytelny.

A funkcje należy najlepiej wstawić przed pętlą i je wywołać :)

 

$spam = True

;hotkeysety trzymaj na górze 
HotKeySet("{F5}", "start")
HotKeySet("{F6}", "stop")

Opt ("GuiOnEventMode", 1) ;uruchomienie trybu OnEvent
#include <GUIConstantsEx.au3>
$Form1_1 = GUICreate("Klikacz Myszki", 275, 306, 192, 124)
$Input1 = GUICtrlCreateInput("x", 8, 152, 49, 21)
$Input2 = GUICtrlCreateInput("y", 72, 152, 49, 21)
$Group1 = GUICtrlCreateGroup("", 8, 176, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("", 136, 8, 1, 289)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input5 = GUICtrlCreateInput("x", 8, 192, 49, 21)
$Input6 = GUICtrlCreateInput("y", 72, 192, 49, 21)
$Group3 = GUICtrlCreateGroup("", 8, 216, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Info", 200, 280, 49, 17)
$Input9 = GUICtrlCreateInput("y", 72, 232, 49, 21)
$Input10 = GUICtrlCreateInput("x", 8, 232, 49, 21)
$Group4 = GUICtrlCreateGroup("", 8, 256, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input11 = GUICtrlCreateInput("ilosc klik", 144, 232, 49, 21)
$Input12 = GUICtrlCreateInput("speed", 208, 232, 49, 21)
$Input7 = GUICtrlCreateInput("ilosc klik", 144, 192, 49, 21)
$Input8 = GUICtrlCreateInput("speed", 208, 192, 49, 21)
$Input3 = GUICtrlCreateInput("ilosc klik", 144, 152, 49, 21)
$Input4 = GUICtrlCreateInput("speed", 208, 152, 49, 21)
$Group5 = GUICtrlCreateGroup("", 8, 136, 257, 9)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Pozycja = GUICtrlCreateButton("Pozycja", 8, 272, 57, 25)
$stop = GUICtrlCreateButton("stop", 72, 280, 49, 17)
GUISetOnEvent ($GUI_EVENT_CLOSE, "koniec_petli")
GUICtrlSetOnEvent($Pozycja, "pozycja")
GUICtrlSetOnEvent ($Button1, "info")
GUICtrlSetOnEvent($stop, "stop")
GUISetState(@SW_SHOW)

Global Const $time = 200
Global Const $kl1 = "{15500}"

Func koniec_petli()
   $spam = False
EndFunc

Func info()
   MsgBox(0, "Info", "lol" & @CRLF & "lol" & @CRLF & "lol")
EndFunc

Func pozycja()
   Local $x, $y, $title
   $title = "Pozycja Myszy."
   $x = MouseGetPos(0)
   $y = MouseGetPos(1)
   MsgBox(0, $title, "Pozycja myszy to: " & @LF & $x &", " & $y & "!")
;ewentualnie mozesz zrobic tak:
;Local $pos, $title
;$title = "Pozycja Myszy."
;$pos = MouseGetPos()
;MsgBox(0, $title, "Pozycja myszy to: " & @LF & $pos[0] &", " & $pos[1] & "!")
EndFunc

Func start()
   MouseClick ( "left", 598, 388, 2, 80 )
   MouseClick ( "left", 819, 400, 2, 80 )
   MouseClick ( "left", 1009, 393, 2, 80 )
EndFunc

Func stop()
   MouseClick ( "left", 598, 388, 2, 80 )
   MouseClick ( "left", 819, 400, 2, 80 )
   MouseClick ( "left", 1009, 393, 2, 80 )
EndFunc

While $spam = True
   Sleep (100)
WEnd

846331404756772371599.jpeg
Opublikowano

Fajnie. Musze poczytać o tym OnEvent co to daje i co to jest. Ale teraz tak, znowu zrobi tylko raz i się wyłączy, ale nie że program, czyli nie zapętla próbowałem zmienić sleep na mniejsze i też nic, i jak się wciśnie stop lub F6, to włącza od początku. Czyli co kod to jest to samo, nie zapętla i nie zatrzymuję pracy.

6fc086389b796c47.jpg
Siedzę na mpc gdy jest czas, dzięki temu dużo się od was uczę dzięki!!

Opublikowano

chodzi o to, żeby szybciej przesuwał? to daj 0 zamiast 100...

KOLEJNY ZNAWCA. Ja pitole.

 

 

od 0 do 100 jest skala. A przy jednym kliknięciu 0 = 100. Umiesz czytać helpa jeleniu?

 

X i Y to sa pozycje ekranu. Zrób print scren, i wklej do painta -> na dole jak poruszysz myszką po obrazku będziesz miał Kordy x i y.

 

 

 

Zaraz coś zmajstruje, nie pękaj :D

Nukereq.png
Opublikowano

Dobre :D Paint=X Y

Nie u mnie nie zapętla i nie wyłącza. Tak to chodzi tylko w kółko trzeba naciskać f5.

6fc086389b796c47.jpg
Siedzę na mpc gdy jest czas, dzięki temu dużo się od was uczę dzięki!!

Opublikowano
od 0 do 100 jest skala. A przy jednym kliknięciu 0 = 100. Umiesz czytać helpa jeleniu?

LOL? A wiesz, że chodzi o czas przesuwania myszki do danego punktu, co nie jest w żadnym stopniu zależne od ilości ustawionych kliknięć?

 

od 0 do 100 jest skala.

to nie skala, co najwyżej zakres

Opublikowano

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Math.au3>
#include <Misc.au3>
FileInstall('G:\Programs\AMC\Icons\AMC.jpg', @ScriptDir & '\Icons\AMC.jpg')
FileInstall('G:\Programs\AMC\Icons\Mouse.ico', @ScriptDir & '\Icons\Mouse.ico')
HotKeySet("{ENTER}", "_Action")
HotKeySet("{PAUSE}", "TogglePause")
Global $Paused
;Local $Xinput, $Yinput, $Input3, $hLabel, $Button2  ; <<<<<<<<<<<<<<<<<<< Not needed - they are automatically Global in scope
$Form1 = GUICreate("Auto Mouse Clicker", 287, 165, 192, 124)
GUISetIcon(@ScriptDir & '\Icons\Mouse.ico')
GUISetBkColor(0x000000)
$Pic1 = GUICtrlCreatePic(@ScriptDir & '\Icons\AMC.jpg', 16, 0, 257, 57, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Button1 = GUICtrlCreateButton("Start", 110, 128, 73, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Get Coords", 200, 128, 73, 25)
$Xinput = GUICtrlCreateInput("", 72, 56, 73, 21)
$Yinput = GUICtrlCreateInput("", 72, 88, 73, 21)
$Label1 = GUICtrlCreateLabel("X-Coord", 8, 56, 64, 21)
GUICtrlSetFont(-1, 10, 400, 0, "Lucida Calligraphy")
GUICtrlSetColor(-1, 0x00FF00)
$Label2 = GUICtrlCreateLabel("Y-Coord", 8, 88, 63, 21)
GUICtrlSetFont(-1, 10, 400, 0, "Lucida Calligraphy")
GUICtrlSetColor(-1, 0x00FF00)
$Timeinput = GUICtrlCreateInput("30", 168, 56, 49, 21)
$Label3 = GUICtrlCreateLabel("Seconds", 219, 60, 66, 21)
GUICtrlSetFont(-1, 10, 400, 0, "Lucida Calligraphy")
GUICtrlSetColor(-1, 0x00FF00)
$Label4 = GUICtrlCreateLabel("How often to" & @LF & "click in seconds.", 160, 80, 200, 37)
GUICtrlSetFont(-1, 10, 400, 0, "Lucida Calligraphy")
GUICtrlSetColor(-1, 0x00FF00)
GUIStartGroup() ; <<<<<<<<<<<<<<<<<<<<<<<<<<<< This should be in to create a group of radio buttons
$LeftRadio = GUICtrlCreateRadio("Radio1", 6, 120, 17, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$RightRadio = GUICtrlCreateRadio("Radio2", 6, 140, 17, 17)
GUIStartGroup() ; <<<<<<<<<<<<<<<<<<<<<<<<<<<< This should be in to end the group of radio buttons
$Label5 = GUICtrlCreateLabel("Left Mouse?", 22, 120, 87, 21)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Calligraphy")
GUICtrlSetColor(-1, 0x00FF00)
$Label6 = GUICtrlCreateLabel("Right Mouse?", 22, 141, 85, 19)
GUICtrlSetFont(-1, 8, 400, 0, "Lucida Calligraphy")
GUICtrlSetColor(-1, 0x00FF00)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
   Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
	    Exit
    Case $Button2
	    ToolTip('Please click anywhere on the screen to set your coordinates', 1024, 738)
	    _get_mousepos()
	    ToolTip("")
    Case $Button1
	    _Action()
   EndSwitch
WEnd
Func TogglePause()
   If GUICtrlRead($Button1) = "Start" Then Return ; <<<<<<<<<<<<<<<<<< No point in pausing if it is not auto-clicking!
   $Paused = Not $Paused
   While $Paused
    Sleep(100)
    ToolTip('Auto Mouse Clicker is "Paused"', 0, 0)
   WEnd
   ToolTip("")
EndFunc   ;==>TogglePause
Func _Action()
   Local $sMouse_Button, $X_Pos, $Y_Pos, $T_ms, $Begin
   GUICtrlSetData($Button1, "Stop")
   ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< This is where you "do things"
   If GUICtrlRead($LeftRadio) = 1 Then
    $sMouse_Button = "left"
   Else
    $sMouse_Button = "right"
   EndIf
   $X_Pos = GUICtrlRead($Xinput)
   $Y_Pos = GUICtrlRead($Yinput)
   $T_ms = GUICtrlRead($Timeinput) * 1000
   While 1
    MouseClick($sMouse_Button, $X_Pos, $Y_Pos, 1) ; $T_ms) <<<<<<<<< Speed here is speed of mouse movement to the position, not delay
    $Begin = TimerInit() ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< This section gives the delay
    While TimerDiff($Begin) < $T_ms
	    Switch GUIGetMsg()
		    Case $GUI_EVENT_CLOSE
			    Exit
		    Case $Button1
			    GUICtrlSetData($Button1, "Start")
			    ExitLoop 2
	    EndSwitch
    WEnd
   WEnd
EndFunc   ;==>_Action
Func _get_mousepos()
   If GUICtrlRead($Button1) = "Stop" Then Return ; <<<<<<<<<<<<<<<< Only works when mouse if not auto-clicking
   ;Local $X_Input, $Y_Input
   #cs
   ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Not the same spelling as when created in GUI!!!!!!!!!!!!!!
   ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< The originals are Global.  Redeclaring them as Local would override this.
   #ce
   Local $dll = DllOpen("user32.dll")
   While Not _IsPressed("01", $dll)
    Sleep(10)
   WEnd
   DllClose($dll)
   Local $Mouse_Pos = MouseGetPos()
   GUICtrlSetData($Xinput, $Mouse_Pos[0]) ; <<<<<<< Changed spelling to match input created in GUI
   GUICtrlSetData($Yinput, $Mouse_Pos[1]) ; <<<<<<< Changed spelling to match input created in GUI
EndFunc   ;==>_get_mousepos

 

 

Uzyj kodu, i skorzystaj z mojego gui:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Documents and Settings\smietnik\Moje dokumenty\gidzekolwiek.kxf
$Form1 = GUICreate("Form1", 623, 442, 217, 141)
$Edit1 = GUICtrlCreateEdit("", 400, 40, 193, 321)
GUICtrlSetData(-1, "Edit1")
$Pierwsza = GUICtrlCreateGroup("Pierwsza", 16, 16, 225, 73)
$Button2 = GUICtrlCreateButton("-", 40, 56, 17, 17)
$Button3 = GUICtrlCreateButton("+", 72, 56, 17, 17)
$Button4 = GUICtrlCreateButton("-", 88, 56, 17, 17)
$Button1 = GUICtrlCreateButton("+", 24, 56, 17, 17)
$Input2 = GUICtrlCreateInput("Y", 72, 32, 33, 21)
$Input1 = GUICtrlCreateInput("1", 24, 32, 33, 21)
$Cyfra_speed = GUICtrlCreateLabel("Cyfra_speed", 144, 64, 63, 17)
$Button5 = GUICtrlCreateButton("+", 160, 24, 17, 17)
$Button6 = GUICtrlCreateButton("-", 160, 40, 17, 17)
$Input3 = GUICtrlCreateInput("Ile razy", 112, 32, 41, 21)
$Button7 = GUICtrlCreateButton("«", 120, 64, 17, 17)
$Button8 = GUICtrlCreateButton("»", 208, 64, 17, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group1 = GUICtrlCreateGroup("Druga", 16, 104, 225, 73)
$Button9 = GUICtrlCreateButton("-", 40, 144, 17, 17)
$Button10 = GUICtrlCreateButton("+", 72, 144, 17, 17)
$Button11 = GUICtrlCreateButton("-", 88, 144, 17, 17)
$Button12 = GUICtrlCreateButton("+", 24, 144, 17, 17)
$Input4 = GUICtrlCreateInput("Y", 72, 120, 33, 21)
$Input5 = GUICtrlCreateInput("X", 24, 120, 33, 21)
$Label1 = GUICtrlCreateLabel("Cyfra_speed", 144, 152, 63, 17)
$Button13 = GUICtrlCreateButton("+", 160, 112, 17, 17)
$Button14 = GUICtrlCreateButton("-", 160, 128, 17, 17)
$Input6 = GUICtrlCreateInput("Ile razy", 112, 120, 41, 21)
$Button15 = GUICtrlCreateButton("«", 120, 152, 17, 17)
$Button16 = GUICtrlCreateButton("»", 208, 152, 17, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Trzecia", 16, 192, 225, 73)
$Button17 = GUICtrlCreateButton("-", 40, 232, 17, 17)
$Button18 = GUICtrlCreateButton("+", 72, 232, 17, 17)
$Button19 = GUICtrlCreateButton("-", 88, 232, 17, 17)
$Button20 = GUICtrlCreateButton("+", 24, 232, 17, 17)
$Input7 = GUICtrlCreateInput("Y", 72, 208, 33, 21)
$Input8 = GUICtrlCreateInput("X", 24, 208, 33, 21)
$Label2 = GUICtrlCreateLabel("Cyfra_speed", 144, 240, 63, 17)
$Button21 = GUICtrlCreateButton("+", 160, 200, 17, 17)
$Button22 = GUICtrlCreateButton("-", 160, 216, 17, 17)
$Input9 = GUICtrlCreateInput("Ile razy", 112, 208, 41, 21)
$Button23 = GUICtrlCreateButton("«", 120, 240, 17, 17)
$Button24 = GUICtrlCreateButton("»", 208, 240, 17, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Global $input1
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
 Case $GUI_EVENT_CLOSE
  Exit
 Case $Button1
 GUICtrlGetState($Input1)
 $Input1+=1
 GUICtrlSetData($Input1, $Input1)
   Case $Input6
 Case $Input9
EndSwitch
WEnd

 

 

LOL? A wiesz, że chodzi o czas przesuwania myszki do danego punktu, co nie jest w żadnym stopniu zależne od ilości ustawionych kliknięć?

 

oj dobra

Nukereq.png
Opublikowano

Ok Już zrobione działa, dzięki kiope za pomoc stawiam like i 5 do profilu i zaraz napiszę coś ci na PW

6fc086389b796c47.jpg
Siedzę na mpc gdy jest czas, dzięki temu dużo się od was uczę dzięki!!

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...