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

_Ispressed na danym handle


Rekomendowane odpowiedzi

Opublikowano

Siemka mam problem chce wykorzystać hooka na klawe z _Ispressed lecz mam problem chce aby ispressed dzialalo tylko wtedy kiedy pracuje na oknie Tibi.

Kod:


Func Dash()
Local $hDLL = DllOpen("user32.dll")
While 1
If _IsPressed("25", $hDLL) Then
ControlSend("Tibia", "", "", "{Left}")
ControlSend("Tibia", "", "", "{Left}")
EndIf
If _IsPressed("26", $hDLL) Then
ControlSend("Tibia", "", "", "{Up}")
ControlSend("Tibia", "", "", "{Up}")
EndIf
If _IsPressed("27", $hDLL) Then
ControlSend("Tibia", "", "", "{Right}")
ControlSend("Tibia", "", "", "{Right}")
EndIf
If _IsPressed("28", $hDLL) Then
ControlSend("Tibia", "", "", "{Down}")
ControlSend("Tibia", "", "", "{Down}")
EndIf
Sleep(250)
WEnd
DllClose($hDLL)
EndFunc

Opublikowano
#include <misc.au3>
Dash()
Func Dash()
Local $hDLL = DllOpen("user32.dll")
While 1
If WinActive("Tibia") Then
If _IsPressed("25", $hDLL) Then
ControlSend("Tibia", "", "", "{Left}")
ControlSend("Tibia", "", "", "{Left}")
EndIf
If _IsPressed("26", $hDLL) Then
ControlSend("Tibia", "", "", "{Up}")
ControlSend("Tibia", "", "", "{Up}")
EndIf
If _IsPressed("27", $hDLL) Then
ControlSend("Tibia", "", "", "{Right}")
ControlSend("Tibia", "", "", "{Right}")
EndIf
If _IsPressed("28", $hDLL) Then
ControlSend("Tibia", "", "", "{Down}")
ControlSend("Tibia", "", "", "{Down}")
EndIf
EndIf
WEnd
DllClose($hDLL)
EndFunc

Opublikowano

Dzięki przy okazji 3 pytanka:

Jak w tym kodzie zrobić tak aby dało się uzywać kilku funkcji naraz? ew która dać do timera?

 

 


#include <Nomad.au3>
#include <Timers.au3>
#include <Misc.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <GuiExpand.au3>
#Region ### START Koda GUI section ### Form=d:	rain bot	rain bot v1.kxf
$Form1 = GUICreate("Train Bot V1.0", 363, 219, 192, 124)
$Tab1 = GUICtrlCreateTab(0, 0, 361, 217)
$General = GUICtrlCreateTabItem("General")
$Pic1 = GUICtrlCreatePic("C:\Users\Localhost\Desktop\Citizen.gif", -4, 21, 60, 52)
$Label2 = GUICtrlCreateLabel("Name:", 4, 77, 58, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$Label3 = GUICtrlCreateLabel("Level:", 4, 109, 55, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$Pic3 = GUICtrlCreatePic("C:\Users\Localhost\Desktop\Hp.bmp", 4, 141, 28, 28)
$Hp = GUICtrlCreateLabel("Hp:", 36, 149, 28, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Mana = GUICtrlCreateLabel("Mana:", 36, 181, 46, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Pic2 = GUICtrlCreatePic("C:\Users\Localhost\Desktop\Mp.jpg", 4, 173, 28, 28)
$TabSheet2 = GUICtrlCreateTabItem("Dash")
$Button1 = GUICtrlCreateButton("Dash On", 4, 29, 347, 57)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x3399FF)
$TabSheet3 = GUICtrlCreateTabItem("Healer")
$Checkbox1 = GUICtrlCreateCheckbox("Healing Enable/Disable", 148, 53, 169, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Checkbox2 = GUICtrlCreateCheckbox("Mana Enable/Disable", 148, 157, 185, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Combo3 = GUICtrlCreateCombo("", 68, 77, 57, 25, BitOR($GUI_SS_DEFAULT_COMBO,$CBS_SIMPLE))
GUICtrlSetData(-1, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12|", "item1")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Combo2 = GUICtrlCreateCombo("", 68, 181, 57, 25, BitOR($GUI_SS_DEFAULT_COMBO,$CBS_SIMPLE))
GUICtrlSetData(-1, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12|", "item1")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Input1 = GUICtrlCreateInput("Health", 4, 53, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Manaa = GUICtrlCreateInput("Mana", 4, 157, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label5 = GUICtrlCreateLabel("Hotkey:", 4, 77, 48, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label6 = GUICtrlCreateLabel("Hotkey:", 4, 181, 48, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label7 = GUICtrlCreateLabel("Health", 44, 29, 49, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
$Label8 = GUICtrlCreateLabel("Mana", 44, 125, 42, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x0000FF)
$TabSheet4 = GUICtrlCreateTabItem("Anty Idle")
$Button4 = GUICtrlCreateButton("Anty Idle On", 116, 29, 115, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x3399FF)
$Checkbox3 = GUICtrlCreateCheckbox("Eat Food", 132, 109, 97, 17)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$Button5 = GUICtrlCreateButton("Anty Idle Off", 116, 69, 115, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x3399FF)
$Combo1 = GUICtrlCreateCombo("", 132, 141, 81, 25, BitOR($GUI_SS_DEFAULT_COMBO,$CBS_SIMPLE))
GUICtrlSetData(-1, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12|", "item1") ; Anty Idle Combo Box
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label4 = GUICtrlCreateLabel("Hotkey:", 76, 141, 48, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$TabSheet5 = GUICtrlCreateTabItem("Tools")
$Button3 = GUICtrlCreateButton("Exit", 4, 181, 347, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Label9 = GUICtrlCreateLabel("Auto Runemaker", 108, 29, 141, 24)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x3399FF)
$Label10 = GUICtrlCreateLabel("Hotkey:", 116, 61, 48, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlCreateInput("", 124, 93, 121, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Label11 = GUICtrlCreateLabel("If mana >", 60, 101, 57, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Combo4 = GUICtrlCreateCombo("", 164, 61, 65, 25, BitOR($GUI_SS_DEFAULT_COMBO,$CBS_SIMPLE))
GUICtrlSetData(-1, "F1|F2|F3|F4|F5|F6|F7|F8|F9|F10|F11|F12|", "item1")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Button6 = GUICtrlCreateButton("Save Settings", 4, 149, 347, 25)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlCreateTabItem("")
$Label1 = GUICtrlCreateLabel("Train Bot v1.0", 248, 0, 99, 20)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
_GuiExpand_Trans($Form1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$Chose = GUICtrlRead($Combo1)
$F1 = "F1"
$F2 = "F2"
$F3 = "F3"
$F4 = "F4"
$F5 = "F5"
$F6 = "F6"
$F7 = "F7"
$F8 = "F8"
$F9 = "F9"
$F10 = "F10"
$F11 = "F11"
$F12 = "F12"
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exits()
       Case $Button1
      Dash()
Case $Button3
Exits()
       Case $Button4
Antyidle()

EndSwitch
WEnd




Func Info()
EndFunc
Func Healing()
EndFunc
Func ManaHealing()
EndFunc
Func Runemaker()
EndFunc
Func Antyidle()
If GUICtrlRead($Checkbox3) = $GUI_CHECKED Then
Idlefood()
Else
Idle()
EndIf
EndFunc
Func Dash()
While 1
Local $hDLL = DllOpen("user32.dll")
$PID = ProcessExists("Tibia.exe")
If WinActive("Tibia") Then
If _IsPressed("25", $hDLL) Then
ControlSend("Tibia", "", "", "{Left}")
ControlSend("Tibia", "", "", "{Left}")
EndIf
If _IsPressed("26", $hDLL) Then
ControlSend("Tibia", "", "", "{Up}")
ControlSend("Tibia", "", "", "{Up}")
EndIf
If _IsPressed("27", $hDLL) Then
ControlSend("Tibia", "", "", "{Right}")
ControlSend("Tibia", "", "", "{Right}")
EndIf
If _IsPressed("28", $hDLL) Then
ControlSend("Tibia", "", "", "{Down}")
ControlSend("Tibia", "", "", "{Down}")
EndIf
EndIf
Sleep(250)
DllClose($hDLL)
WEnd
EndFunc
Func Idle()
While 1
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{CtrlDown}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{Up}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{CtrlUp}")
Sleep ( 7000 )
ControlSend("Tibia", "", "", "{CtrlDown}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{Right}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{CtrlUp}")
Sleep ( 6000 )
ControlSend("Tibia", "", "", "{CtrlDown}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{Left}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{CtrlUp}")
Sleep ( 7500 )
ControlSend("Tibia", "", "", "{CtrlDown}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{Down}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{CtrlUp}")
WEnd
EndFunc
Func Idlefood()
While 1
ControlSend("Tibia", "", "", "{F1}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{CtrlDown}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{Up}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{CtrlUp}")
Sleep ( 7000 )
ControlSend("Tibia", "", "", "{CtrlDown}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{Right}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{CtrlUp}")
Sleep ( 6000 )
ControlSend("Tibia", "", "", "{CtrlDown}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{Left}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{CtrlUp}")
Sleep ( 7500 )
ControlSend("Tibia", "", "", "{CtrlDown}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{Down}")
Sleep ( 3000 )
ControlSend("Tibia", "", "", "{CtrlUp}")
WEnd
EndFunc
Func Exits()
$Box = MsgBox ( 1, "Program exit", "Do you want to exit the program ?", "", "bot" )
If $Box = 1 Then
Exit
EndIf
EndFunc

 

 

Jak w tamtym kodzie podpisać button X na zamykanie w trakcie wykonywania funkcji tak aby działał.

No i jak ustawić tutaj to:

ControlSend("Tibia", "", "", "{HOTKEY Z COMBOBOXA NR1}")

Opublikowano

masz dużo controlsendów i w timerze mogłby ci się mieszać, musiałbyś dodać do tego przywileje,

@down

jak kiedys botka pisalem to mi się mieszało i musiałem napisać kolejność, ponieważ czasami 2 funkcje na raz dzialaly się psuło, a kolega ma jeszcze sleepy które będą się kłócić z timerem

 

więc najlepiej by bylo wrzucic caly program w while, a aby ci guziki działały na gui użyj guiregistermsg(0x0111)

Opublikowano
wykorzystać hooka na klawe z _Ispressed

Nie ma czegoś takiego.

Hook to hook; isPressed to asynchroniczne sprwadzanie stanu i nie ma z tym nic wspólnego ( i generalnie odradzam z niego korzystać ).

 

@UP

Nie, nie mogłoby się "mieszać". Timer'y pracują w tym samym wątku, co główna aplikacja, nie istnieje żaden problem z synchronizacją.

 

@Arkeus

Możesz odpalić tylko jedno while(true) na raz. Jeśli jakakolwiek pętla while(true) inna od tej odpowiedzialnej za interpretacje zdarzen GUI ( GuiGetMsg() ) się wykonuje, GUI oczywiście nie będzie reagować. W konsekwencji:

- wszystkie pętle do osobnego timer'a LUB

- wszystkie pętle do jednej pętli - sterować za pomocą GetTickCount i instrukcji warunkowych ( trudniejsze w utrzymaniu )

 

Za odczytywanie wartości z ComboBox'a służy GuiCtrlRead. Do łączenia stringów: operator &

Ta sygnatura jest pusta.

Opublikowano
Hook to hook; isPressed to asynchroniczne sprwadzanie stanu i nie ma z tym nic wspólnego ( i generalnie odradzam z niego korzystać ).

W takim razie co będzie szybciej chodzić od _ispressed??Np to działa tak ułomnie że jak nacisne sobie < to działa dopiero po 2 razie...

Macie coś szybszego od _isPressed?

Co do tych timerów jest przynajmniej szansa że da się to napisać tak aby działało poprawnie i dało się wykonywać kilka akcji naraz?

@jackraymund Napisałem ci na pw co do odczytywania adresów jak możesz to odpisz.

Opublikowano

Za odczytywanie wartości z ComboBox'a służy GuiCtrlRead. Do łączenia stringów: operator &

Uzywam tego tak:

[/size][/font][/left]


[left][font=tahoma, helvetica, arial, sans-serif][size=3]$Chose = GUICtrlRead($Combo1)
ORAZ
ControlSend("Tibia", "", "", "{&$Chose&}")

I nie dziala co zle?

Poza tym jeszcze dodam że odczytuje on wartość comboboxa z pliku Settings a nie obecnej wartosci ktora jest ustawiona to create do comboboxa:


$Combo1 = GUICtrlCreateCombo(IniRead("Settings.ini", "Combo1", "Combo1",""), 132, 141, 81, 25, BitOR($GUI_SS_DEFAULT_COMBO,$CBS_SIMPLE))

@

4ggr35510n Będzie to lepiej działać niż _Ispressed? to może bym zastąpił jednak bo opornie działa.

Co do timerów to wkońcu musze dać pryiorytety dla danych akcji nie wystarczy różnica opóźnienia w timerze do uzycia poszczególnych funkcji??

EDIT COS Z MPC MI SIE WALI TAM U GORY JEST

$Chose = GUICtrlRead($Combo1

Opublikowano

$loku='loku'
$=''

$lokuxd=$loku&$

tak sie tego uzywa

nie lepiej ci dac w tablice pokolei to co chcesz klikac i dac to w petle?

 

do skilwania mam cos takiego np:

Dim $key[5] = ["{up}", "{down}", "{left}", "{right}", 0]
AdlibRegister("skill", 600000)
While 1
Sleep(1000)
WEnd
Func skill()
If $key[4] = 4 Then $key[4] = 0
ControlSend("[CLASS:TibiaClient]", "", "", "{ctrldown}" & $key[$key[4]] & "{ctrlup}")
ToolTip($key[$key[4]])
$key[4] += 1
EndFunc   ;==>skill

 

ps. w ogóle co ma robic ten twoj program?

Do
$wiek+=1
Until ŻycieGetMsg() = -3

zbieram +

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...