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

[problem] Problem z Timers or Memoryread?


Rekomendowane odpowiedzi

Opublikowano


#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <nomad.au3>
#include <Timers.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("bot", 214, 169, 192, 124)
$Button1 = GUICtrlCreateButton("Start", 56, 32, 99, 73)
$Hp = GUICtrlCreateInput("Hp", 16, 112, 185, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
$Czar = GUICtrlCreateInput("Czar", 16, 136, 185, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Global $pid = ProcessExists("Tibia.exe")
$memory= _MemoryOpen($pid)
_Timer_SetTimer($Form1,1000,"spell")
EndSwitch
WEnd
Func spell()
$Hp = guictrlread($Hp)
$mem = _MemoryRead(0x0063FE94,$memory)
If $mem >= $Hp Then
controlsend("Tibia","","",GUICtrlRead($Czar))
controlsend("Tibia","","","{ENTER}")
EndIf
EndFunc

Przy uruchomieniu tego bot nie leczy tak jakby zamula po najechaniu na forme klepsydra w w7 jest kolko ladowania.

 

Przy okazji spytam co zrobić aby forma nie zamykała się po nacisnieciu anuluj w msgboxie flaga 1?


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button6
MsgBox ( 1, "Pogram exit", "Do you want to exit the program ?", "", "bot" )
Exit

EndSwitch
WEnd

Weteran
Opublikowano
$box = MsgBox ( 1, "Program exit", "Do you want to exit the program ?", "", "bot" )
If $box = 2 Then
Exit
EndIf

1329036830-U154499.png
Weteran
Opublikowano

Wydupać timera i będzie git ;)

 

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <nomad.au3>
AdlibRegister("spell",1000)
$Form1 = GUICreate("bot", 214, 169, 192, 124)
$Button1 = GUICtrlCreateButton("Start", 56, 32, 99, 73)
$Hp = GUICtrlCreateInput("Hp", 16, 112, 185, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
$Czar = GUICtrlCreateInput("Czar", 16, 136, 185, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
GUISetState(@SW_SHOW)
$speel = 0
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
Global $pid = ProcessExists("Tibia.exe")
$memory= _MemoryOpen($pid)
$speel = 1
EndSwitch
WEnd
Func spell()
If $speel = 1 Then
$Hp = guictrlread($Hp)
$mem = _MemoryRead(0x0063FE94,$memory)
If $mem >= $Hp Then
controlsend("Tibia","","",GUICtrlRead($Czar))
controlsend("Tibia","","","{ENTER}")
EndIf
EndIf
EndFunc

1329036830-U154499.png
Opublikowano

Nom ale chodzi mi o wielowątkowość ;/

Na dodatek nie dziala ;/

Skorzystałem z kodu Raymunda git ;p.

Opublikowano

najpierw na sucho sprawdź czy wyczytuje ci wartość, bo z tego co pamiętam to doszły teraz base adressy i nie jest tak łatwo z czytaniem

ew. możesz użyć abdilregister

Opublikowano

Kurde mam problem z logicznym myśleniem ktoś wyjaśni?


func spell()
$kk = guictrlread($input2)
$mem = _MemoryRead(0x0063FE78,$memaaa)
if $mem <= $kk Then
controlsend("Tibia","","","{F1}")
controlsend("Tibia","","","{enter}")
EndIf
EndFunc

Chodzi tutaj o to ze gdy $mem jest mniejsza albo rowna $kk wcisnie f1 oraz enter ta?

Bo chce zrobic healing a nie runemakera.

 

Ok wszystko juz zrozumialem i odpowiednio edytowałem kod a oco chodzi z tymi base adresami dokladniej ?

Opublikowano

Wytłumaczy mi ktoś może oco chodzi z tymi base adresami dokladniej oraz jak uzywać checkboxa?

Chodzi oto ze gdy check jest zaznaczony rob to a jak nie nie rob nic.

oraz


Case $Button3
_Timer_KillTimer ($Form1, $id1)
Exit

Chodzi mi tutaj oto aby można było wyłączyć program za pomocą buttona3 lub włączyć 2buttona gdy funkcja przypisana do 1 buttona jest wykonywana.

Byłbym wdzięczny.

Opublikowano

Jeszcze spytam gdy daje

#include <nomad.au3>

To po skompilowaniu do .exe musze dołączyć biblioteczke razem z folderem w którym jest .exek czy biblioteka w jakiś sposób wkompiluję się w kod programu?

Opublikowano

Chodzi mi o 1 glowne gui ktore po nacisnieciu np buttona healing wyswietli mi 2 gui

I jeszcze mam 2 pytania:

Jak uzywać checkboxa oraz co zrobic aby moc otworzyc 2 buttony naraz?

Weteran
Opublikowano

If guictrlread($checkbox) = GUI_CHECKED Then ;jezeli jest zaznaczony to..
(...)
endif

 

 

To zrób dwa gui na początku i jedno ukryj. Będziesz je pokazywać buttonem.

 

Otwieranie 2 przycisków naraz? Nie rozumiem..

1329036830-U154499.png
Opublikowano

Mam sobie Button 1 np Msgbox (0, "cos", "cos" ) I chce otworzyc Button2 mając otwartego msgboxa i co? Nie da się wlaśnie o to mi chodziło

Dzięki za pomoc jeszcze raz

Checkbox konsola wywala taki błąd:


D:\Autoit\Projekt sfbota wielowatkowosc\Anty Idle.au3(19,44) : ERROR: syntax error
If guictrlread($Checkbox1) = GUI_CHECKED Then
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Autoit\Projekt sfbota wielowatkowosc\Anty Idle.au3 - 1 error(s), 0 warning(s)

 

Kod programu


While 1
If guictrlread($Checkbox1) = GUI_CHECKED Then
Sleep  ( 1000 )
controlsend("Tibia","","","{F12}")
Sleep ( 1500 )
controlsend("Tibia","","","{F12}")
Sleep ( 1500 )
controlsend("Tibia","","","{F12}")
Sleep ( 1500 )
controlsend("Tibia","","","{F12}")
Sleep ( 30000 )
controlsend("Tibia","","","{F12}")
  endif
  WEnd

Opublikowano

Jak otworzyć 2 button podczas gdy wykonuje się w funkcja przypisana do 1?

I jak zrobić zapis ustawień np chce zapisać sobie pozycje a potem móc je wczytać?

Opublikowano

Problemy:

Jak dokładnie odczytać base adresy i wykorzystać je w AutoIt

Mój kod healerów:

 

 


#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Nomad.au3>
#include <Timers.au3>
#Region ### START Koda GUI section ### Form=
           $Form2 = GUICreate("Healer", 218, 213, 192, 124)
           $Button5 = GUICtrlCreateButton("Start", 8, 8, 203, 33)
           $Input2 = GUICtrlCreateInput("Mana", 48, 88, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
           $Button6 = GUICtrlCreateButton("Instrukcja", 8, 120, 203, 41)
           $Button7 = GUICtrlCreateButton("Exit", 8, 168, 203, 41)
$Input9 = GUICtrlCreateInput("Health", 48, 48, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_CENTER))
           GUISetState(@SW_SHOW)
           #EndRegion ### END Koda GUI section ###


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button5
Global $pid = ProcessExists("Tibia.exe")
$memaaa = _MemoryOpen($pid)
_Timer_SetTimer($Form2, 500, "hp")
_Timer_SetTimer($Form2, 1100, "mana")
Case $Button6
MsgBox(0, "Instrukcja", "cos")
Case $Button7
Exit
EndSwitch
WEnd

Func mana($1, $2, $3, $4)
$kk = GUICtrlRead($Input2)
$mem = _MemoryRead(0x0063FE78, $memaaa)
If $mem <= $kk Then
ControlSend("Tibia", "", "", "{F1}")
EndIf
EndFunc
Func hp($1, $2, $3, $4)
$k = GUICtrlRead($Input9)
$me = _MemoryRead(0x0063FE94, $memaaa)
If $me <= $k Then
ControlSend("Tibia", "", "", "{F2}")
EndIf
  EndFunc

 

 

Problem z checkboxem (nic się nie dzieje po zaznaczeniu/odznaczeniu kod:

 

 


#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Anty-Idle", 246, 199, 192, 124)
$Button1 = GUICtrlCreateButton("Start", 48, 8, 155, 65)
$Button2 = GUICtrlCreateButton("Instrukcja", 8, 120, 227, 33)
$Button3 = GUICtrlCreateButton("Exit", 8, 160, 227, 33)
$Checkbox1 = GUICtrlCreateCheckbox("Food Eat", 104, 88, 97, 17)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
idle()
If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then
While 1
Sleep(1000)
ControlSend("Tibia", "", "", "{F12}")
Sleep(1500)
ControlSend("Tibia", "", "", "{F12}")
Sleep(1500)
ControlSend("Tibia", "", "", "{F12}")
Sleep(1500)
ControlSend("Tibia", "", "", "{F12}")
Sleep(30000)
ControlSend("Tibia", "", "", "{F12}")
WEnd
                EndIf

Case $Button2
MsgBox(0, "Instrukcja", "cos")
Case $Button3
Exit
EndSwitch
WEnd
Func idle()
Global $y[7]
$y[0] = '27899'
$y[1] = '29143'
$y[2] = '28799'
$y[3] = '29211'
$y[4] = '30999'
$y[5] = '28000'
$y[6] = '30000'
Sleep(1000)
While 1
For $i = 0 To 1
Sleep(1000)
ControlSend("Tibia", "", "", "{CtrlDown}")
Sleep(500)
ControlSend("Tibia", "", "", "{Up}")
Sleep(1000)
ControlSend("Tibia", "", "", "{Left}")
ControlSend("Tibia", "", "", "{CtrlUp}")
Sleep($y[Random(0, 6)])
ControlSend("Tibia", "", "", "{CtrlDown}")
Sleep ( 1000 )
ControlSend("Tibia", "", "", "{Down}")
Sleep(1000)
ControlSend("Tibia", "", "", "{Right}")
Sleep(500)
ControlSend("Tibia", "", "", "{CtrlUp}")
Next
Sleep($y[Random(0, 6)])
ControlSend("Tibia", "", "", "{CtrlDown}")
Sleep(500)
ControlSend("Tibia", "", "", "{Right}")
Sleep(1000)
ControlSend("Tibia", "", "", "{Down}")
Sleep(1000)
ControlSend("Tibia", "", "", "{Right}")
Sleep(1000)
ControlSend("Tibia", "", "", "{Up}")
Sleep(500)
ControlSend("Tibia", "", "", "{CtrlUp}")
WEnd
EndFunc   ;==>idle

 

 

Oraz mniejwiecej jak zrobic cavebota,targeting?

Opublikowano

Okej już wszystko wiem o base adressach itp ale nie wiem jak wygladał by taki kod w autoit mogłby ktoś podać np na hp?

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...