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

Zmienianie Buttonu

Rekomendowane odpowiedzi

Opublikowano

 

 

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 190, 223, 190, 122)

$czas = GUICtrlCreateInput("", 64, 8, 121, 21)

$mana = GUICtrlCreateInput("", 64, 32, 121, 21)

$manas = GUICtrlCreateInput("", 64, 56, 121, 21)

$czar = GUICtrlCreateInput("", 64, 80, 121, 21)

$Label1 = GUICtrlCreateLabel("Czas", 8, 8, 27, 17)

$Label2 = GUICtrlCreateLabel("Mana", 8, 32, 39, 17)

$Label3 = GUICtrlCreateLabel("Czar", 8, 80, 25, 17)

$Czaruj = GUICtrlCreateButton("Czaruj", 8, 104, 179, 25, $WS_GROUP)

$Antyafk = GUICtrlCreateButton("Antyafk", 8, 136, 179, 25, $WS_GROUP)

$Start = GUICtrlCreateButton("Start", 8, 168, 75, 25, $WS_GROUP)

$Label4 = GUICtrlCreateLabel("Dla mpcforum od jackraymund'a", 32, 200, 155, 17)

$Label5 = GUICtrlCreateLabel("Mana/sec", 8, 56, 53, 17)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

 

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Czaruj

$zmienna = 0

$zmienna = $zmienna +1

Case $Antyafk

$Antyafk = 0

$Antyafk = $Antyafk +1

Case $Start

lolz()

EndSwitch

WEnd

func lolz()

while 1

if $zmienna = 1 Then

$czar1 = GUICtrlRead($czar)

ControlSend("Tibia","","",$czar1,1)

ControlSend("Tibia","","","{enter}")

$tibia1 = GUICtrlRead($mana)/GUICtrlRead($manas)* GUICtrlRead($czas)*1000-1020

Sleep($tibia1)

EndIf

if $Antyafk = 1 Then

GUICtrlSetData(

Sleep(500)

ControlSend("Tibia","","","{CTRLDOWN}{up}{CTRLup}")

Sleep(500)

ControlSend("Tibia","","","{CTRLDOWN}{down}{CTRLup}")

endIf

WEnd

EndFunc

 

mam taki kod i chce zrobic cos takiego że jak kliknie antyafk to pojawi się wyłącz antyafk i by miał inną funkcje

Opublikowano

Chcesz żeby zamiast tego przycisku był nowy przycisk z nową funkcją?

Jeśli tak to tu masz kod:

 

 

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 190, 223, 190, 122)

$czas = GUICtrlCreateInput("", 64, 8, 121, 21)

$mana = GUICtrlCreateInput("", 64, 32, 121, 21)

$manas = GUICtrlCreateInput("", 64, 56, 121, 21)

$czar = GUICtrlCreateInput("", 64, 80, 121, 21)

$Label1 = GUICtrlCreateLabel("Czas", 8, 8, 27, 17)

$Label2 = GUICtrlCreateLabel("Mana", 8, 32, 39, 17)

$Label3 = GUICtrlCreateLabel("Czar", 8, 80, 25, 17)

$Czaruj = GUICtrlCreateButton("Czaruj", 8, 104, 179, 25, $WS_GROUP)

$Antyafk = GUICtrlCreateButton("Antyafk", 8, 136, 179, 25, $WS_GROUP)

$Start = GUICtrlCreateButton("Start", 8, 168, 75, 25, $WS_GROUP)

$Label4 = GUICtrlCreateLabel("Dla mpcforum od jackraymund'a", 32, 200, 155, 17)

$Label5 = GUICtrlCreateLabel("Mana/sec", 8, 56, 53, 17)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

 

Locale $new_button = 1

 

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Czaruj

$zmienna = 0

$zmienna = $zmienna +1

Case $Antyafk

$Antyafk = 0

$Antyafk = $Antyafk +1

$new_button = GUICtrlCreateButton("Wyłącz antyafk", 8, 136, 179, 25, $WS_GROUP)

GUICtrlDelete($Antyafk)

Case $new_button

MsgBox(0, "Nowa Funkcja", "Twoja nowa funkcja")

Case $Start

lolz()

EndSwitch

WEnd

func lolz()

while 1

if $zmienna = 1 Then

$czar1 = GUICtrlRead($czar)

ControlSend("Tibia","","",$czar1,1)

ControlSend("Tibia","","","{enter}")

$tibia1 = GUICtrlRead($mana)/GUICtrlRead($manas)* GUICtrlRead($czas)*1000-1020

Sleep($tibia1)

EndIf

if $Antyafk = 1 Then

GUICtrlSetData(

Sleep(500)

ControlSend("Tibia","","","{CTRLDOWN}{up}{CTRLup}")

Sleep(500)

ControlSend("Tibia","","","{CTRLDOWN}{down}{CTRLup}")

endIf

WEnd

EndFunc

 

 

Opublikowano

Kurde nie zauważyłem, że zmieniłeś $Antyafk. Już nie jest buttonem tylko liczbą xD

 

Powinno być tak:

 

 

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 190, 223, 190, 122)

$czas = GUICtrlCreateInput("", 64, 8, 121, 21)

$mana = GUICtrlCreateInput("", 64, 32, 121, 21)

$manas = GUICtrlCreateInput("", 64, 56, 121, 21)

$czar = GUICtrlCreateInput("", 64, 80, 121, 21)

$Label1 = GUICtrlCreateLabel("Czas", 8, 8, 27, 17)

$Label2 = GUICtrlCreateLabel("Mana", 8, 32, 39, 17)

$Label3 = GUICtrlCreateLabel("Czar", 8, 80, 25, 17)

$Czaruj = GUICtrlCreateButton("Czaruj", 8, 104, 179, 25, $WS_GROUP)

$Antyafk = GUICtrlCreateButton("Antyafk", 8, 136, 179, 25, $WS_GROUP)

$Start = GUICtrlCreateButton("Start", 8, 168, 75, 25, $WS_GROUP)

$Label4 = GUICtrlCreateLabel("Dla mpcforum od jackraymund'a", 32, 200, 155, 17)

$Label5 = GUICtrlCreateLabel("Mana/sec", 8, 56, 53, 17)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

 

Local $new_button = 1

 

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Czaruj

$zmienna = 0

$zmienna = $zmienna +1

Case $Antyafk

GUICtrlDelete($Antyafk)

$Antyafk = 0

$Antyafk = $Antyafk +1

$new_button = GUICtrlCreateButton("Wyłącz antyafk", 8, 136, 179, 25, $WS_GROUP)

Case $new_button

MsgBox(0, "Nowa Funkcja", "Twoja nowa funkcja")

Case $Start

lolz()

EndSwitch

WEnd

func lolz()

while 1

if $zmienna = 1 Then

$czar1 = GUICtrlRead($czar)

ControlSend("Tibia","","",$czar1,1)

ControlSend("Tibia","","","{enter}")

$tibia1 = GUICtrlRead($mana)/GUICtrlRead($manas)* GUICtrlRead($czas)*1000-1020

Sleep($tibia1)

EndIf

if $Antyafk = 1 Then

GUICtrlSetData(

Sleep(500)

ControlSend("Tibia","","","{CTRLDOWN}{up}{CTRLup}")

Sleep(500)

ControlSend("Tibia","","","{CTRLDOWN}{down}{CTRLup}")

endIf

WEnd

EndFunc

 

 

Opublikowano

troche błedów w skrypcie , powinienes na bierząco poprawiać w koncu scite ci pokazuje gdzie sa błedy

dla lepszej czytelności kodu polecam co pewien czas kilknąc z Tools : Tidy AutoIt Source

 

Prosty kod na klawisz Start/Stop , co ma robić przepisz do funkcji

 

$count = 0  ; zmienna , dopisac
; sam przycisk 
Case $button
	If $count = 1 Then
		GUICtrlSetData($button, "Start")
		$count = 0
funkcja1()

	ElseIf $count = 0 Then
		GUICtrlSetData($button, "Stop")
funkcja2()
		$count = 1
	EndIf

Func funkcja1()
					ToolTip("Wyłączony")
					GUISetState(@SW_SHOW)
EndFunc


Func funkcja2()
					ToolTip("Włączony")
					GUISetState(@SW_SHOW)
EndFunc

 

 

rano złoze do kupy

 

Wstępnie samo gui

 

 

 

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 190, 223, 190, 122)
$czas = GUICtrlCreateInput("", 64, 8, 121, 21)
$mana = GUICtrlCreateInput("", 64, 32, 121, 21)
$manas = GUICtrlCreateInput("", 64, 56, 121, 21)
$czar = GUICtrlCreateInput("", 64, 80, 121, 21)
$Label1 = GUICtrlCreateLabel("Czas", 8, 8, 27, 17)
$Label2 = GUICtrlCreateLabel("Mana", 8, 32, 39, 17)
$Label3 = GUICtrlCreateLabel("Czar", 8, 80, 25, 17)
$Czaruj = GUICtrlCreateButton("Czaruj", 8, 104, 179, 25, $WS_GROUP)
$button = GUICtrlCreateButton("Antyafk", 8, 136, 179, 25, $WS_GROUP)
$Start = GUICtrlCreateButton("Start", 8, 168, 75, 25, $WS_GROUP)

$Label4 = GUICtrlCreateLabel("Dla mpcforum od jackraymund'a", 32, 200, 155, 17)
$Label5 = GUICtrlCreateLabel("Mana/sec", 8, 56, 53, 17)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

$count = 0
$countczar = 0

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

	Case $Czaruj
		If $countczar = 1 Then
			GUICtrlSetData($Czaruj, "Start - Czaruj")
			$countczar = 0
			czary1()
		ElseIf $countczar = 0 Then
			GUICtrlSetData($Czaruj, "Stop - Czaruj")
			czary2()
			$countczar = 1
		EndIf

	Case $button
		If $count = 1 Then
			GUICtrlSetData($button, "Start - Antyafk")
			$count = 0
			funkcja1()
		ElseIf $count = 0 Then
			GUICtrlSetData($button, "Stop - Antyafk")
			funkcja2()
			$count = 1
		EndIf

	Case $Start

;        tu trzeba złożyć wszystko do kupy by działało własciwie


EndSwitch
WEnd




Func funkcja1()
ToolTip("Wyłączony")
GUISetState(@SW_SHOW)
EndFunc   ;==>funkcja1


Func funkcja2()
ToolTip("Włączony")
GUISetState(@SW_SHOW)
EndFunc   ;==>funkcja2

Func czary1()
ToolTip("Wyłączony")
GUISetState(@SW_SHOW)
EndFunc   ;==>czary1


Func czary2()
ToolTip("Włączony")
GUISetState(@SW_SHOW)
EndFunc   ;==>czary2

 

 

 

Dodatkowe opcje przydatne :

ograniczenie wpisywanych liczb do x znaków

GUICtrlSetLimit($zmiennaInput, x)
; Przykład dla $czas : 
$czas = GUICtrlCreateInput("sekundy", 64, 8, 121, 21)                    
GUICtrlSetFont(-1, 10, 800, 0, "Tahoma")        ; czcionka 
GUICtrlSetLimit($czas, 3) ;trzy znaki    

tylko cyfry a nie litery , dopisać na samym koncu GUICtrlCreateInput :

 BitOR($ES_CENTER, $ES_AUTOHSCROLL, $ES_NUMBER)

;Przykład dla $czas :    
$czas = GUICtrlCreateInput("sekundy", 64, 8, 121, 21, BitOR($ES_CENTER, $ES_AUTOHSCROLL, $ES_NUMBER))

 

i po retuszyu wychodzi ładne gui

 

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

#region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 190, 223, 190, 122)

$czas = GUICtrlCreateInput("czas", 64, 8, 121, 21, BitOR($ES_CENTER, $ES_AUTOHSCROLL, $ES_NUMBER))
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
GUICtrlSetLimit($czas, 3)

$mana = GUICtrlCreateInput("mana", 64, 32, 121, 21, BitOR($ES_CENTER, $ES_AUTOHSCROLL, $ES_NUMBER))
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
GUICtrlSetLimit($mana, 3)

$manas = GUICtrlCreateInput("manas", 64, 56, 121, 21, BitOR($ES_CENTER, $ES_AUTOHSCROLL, $ES_NUMBER))
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
GUICtrlSetLimit($manas, 3)

$czar = GUICtrlCreateInput("czar", 64, 80, 121, 21, BitOR($ES_CENTER, $ES_AUTOHSCROLL, $ES_NUMBER))
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")
GUICtrlSetLimit($czar, 3)

$Label1 = GUICtrlCreateLabel("Czas", 8, 8, 27, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")

$Label2 = GUICtrlCreateLabel("Mana", 8, 32, 39, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")

$Label5 = GUICtrlCreateLabel("Mana/sec", 8, 56, 53, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")

$Label3 = GUICtrlCreateLabel("Czar", 8, 80, 25, 17)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")

$Czaruj = GUICtrlCreateButton("Czaruj", 8, 104, 179, 25)
GUICtrlSetFont(-1, 8, 800, 0, "Arial")

$button = GUICtrlCreateButton("Antyafk", 8, 136, 179, 25)
GUICtrlSetFont(-1, 8, 800, 0, "Comic Sans MS")

$Start = GUICtrlCreateButton("Start", 8, 168, 75, 25)
GUICtrlSetFont(-1, 8, 800, 0, "Tahoma")

$Label4 = GUICtrlCreateLabel("Dla mpcforum od jackraymund'a", 32, 200, 155, 17)
GUICtrlSetFont(-1, 7, 400, 0, "Comic Sans MS")


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

$count = 0
$countczar = 0

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

	Case $Czaruj
		If $countczar = 1 Then
			GUICtrlSetData($Czaruj, "Start - Czaruj")
								TrayTip("NosTale", "Start - Czaruj", 5, 1)
			$countczar = 0
			czary1()
		ElseIf $countczar = 0 Then
			GUICtrlSetData($Czaruj, "Stop - Czaruj")
												TrayTip("NosTale", "Stop - Czaruj", 5, 1)
			czary2()
			$countczar = 1
		EndIf

	Case $button
		If $count = 1 Then
			GUICtrlSetData($button, "Start - Antyafk")
																TrayTip("NosTale", "Start - Antyafk", 5, 1)
			$count = 0
			funkcja1()
		ElseIf $count = 0 Then
			GUICtrlSetData($button, "Stop - Antyafk")
																TrayTip("NosTale", "Stop - Antyafk", 5, 1)
			funkcja2()
			$count = 1
		EndIf

	Case $Start


EndSwitch
WEnd




Func funkcja1()
ToolTip("Wyłączony")
GUISetState(@SW_SHOW)
EndFunc   ;==>funkcja1


Func funkcja2()
ToolTip("Włączony")
GUISetState(@SW_SHOW)
EndFunc   ;==>funkcja2

Func czary1()
ToolTip("Wyłączony")
GUISetState(@SW_SHOW)
EndFunc   ;==>czary1


Func czary2()
ToolTip("Włączony")
GUISetState(@SW_SHOW)
EndFunc   ;==>czary2

 

If you = stupid then

insert(foot.in.your.ass)

end if

licznik-54-96732-stat.png

Opublikowano

@up:

zamiast dopisywać trzy atrybuty STYLE żeby były tylko cyfry wystarczy samo $ES_NUMBER (bez BitOR ofc.)

 

EDIT:

@down:

a no chyba że ;p myślałem że wg. ciebie trzeba było trzy atrybuty.

Edytowane przez Maciek134

[TUT] Full Autoit V3 Tutorial

yo po 1 nie kayloger tylko bot który zapamiętuje hasła -_-

stop1.png

Opublikowano

sam wiesz jak Koda generuje gui, masakra potem by sie zbędnych kodów pozbyć , a tu w sumie dodatkowy dla ładnego ułożenia centruje

If you = stupid then

insert(foot.in.your.ass)

end if

licznik-54-96732-stat.png

  • 2 tygodnie później...
Opublikowano

Trochę edytowalem ten strypt do swoich potrzeb i chyba coś popsułem. ;/ 

Po kliknięciu start buton się nie zmienia na stop. ;/

 

 


#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Exp Bot na privy By Marcinvx", 584, 207, 261, 182)
GUISetOnEvent($GUI_EVENT_CLOSE, "Close")
$Label1 = GUICtrlCreateLabel("Zbieranie itemków: ( Jak ma zbierać wpisz z lub tylde )", 15, 165, 265, 17)
$Zbieranie = GUICtrlCreateInput("", 280, 165, 36, 21)
GUICtrlSetLimit($Zbieranie, 1)
$Label2 = GUICtrlCreateLabel("Pocenie niebieskimi mixturami: (wpisz klawisz na którym masz ustawione miksturki niebieskie)", 10, 35, 439, 17)
$niebieskie = GUICtrlCreateInput("", 465, 35, 36, 21)
GUICtrlSetLimit($niebieskie, 2)
$Label3 = GUICtrlCreateLabel("Pocenie czerwonymi miksturami: (wpisz klawisz na którym masz ustawione miksturki czerwone)", 10, 15, 448, 17)
$czerwone = GUICtrlCreateInput("", 465, 15, 36, 21)
GUICtrlSetLimit($czerwone, 2)
$Label4 = GUICtrlCreateLabel("Wpisz skil nr 1 (nie musisz wpisywać)", 20, 85, 178, 17)
$Label5 = GUICtrlCreateLabel("Wpisz skil nr 2 (nie musisz wpisywać)", 20, 110, 178, 17)
$skil2 = GUICtrlCreateInput("", 205, 105, 46, 21)
GUICtrlSetLimit($skil2, 2)
$skil1 = GUICtrlCreateInput("", 205, 85, 46, 21)
GUICtrlSetLimit($skil1, 2)
$Group1 = GUICtrlCreateGroup("Skile Pasywne ( silne / aura itp)", 5, 65, 281, 76)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Miksturki", 5, 0, 571, 61)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Zbieranie", 5, 145, 326, 51)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$peleryny = GUICtrlCreateInput("", 535, 90, 36, 21)
GUICtrlSetLimit($peleryny, 2)
$Label6 = GUICtrlCreateLabel("Wpisz klawisz na którym masz Peleryny Męstwa", 305, 90, 229, 17)
$Group4 = GUICtrlCreateGroup("Przyciąganie", 290, 65, 286, 76)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Start = GUICtrlCreateButton("Start", 495, 155, 76, 36, $WS_GROUP)
GUICtrlSetOnEvent(-1, "Start")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

$count = 0

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

					Case $Start
                       If $count = 1 Then
                               GUICtrlSetData($Start, "Start")
                                                                                                                                       TrayTip("NosTale", "Start - Antyafk", 5, 1)
                               $count = 0
                               funkcja1()
                       ElseIf $count = 0 Then
                               GUICtrlSetData($Start, "Stop")
                                                                                                                                       TrayTip("NosTale", "Stop - Antyafk", 5, 1)
                               funkcja2()
                               $count = 1
                       EndIf
       EndSwitch
WEnd

Func Close()
Exit
EndFunc

Func Start()

EndFunc

Func funkcja2()
       ToolTip("Włączony")
       GUISetState(@SW_SHOW)
EndFunc   ;==>funkcja2

Func funkcja1()
       ToolTip("Wyłączony")
       GUISetState(@SW_SHOW)
EndFunc   ;==>funkcja1

 

 

Help Myy

 

 

 

Opublikowano

wyłacz opt bo to nie do tego skryptu opcja

  Opt("GUIOnEventMode", 0)

 

i usun wpis :

GUICtrlSetOnEvent(-1, "Start")

If you = stupid then

insert(foot.in.your.ass)

end if

licznik-54-96732-stat.png

Gość
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.

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.