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

Recursion Problem


Rekomendowane odpowiedzi

Opublikowano

Hejka wysylam w kodzie mojego bardzo prostego ,,heal-bota" do tibii.

wszystko ladnie pieknie dziala tak jak nalezy jednak po jakims czasie wywala blad recursion problem.

Nie wiem jak to mozna inaczej zrobic takze wyladowalem tutaj

Dzieki.

Cytat

#include <array.au3>
#Include <File.au3>
#include <string.au3>
#include <Misc.au3>
#include <Clipboard.au3>
#include <ImageSearch.au3>
#include <ScreenCapture.au3>

Global $x, $y

HotKeySet("{ESC}","Exuragran")
HotKeySet("{END}","ext")
hotkeyset("{INSERT}","rotfl")

While 1
       Sleep(500)
   WEnd

func ext()
exit
EndFunc


func lol1()
WinActivate("Tibia ")
WinSetOnTop("Tibia ", "", 0)
Sleep(100)
lol()
EndFunc

func Exuragran()
$result = _ImageSearchArea("piksel.bmp", 1, 1787, 174, 1795, 192, $x, $y, 20)
If $result = 1 Then
Exura()
else
Controlsend("", "", "", "{F2}" )
Exura()
EndIf
EndFunc


func Exura()
$result = _ImageSearchArea("piksel.bmp", 1, 1824, 174, 1832, 192, $x, $y, 20)
If $result = 1 Then
Exuragran()
Else
Controlsend("", "", "", "{F1}" )
Exuragran()
EndIf
EndFunc


func rotfl()
Sleep(10000000)
EndFunc

 

Opublikowano
Cytat

>"C:\Program Files (x86)\AutoIt3\SciTE\..\au3check.exe" -q "C:\Users\xxxxi\Desktop\NaHexane\website.au3"
"C:\Users\xxxxx\Desktop\NaHexane\ImageSearch.au3"(30,46) : error: missing separator character before keyword.
Func _ImageSearch($findImage,$resultPosition,ByRef
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\xxxxx\Desktop\NaHexane\ImageSearch.au3"(34,73) : error: missing separator character before keyword.
Func _ImageSearchArea($findImage,$resultPosition,$x1,$y1,$right,$bottom,ByRef
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\xxxxx\Desktop\NaHexane\ImageSearch.au3"(74,63) : error: missing separator character before keyword.
Func _WaitForImageSearch($findImage,$waitSecs,$resultPosition,ByRef
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\xxxxxi\Desktop\NaHexane\ImageSearch.au3"(109,64) : error: missing separator character before keyword.
Func _WaitForImagesSearch($findImage,$waitSecs,$resultPosition,ByRef
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
"C:\Users\xxxxx\Desktop\NaHexane\website.au3"(28,5) : error: lol(): undefined function.
lol()
~~~~^
C:\Users\xxxxx\Desktop\NaHexane\website.au3 - 5 error(s), 0 warning(s)
>Exit code: 2    Time: 0.9679

 

 

123123123.png

Opublikowano
#include <array.au3>
#Include <File.au3>
#include <string.au3>
#include <Misc.au3>
#include <Clipboard.au3>
#include <ImageSearch.au3>
#include <ScreenCapture.au3>

Global $x, $y

HotKeySet("{ESC}","Exuragran")
HotKeySet("{END}","ext")
hotkeyset("{INSERT}","rotfl")

While 1
       Sleep(500)
   WEnd

func ext()
exit
EndFunc

lol1(0)
func lol1($i)
WinActivate("Tibia ")
WinSetOnTop("Tibia ", "", 0)
Sleep(100)
$i += 1
If $i = 1 Then Return
lol1($i)
EndFunc

func Exuragran()
$result = _ImageSearchArea("piksel.bmp", 1, 1787, 174, 1795, 192, $x, $y, 20)
If $result = 1 Then
Exura()
else
Controlsend("", "", "", "{F2}" )
Exura()
EndIf
EndFunc


func Exura()
$result = _ImageSearchArea("piksel.bmp", 1, 1824, 174, 1832, 192, $x, $y, 20)
If $result = 1 Then
Exuragran()
Else
Controlsend("", "", "", "{F1}" )
Exuragran()
EndIf
EndFunc


func rotfl()
Sleep(10000000)
EndFunc
  
  
  
  albo tego
  
  
  #include <array.au3>
#Include <File.au3>
#include <string.au3>
#include <Misc.au3>
#include <Clipboard.au3>
#include <ImageSearch.au3>
#include <ScreenCapture.au3>

Global $x, $y

HotKeySet("{ESC}","Exuragran")
HotKeySet("{END}","ext")
hotkeyset("{INSERT}","rotfl")

While 1
       Sleep(500)
   WEnd

func ext()
exit
EndFunc

lol1(0)
func lol1($i)
WinActivate("Tibia ")
WinSetOnTop("Tibia ", "", 0)
Sleep(100)
$i += 1
If $i = 1 Then Return
lol1($i)
EndFunc

func Exuragran()
$result = _ImageSearchArea("piksel.bmp", 1, 1787, 174, 1795, 192, $x, $y, 20)
If $result = 1 Then
Exura(1)
else
Controlsend("", "", "", "{F2}" )
Exura(1)
EndIf
EndFunc

Exura(1)
func Exura($i)
$result = _ImageSearchArea("piksel.bmp", 1, 1824, 174, 1832, 192, $x, $y, 20)
If $result = 1 Then
Exuragran()
Else
Controlsend("", "", "", "{F1}" )
Exuragran()
$i+=1
If $i =1 then Return
Exura($i)
EndIf
EndFunc


func rotfl()
Sleep(10000000)
EndFunc

niestety nie gram w tibie więc nie moge przetestować ,ale spróbuj tego

4988173475.png

Opublikowano

Funkcje exuragran wywoluje funkcje exura ktora wywoluje funkcje exuragran... i tak w nieskonczonosc. To praktycznie tak jakbys napisal:

function exuragran()
	exura()
endfunc

function exura()
	exuragran()
endfunc

Co nie ma sensu.

 

 

Opublikowano
#include <array.au3>
#Include <File.au3>
#include <string.au3>
#include <Misc.au3>
#include <Clipboard.au3>
#include <ImageSearch.au3>
#include <ScreenCapture.au3>

Global $x, $y

HotKeySet("{f9}","Exuragran")
HotKeySet("{END}","ext")
hotkeyset("{INSERT}","rotfl")

While 1
       Sleep(500)
   WEnd

func ext()
exit
EndFunc


func lol1()
WinActivate("Tibia ")
WinSetOnTop("Tibia", "", 0)
Sleep(100)
lol1()
EndFunc

func Exuragran()
 $result = _ImageSearchArea("piksel.bmp", 1, 1787, 174, 1795, 192, $x, $y, 20)
If $result = 1 Then
Controlsend("", "", "", "{F2}" )
Else
$result = _ImageSearchArea("piksel.bmp", 1, 1824, 174, 1832, 192, $x, $y, 20)
Controlsend("", "", "", "{F1}" )
EndIf
Exuragran()
EndFunc




func rotfl()
Sleep(10000000)
EndFunc

może to? Pobawiłbym się z tym ale net mi muli więc zanim bym pobrał tibie to dawno noc by byla xD  więc nie ma jak testować tego

4988173475.png

Opublikowano
11 godzin temu, radulcia123 napisał:

Monarchia wywala ten sam blad na obydwu.

^ Wiem ze ta funkcja tak wyglada , tylko pomyslu jak inaczej to ugryzc zeby nie bylo petli nie wiem :x

Wywal rekursje i dodaj petle. Rekursja to nie to samo co nieskonczona petla. https://pl.wikipedia.org/wiki/Rekurencja

Np.

HotKeySet("{ESC}","Healing")
HotKeySet("{END}","ext")

$bHeal = False


;main loop
While 1
	Sleep(100)
WEnd

Func Healing()
	$bHeal = Not $bHeal
	While $bHeal
		Exura()
		Exuragran()
		Sleep(10)
	WEnd
EndFunc

func Exura()
	$result = _ImageSearchArea("piksel.bmp", 1, 1824, 174, 1832, 192, $x, $y, 20)
	If $result == 0 Then
		Controlsend("", "", "", "{F1}" )
	EndIf
EndFunc

Func Exuragran()
	$result = _ImageSearchArea("piksel.bmp", 1, 1787, 174, 1795, 192, $x, $y, 20)
	If $result == 0 Then
		Controlsend("", "", "", "{F2}" )
	EndIf
EndFunc

Func ext()
	Exit
EndFunc

Jesli grasz na realu to raczej i tak nie masz sie co trudzic, bo cos takiego imo. BattlEye dosc latwo wylapie.

 

 

Zarchiwizowany

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

×
×
  • Dodaj nową pozycję...