Skocz do zawartości

Dołącz do społecznoś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

[Pomoc] Gui - Wyłączenie Func.

Rekomendowane odpowiedzi

Opublikowano

Witam!

 

Jak narazie to ostatnia pomoc :) Chce, aby $St - "Włącz", aktywował mi to:

 

 

Func a()
       Send("t/home")
       Send("{ENTER}")
EndFunc   ;==>a
Func b()
       Send("t/sethome")
       Send("{ENTER}")
EndFunc   ;==>b
Func c()
       Send("t/shop buy ")
       Send("{ENTER}")
EndFunc   ;==>c
Func d()
       Send("t/shop sell ")
       Send("{ENTER}")
EndFunc   ;==>d
Func e()
       Send("t/q give")
       Send("{ENTER}")
EndFunc   ;==>e
Func f()
       Send("t/q done")
       Send("{ENTER}")
EndFunc   ;==>f
Func g()
       Send("t/spawn")
       Send("{ENTER}")
EndFunc   ;==>g
While 1
       HotKeySet("{NUMPAD1}", "a")
       HotKeySet("{NUMPAD2}", "b")
       HotKeySet("{NUMPAD4}", "c")
       HotKeySet("{NUMPAD5}", "d")
       HotKeySet("{NUMPAD7}", "e")
       HotKeySet("{NUMPAD8}", "f")
       HotKeySet("{NUMPAD0}", "g")
WEnd

 

 

 

A button $en - "Wyłącz" wyłączał możliwość powyższych funckji (poprostu, zeby po wcisnieciu np. NUM 1 już nie działa func pod niego). A następnie, żeby button Exit, poprostu wyłączał cały program. To chyba nie problem ^.^ A chce się nauczyć i będzie to spełniało moje wymagania :P

 

Bardzo dziękuje, w zamian dam 5/1 lub -/+ .

 

@edit

 

Tutaj macie pełny cod:

 

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$AC_by_Hussaris = GUICreate("AC_by_Hussaris", 198, 226, 426, 206)
$St = GUICtrlCreateButton("Włącz", 8, 176, 43, 25)
$en = GUICtrlCreateButton("Wyłącz", 56, 176, 43, 25)
$Button3 = GUICtrlCreateButton("Exit", 136, 176, 51, 25)
$By = GUICtrlCreateLabel("By", 128, 208, 16, 17)
$Label1 = GUICtrlCreateLabel("Hussaris", 144, 208, 44, 17)
$Label2 = GUICtrlCreateLabel("Komendy", 72, 8, 48, 17)
$Label3 = GUICtrlCreateLabel("NUMPAD 1 - /home", 40, 32, 100, 17)
$Label4 = GUICtrlCreateLabel("NUMPAD 2 - /sethome", 40, 48, 114, 17)
$Label5 = GUICtrlCreateLabel("NUMPAD 4 - /shop buy", 40, 64, 117, 17)
$Label6 = GUICtrlCreateLabel("NUMPAD 5 - /shop sell", 40, 80, 115, 17)
$Label7 = GUICtrlCreateLabel("NUMPAD 7 - /q give", 40, 96, 103, 17)
$Label8 = GUICtrlCreateLabel("NUMPAD 8 - /q done", 40, 112, 107, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Func a()
       Send("t/home")
       Send("{ENTER}")
EndFunc   ;==>a
Func b()
       Send("t/sethome")
       Send("{ENTER}")
EndFunc   ;==>b
Func c()
       Send("t/shop buy ")
       Send("{ENTER}")
EndFunc   ;==>c
Func d()
       Send("t/shop sell ")
       Send("{ENTER}")
EndFunc   ;==>d
Func e()
       Send("t/q give")
       Send("{ENTER}")
EndFunc   ;==>e
Func f()
       Send("t/q done")
       Send("{ENTER}")
EndFunc   ;==>f
Func g()
       Send("t/spawn")
       Send("{ENTER}")
EndFunc   ;==>g
While 1
       HotKeySet("{NUMPAD1}", "a")
       HotKeySet("{NUMPAD2}", "b")
       HotKeySet("{NUMPAD4}", "c")
       HotKeySet("{NUMPAD5}", "d")
       HotKeySet("{NUMPAD7}", "e")
       HotKeySet("{NUMPAD8}", "f")
       HotKeySet("{NUMPAD0}", "g")
WEnd

 

 

579571423327107377857.png


Opublikowano

Powinno działać tj chcesz:

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$AC_by_Hussaris = GUICreate("AC_by_Hussaris", 198, 226, 426, 206)
$St = GUICtrlCreateButton("Włącz", 8, 176, 43, 25)
$en = GUICtrlCreateButton("Wyłącz", 56, 176, 43, 25)
$Button3 = GUICtrlCreateButton("Exit", 136, 176, 51, 25)
$By = GUICtrlCreateLabel("By", 128, 208, 16, 17)
$Label1 = GUICtrlCreateLabel("Hussaris", 144, 208, 44, 17)
$Label2 = GUICtrlCreateLabel("Komendy", 72, 8, 48, 17)
$Label3 = GUICtrlCreateLabel("NUMPAD 1 - /home", 40, 32, 100, 17)
$Label4 = GUICtrlCreateLabel("NUMPAD 2 - /sethome", 40, 48, 114, 17)
$Label5 = GUICtrlCreateLabel("NUMPAD 4 - /shop buy", 40, 64, 117, 17)
$Label6 = GUICtrlCreateLabel("NUMPAD 5 - /shop sell", 40, 80, 115, 17)
$Label7 = GUICtrlCreateLabel("NUMPAD 7 - /q give", 40, 96, 103, 17)
$Label8 = GUICtrlCreateLabel("NUMPAD 8 - /q done", 40, 112, 107, 17)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
	Case $GUI_EVENT_CLOSE
		Exit
	Case $St
		HotKeySet("{NUMPAD1}", "a")
		HotKeySet("{NUMPAD2}", "b")
		HotKeySet("{NUMPAD4}", "c")
		HotKeySet("{NUMPAD5}", "d")
		HotKeySet("{NUMPAD7}", "e")
		HotKeySet("{NUMPAD8}", "f")
		HotKeySet("{NUMPAD0}", "g")
	Case $en
		ExitLoop
EndSwitch
WEnd

Func a()
Send("t/home")
Send("{ENTER}")
EndFunc   ;==>a
Func b()
Send("t/sethome")
Send("{ENTER}")
EndFunc   ;==>b
Func c()
Send("t/shop buy ")
Send("{ENTER}")
EndFunc   ;==>c
Func d()
Send("t/shop sell ")
Send("{ENTER}")
EndFunc   ;==>d
Func e()
Send("t/q give")
Send("{ENTER}")
EndFunc   ;==>e
Func f()
Send("t/q done")
Send("{ENTER}")
EndFunc   ;==>f
Func g()
Send("t/spawn")
Send("{ENTER}")
EndFunc   ;==>g


Edytowane przez ps19

Opublikowano
  • Autor

@up

Dobrze jest, ale jak wciskam Wyłącz to mi zamyka cały program... a chce, żeby tylko wyłączył opcje pod button "Włącz", żeby jak wcisne Num1 nie wpisywał mi /home, tylko normalnie 1 ;d, a Button3 - "Exit", chce, aby wyłączał caly program całokowicie.

579571423327107377857.png


Opublikowano

Spróbuj to w buttonie $st dać w funkcje, a pod $en OnAutoItExitRegister( "nazwa funkcji" )

Opublikowano
  • Autor

Nie praży, jak wcisne Włącz to mi sie program wyłącza, a jak wcisne Wyłacz i włącz to dopiero mi działają funkcje...

 

 

Tutaj kod:

 

 


#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$AC_by_Hussaris = GUICreate("AC_by_Hussaris", 198, 226, 426, 206)
$St = GUICtrlCreateButton("Włącz", 8, 176, 43, 25)
$en = GUICtrlCreateButton("Wyłącz", 56, 176, 43, 25)
$Button3 = GUICtrlCreateButton("Exit", 136, 176, 51, 25)
$By = GUICtrlCreateLabel("By", 128, 208, 16, 17)
$Label1 = GUICtrlCreateLabel("Hussaris", 144, 208, 44, 17)
$Label2 = GUICtrlCreateLabel("Komendy", 72, 8, 48, 17)
$Label3 = GUICtrlCreateLabel("NUMPAD 1 - /home", 40, 32, 100, 17)
$Label4 = GUICtrlCreateLabel("NUMPAD 2 - /sethome", 40, 48, 114, 17)
$Label5 = GUICtrlCreateLabel("NUMPAD 4 - /shop buy", 40, 64, 117, 17)
$Label6 = GUICtrlCreateLabel("NUMPAD 5 - /shop sell", 40, 80, 115, 17)
$Label7 = GUICtrlCreateLabel("NUMPAD 7 - /q give", 40, 96, 103, 17)
$Label8 = GUICtrlCreateLabel("NUMPAD 8 - /q done", 40, 112, 107, 17)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
               Case $GUI_EVENT_CLOSE
                       Exit
					Func ef()
               Case $St
                       HotKeySet("{NUMPAD1}", "a")
                       HotKeySet("{NUMPAD2}", "b")
                       HotKeySet("{NUMPAD4}", "c")
                       HotKeySet("{NUMPAD5}", "d")
                       HotKeySet("{NUMPAD7}", "e")
                       HotKeySet("{NUMPAD8}", "f")
                       HotKeySet("{NUMPAD0}", "g")
					EndFunc
               Case $en
                      OnAutoItExitRegister( "ef" )
       EndSwitch
WEnd

Func a()
       Send("t/home")
       Send("{ENTER}")
EndFunc   ;==>a
Func b()
       Send("t/sethome")
       Send("{ENTER}")
EndFunc   ;==>b
Func c()
       Send("t/shop buy ")
EndFunc   ;==>c
Func d()
       Send("t/shop sell ")
EndFunc   ;==>d
Func e()
       Send("t/q give")
       Send("{ENTER}")
EndFunc   ;==>e
Func f()
       Send("t/q done")
       Send("{ENTER}")
EndFunc   ;==>f
Func g()
       Send("t/spawn")
       Send("{ENTER}")
EndFunc   ;==>g

 

 

579571423327107377857.png


Opublikowano

Spróbuj to zrobic zamiast HotKeySet to _IsPressed, albo bez klawiszy

 

			If _IsPressed(61, $vDLL) = 1 Then
			a()
		ElseIf _IsPressed(62, $vDLL) = 1 Then
			b()
		ElseIf _IsPressed(63, $vDLL) = 1 Then
			c()
		ElseIf _IsPressed(64, $vDLL) = 1 Then
			d()
		ElseIf _IsPressed(65, $vDLL) = 1 Then
			e()
		ElseIf _IsPressed(66, $vDLL) = 1 Then
			f()
		ElseIf _IsPressed(67, $vDLL) = 1 Then
			g()
		EndIf

Edytowane przez ps19

Opublikowano
  • Autor

@up

Nie rozumiem jak to zamienić... sry zielony jestem ;d

 

Tutaj kod:

While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
               Case $GUI_EVENT_CLOSE
                       Exit
                                               Func ef()
               Case $St
                       HotKeySet("{NUMPAD1}", "a")
                       HotKeySet("{NUMPAD2}", "b")
                       HotKeySet("{NUMPAD4}", "c")
                       HotKeySet("{NUMPAD5}", "d")
                       HotKeySet("{NUMPAD7}", "e")
                       HotKeySet("{NUMPAD8}", "f")
                       HotKeySet("{NUMPAD0}", "g")
                                               EndFunc
               Case $en
                      OnAutoItExitRegister( "ef" )
       EndSwitch
WEnd

579571423327107377857.png


Opublikowano

Zrób tak:

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)
#region ### START Koda GUI section ### Form=
$AC_by_Hussaris = GUICreate("AC_by_Hussaris", 199, 227, 426, 206)
GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
$St = GUICtrlCreateButton("Włącz", 8, 176, 43, 25, $WS_GROUP)
GUICtrlSetOnEvent($St, "StClick")
$en = GUICtrlCreateButton("Wyłącz", 56, 176, 43, 25, $WS_GROUP)
GUICtrlSetOnEvent($en, "enClick")
$By = GUICtrlCreateLabel("By", 128, 208, 16, 17)

$Label1 = GUICtrlCreateLabel("Hussaris", 144, 208, 44, 17)

$Label2 = GUICtrlCreateLabel("Komendy", 72, 8, 48, 17)

$Label3 = GUICtrlCreateLabel("NUMPAD 1 - /home", 40, 32, 100, 17)

$Label4 = GUICtrlCreateLabel("NUMPAD 2 - /sethome", 40, 48, 114, 17)

$Label5 = GUICtrlCreateLabel("NUMPAD 4 - /shop buy", 40, 64, 117, 17)

$Label6 = GUICtrlCreateLabel("NUMPAD 5 - /shop sell", 40, 80, 115, 17)

$Label7 = GUICtrlCreateLabel("NUMPAD 7 - /q give", 40, 96, 103, 17)

$Label8 = GUICtrlCreateLabel("NUMPAD 8 - /q done", 40, 112, 107, 17)

GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

Func Close()
Exit
EndFunc   ;==>Close

While 1
Sleep(100)
WEnd

Func enClick()
OnAutoItExitRegister("StClick")
EndFunc   ;==>enClick

Func StClick()
HotKeySet("{NUMPAD1}", "a")
HotKeySet("{NUMPAD2}", "b")
HotKeySet("{NUMPAD4}", "c")
HotKeySet("{NUMPAD5}", "d")
HotKeySet("{NUMPAD7}", "e")
HotKeySet("{NUMPAD8}", "f")
HotKeySet("{NUMPAD0}", "g")
EndFunc   ;==>StClick


Func a()
Send("t/home")
Send("{ENTER}")
EndFunc   ;==>a
Func b()
Send("t/sethome")
Send("{ENTER}")
EndFunc   ;==>b
Func c()
Send("t/shop buy ")
Send("{ENTER}")
EndFunc   ;==>c
Func d()
Send("t/shop sell ")
Send("{ENTER}")
EndFunc   ;==>d
Func e()
Send("t/q give")
Send("{ENTER}")
EndFunc   ;==>e
Func f()
Send("t/q done")
Send("{ENTER}")
EndFunc   ;==>f
Func g()
Send("t/spawn")
Send("{ENTER}")
EndFunc   ;==>g

Edytowane przez ps19

Opublikowano

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#region ### START Koda GUI section ### Form=
$AC_by_Hussaris = GUICreate("AC_by_Hussaris", 199, 227, 426, 206)
GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
$St = GUICtrlCreateButton("Włącz", 8, 176, 43, 25, $WS_GROUP)
GUICtrlSetOnEvent($St, "StClick")
$en = GUICtrlCreateButton("Wyłącz", 56, 176, 43, 25, $WS_GROUP)
GUICtrlSetOnEvent($en, "enClick")
$By = GUICtrlCreateLabel("By", 128, 208, 16, 17)
$Label1 = GUICtrlCreateLabel("Hussaris", 144, 208, 44, 17)
$Label2 = GUICtrlCreateLabel("Komendy", 72, 8, 48, 17)
$Label3 = GUICtrlCreateLabel("NUMPAD 1 - /home", 40, 32, 100, 17)
$Label4 = GUICtrlCreateLabel("NUMPAD 2 - /sethome", 40, 48, 114, 17)
$Label5 = GUICtrlCreateLabel("NUMPAD 4 - /shop buy", 40, 64, 117, 17)
$Label6 = GUICtrlCreateLabel("NUMPAD 5 - /shop sell", 40, 80, 115, 17)
$Label7 = GUICtrlCreateLabel("NUMPAD 7 - /q give", 40, 96, 103, 17)
$Label8 = GUICtrlCreateLabel("NUMPAD 8 - /q done", 40, 112, 107, 17)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
Func Close()
Exit
EndFunc   ;==>Close

Func StClick()
	HotKeySet("{NUMPAD1}", "a")
HotKeySet("{NUMPAD2}", "b")
HotKeySet("{NUMPAD4}", "c")
HotKeySet("{NUMPAD5}", "d")
HotKeySet("{NUMPAD7}", "e")
HotKeySet("{NUMPAD8}", "f")
HotKeySet("{NUMPAD0}", "g")
EndFunc   ;==>StClick

Func enClick()
Exit
EndFunc   ;==>enClick


Func a()
Send("t/home")
Send("{ENTER}")
EndFunc   ;==>a
Func b()
Send("t/sethome")
Send("{ENTER}")
EndFunc   ;==>b
Func c()
Send("t/shop buy ")
Send("{ENTER}")
EndFunc   ;==>c
Func d()
Send("t/shop sell ")
Send("{ENTER}")
EndFunc   ;==>d
Func e()
Send("t/q give")
Send("{ENTER}")
EndFunc   ;==>e
Func f()
Send("t/q done")
Send("{ENTER}")
EndFunc   ;==>f
Func g()
Send("t/spawn")
Send("{ENTER}")
EndFunc   ;==>g




 

Po naciśnięciu stop, skrypt będzie się zamykał.Nie mam pomysłu jak to zrobić poczytaj przypięte tuty, helpa i sam pokombinuj.

Ostatnio przeglądający 0

  • Brak zarejestrowanych użytkowników przeglądających tę stronę.

Konto

Nawigacja

Skonfiguruj powiadomienia push w przeglądarce

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Stuknij Uprawnienia → Powiadomienia.
  3. Dostosuj swoje ustawienie.
Chrome (Komputer)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje ustawienie.