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]Problem z InPutReadem.

Rekomendowane odpowiedzi

Opublikowano

Witam!

 

Potrzebuje pomoc. Wszystko niby jest dobrze tylko, zamiast wpisywac tekst z InPut'a, to wpisuje mi guictrlread($). Tutaj macie kod. Zapewne nie wstawiłem gdzieś przecinka, albo innego zygzaka... Prosze o pomoc:

 

<== Spoiler

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
	$play = false  
	  func start()
$play = true
endfunc
func stop()
$play = false
endfunc
hotkeyset('{Home}', 'start')
hotkeyset('{End}', 'stop')
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AutoRegion by Huss4r.exe", 335, 245, 320, 150)
$Label1 = GUICtrlCreateLabel("AutoRegion by Hussar", 8, 216, 110, 17)
$Nazwa = GUICtrlCreateInput("Bazar", 96, 8, 121, 21)
$Label2 = GUICtrlCreateLabel("Nazwa Regionu", 8, 8, 80, 17)
$Label3 = GUICtrlCreateLabel("Nicki", 32, 32, 28, 17)
$Nicki = GUICtrlCreateInput("Nicki po spacji", 96, 32, 121, 21)
$Label4 = GUICtrlCreateLabel("Expand Up", 24, 56, 57, 17)
$Label5 = GUICtrlCreateLabel("Expand Down", 16, 80, 71, 17)
$expandup = GUICtrlCreateInput("0", 96, 56, 121, 21)
$expanddown = GUICtrlCreateInput("0", 96, 80, 121, 21)
$Label6 = GUICtrlCreateLabel("Parent", 160, 120, 35, 17)
$Label7 = GUICtrlCreateLabel("Nazwa regionu", 40, 144, 75, 17)
$Label8 = GUICtrlCreateLabel("Nazwa regionu do setparent", 8, 168, 137, 17)
$parent1 = GUICtrlCreateInput("bazar", 152, 144, 121, 21)
$parent2 = GUICtrlCreateInput("bz", 152, 168, 121, 21)
$Button1 = GUICtrlCreateButton("Start", 232, 8, 91, 41, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Stop", 232, 56, 91, 41, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
					Exit
  Case $Button1


					$play = true

	Case $Button2


			$play = false

	EndSwitch
if $play = true then
Send("{t}")
sleep(10)
Send("//expand guictrlread($expandup) up")
sleep(100)
Send("{ENTER}")
sleep(50)
Send("{t}")
sleep(50)
Send("//expand guictrlread($expanddown) down")
sleep(100)
Send("{ENTER}")
sleep(50)
Send("{t}")
sleep(50)
Send("/region define guictrlread($Nazwa) guictrlread($Nicki)")
sleep(50)
Send("{ENTER}")
sleep(50)
Send("{t}")
sleep(50)
Send("/region setparent guictrlread($parent1) guictrlread($parent2)")
sleep(50)
Send("{ENTER}")
EndIf
WEnd

 

 

Edytowane przez Hussar

579571423327107377857.png


Opublikowano

 

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
		    $play = false  
			  func start()
$play = true
endfunc
func stop()
$play = false
endfunc
hotkeyset('{Home}', 'start')
hotkeyset('{End}', 'stop')
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AutoRegion by Huss4r.exe", 335, 245, 320, 150)
$Label1 = GUICtrlCreateLabel("AutoRegion by Hussar", 8, 216, 110, 17)
$Nazwa = GUICtrlCreateInput("Bazar", 96, 8, 121, 21)
$Label2 = GUICtrlCreateLabel("Nazwa Regionu", 8, 8, 80, 17)
$Label3 = GUICtrlCreateLabel("Nicki", 32, 32, 28, 17)
$Nicki = GUICtrlCreateInput("Nicki po spacji", 96, 32, 121, 21)
$Label4 = GUICtrlCreateLabel("Expand Up", 24, 56, 57, 17)
$Label5 = GUICtrlCreateLabel("Expand Down", 16, 80, 71, 17)
$expandup = GUICtrlCreateInput("0", 96, 56, 121, 21)
$expanddown = GUICtrlCreateInput("0", 96, 80, 121, 21)
$Label6 = GUICtrlCreateLabel("Parent", 160, 120, 35, 17)
$Label7 = GUICtrlCreateLabel("Nazwa regionu", 40, 144, 75, 17)
$Label8 = GUICtrlCreateLabel("Nazwa regionu do setparent", 8, 168, 137, 17)
$parent1 = GUICtrlCreateInput("bazar", 152, 144, 121, 21)
$parent2 = GUICtrlCreateInput("bz", 152, 168, 121, 21)
$Button1 = GUICtrlCreateButton("Start", 232, 8, 91, 41, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Stop", 232, 56, 91, 41, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
										    Exit
  Case $Button1


										    $play = true

		    Case $Button2


						    $play = false

		    EndSwitch
if $play = true then
    Send("{t}")
    sleep(10)
    Send("//expand "&guictrlread($expandup)&" up")
    sleep(100)
    Send("{ENTER}")
    sleep(50)
    Send("{t}")
    sleep(50)
    Send("//expand "&guictrlread($expanddown)&" down")
    sleep(100)
    Send("{ENTER}")
    sleep(50)
    Send("{t}")
    sleep(50)
    Send("/region define" &guictrlread($Nazwa)&" "&guictrlread($Nicki))
    sleep(50)
    Send("{ENTER}")
    sleep(50)
    Send("{t}")
    sleep(50)
    Send("/region setparent "&guictrlread($parent1)&" "&guictrlread($parent2))
    sleep(50)
    Send("{ENTER}")
    EndIf
WEnd

 

 

Pisane na szybko nie wiem czy o to ci chodzi.

Opublikowano
  • Autor

Działa, kilka poprawek, ale działa. Tylko jest jeden problem. Bez While 1 nie działa cale GUI. Chciałbym, zęby pod koniec czynności z $Play, najlepiej zakańczał tego If, a wgl. bym się cieszył, jak by się samoczynnie aktywowało okno z paska i dopiero stopowało IF, bo ja nie potrzebuje, żeby to cały czas powtarzał.

Edytowane przez Hussar

579571423327107377857.png


Opublikowano

GUI nie może działać bez głównej pętli programu. Przecież okienkowy program polega właśnie na ciągłej wymianie informacji.

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.