Guide AHK Pixel/Imagesearch Bot (DarkRO)

06/13/2020 21:36 kgrawr#16
I fixed that issue. It's working fine now but can you help me for coding random walks? I can't maintain teleporting since SP being drained too quickly.

it's a low rate server.
06/16/2020 14:51 zianna25#17
Good day sir...i have a question.what the meaning of.a_screenwith..it says alway peco not found....can u explain what size of screen resulotion to be used...thnx for the answer
06/30/2020 02:32 niwra726#18
hi what pallete color you using?

Quote:
Originally Posted by nozomi.gusta View Post
edit your square, make the border red and the blue at the middle.
how to do this?
06/30/2020 08:31 gohancool#19
Quote:
Originally Posted by nozomi.gusta View Post
I use OCR, convert image to text. Thou it is not that accurate but it helps alot.
Can you link to the OCR, I tried some of them in the AHK forums but they don't seem to work for me.

Thanks in advance :)
07/01/2020 18:19 nozomi.gusta#20
Quote:
Originally Posted by zianna25 View Post
Good day sir...i have a question.what the meaning of.a_screenwith..it says alway peco not found....can u explain what size of screen resulotion to be used...thnx for the answer
a_screenwith means the width of your screen. it automatically finds your screen size, thou you can also manually set it.

Quote:
Originally Posted by gohancool View Post
Can you link to the OCR, I tried some of them in the AHK forums but they don't seem to work for me.

Thanks in advance :)
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
07/01/2020 18:25 gohancool#21
Quote:
Originally Posted by nozomi.gusta View Post
a_screenwith means the width of your screen. it automatically finds your screen size, thou you can also manually set it.



[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
THANK YOU SO MUCH!!!!:handsdown:
07/05/2020 01:12 anthonyako#22
Will this also work in MSP?
07/07/2020 09:26 nozomi.gusta#23
Quote:
Originally Posted by anthonyako View Post
Will this also work in MSP?
if macro is allowed.
07/11/2020 00:55 kevonedmon#24
hi sir i followed everything but it keeps teleporting not even click the grandpeco.
07/20/2020 14:35 jzordick#25
(F3)(3), 623, 493#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

f2::Reload

F1::
{
Loop
{
Sleep 750

ImageSearch, FoundX, FoundY, 1, 1, A_ScreenWidth, A_ScreenHeight, Grand.png
if (ErrorLevel = 0)
{
Click, %FoundX%, %FoundY%
sleep 1300
send {H}
}
else if (ErrorLevel = 1)
{
send {H}
}

{

{
Sleep 500

ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, Orc.png
if (ErrorLevel = 0)
{
sleep 200
Send {H}, %FoundX%, %FoundY%


}

}
}
}
}
return



I'm not a pro programmer but I'm trying to learn how to make this config a bit more less hassle in terms of avoiding the orc or when my farmer detected that there's an orc nearby it will automatically gonna use fly wing but I've tried a million times now I really can't figure out what command I should use..I hope the author of this thread could help and check this script that I made
07/21/2020 14:23 nozomi.gusta#26
Quote:
Originally Posted by jzordick View Post
(F3)(3), 623, 493#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

f2::Reload

F1::
{

Loop
{
Sleep 750

ImageSearch, FoundX, FoundY, 1, 1, A_ScreenWidth, A_ScreenHeight, Grand.png
if (ErrorLevel = 0)
{
Click, %FoundX%, %FoundY%
sleep 1300
send {H}
}
else if (ErrorLevel = 1)
{
send {H}
}

{

{
Sleep 500

ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, Orc.png
if (ErrorLevel = 0)
{
sleep 200
Send {H}, %FoundX%, %FoundY%


}

}
}
}
}
return



I'm not a pro programmer but I'm trying to learn how to make this config a bit more less hassle in terms of avoiding the orc or when my farmer detected that there's an orc nearby it will automatically gonna use fly wing but I've tried a million times now I really can't figure out what command I should use..I hope the author of this thread could help and check this script that I made
Have not test the code since i no longer play DarkRO if there is problem please post again

Code:
F1::
{
	telecounter := 0
	
	Loop
	{
		Sleep 500
		ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, Orc.png
		if (ErrorLevel = 0)
		{
			sleep 200
			Send {H}
		}
		else if (ErrorLevel = 1)
		{
			sleep 500
			ImageSearch, FoundX, FoundY, 1, 1, A_ScreenWidth, A_ScreenHeight, Grand.png
			if (ErrorLevel = 0)
			{
				Click, %FoundX%, %FoundY%
				sleep 500
				
				telecounter++		;; You need this so pixel bot will not get stuck if peco cannot be reached
				if telecounter > 15	;; It will force teleport every 15seconds with or without peco
				{					
					send {H}	        ;; Assuming your teleport or flywing is Letter H
				}					
			}
			else if (ErrorLevel = 1)
			{
				send {H}
				telecounter = 0
			}
			Sleep 500
		}
	}
}
return
07/22/2020 00:33 tjandres23#27
I follow the instruction but it keep me teleport only. Not even clicking the monster Peco
07/22/2020 20:29 nozomi.gusta#28
Quote:
Originally Posted by tjandres23 View Post
I follow the instruction but it keep me teleport only. Not even clicking the monster Peco
your monster PNG must be color accurate

try this i have upload my orc and peco png, place them in the right grf directory.
the orc and peco png must be in the same folder of your script ahk

[Only registered and activated users can see links. Click Here To Register...]


[Only registered and activated users can see links. Click Here To Register...]

Code:
CoordMode, Pixel, Relative
CoordMode, Mouse, Relative

F2::Reload

F1::
{
	telecounter := 0
	WinWaitActive, DarkRO: Rebirth
	WinSetTitle, DarkRO: Rebirth
	WinGetActiveStats, Title, www, hhhh, X, Y
	
	Loop
	{
		Sleep 500
		ImageSearch, FoundX, FoundY, 0, 0, www, hhhh,*50 orc.png
		if (ErrorLevel = 0)
		{
			sleep 200
			Send {H}
		}
		else if (ErrorLevel = 1)
		{
			sleep 500
			ImageSearch, FoundX, FoundY, 0, 0, www, hhhh,*50 grand.png
			if (ErrorLevel = 0)
			{
				Click, %FoundX%, %FoundY%
				sleep 500
				
				telecounter++		;; You need this so pixel bot will not get stuck if peco cannot be reached
				if telecounter > 15	;; It will force teleport every 15seconds with or without peco
				{					
					send {H}	        ;; Assuming your teleport or flywing is Letter H
				}					
			}
			else if (ErrorLevel = 1)
			{
				send {H}
				telecounter = 0
			}
			Sleep 500
		}
	}
}
return
07/25/2020 05:24 gmalexis#29
do you have a script for auto answering the bot checker captcha?
07/25/2020 10:12 nozomi.gusta#30
Quote:
Originally Posted by gmalexis View Post
do you have a script for auto answering the bot checker captcha?
its easy with vis2 ocr
download vis2 [Only registered and activated users can see links. Click Here To Register...]

place vis2 at the same folder of your script, in your scirpt.ahk include this #include <Vis2>

To input a set of known coordinates, try inputting an array of 4 values, [x, y, w, h] xy as the exact coordinate of the captcha

Code:
text := OCR([x, y, w, h])
You need this to clean the text remove space [ ] and |

Code:
text :=StrReplace(text, "[", "")
text :=StrReplace(text, "]", "")
text :=StrReplace(text, " ", "")
text :=StrReplace(text, "|", "")

For Counting Characters

Code:
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, countchars.png
if (ErrorLevel = 0)
{
        text := OCR([x, y, w, h])
	text := StrLen(text)
        text :=StrReplace(text, "[", "")
        text :=StrReplace(text, "]", "")
        text :=StrReplace(text, " ", "")
        text :=StrReplace(text, "|", "")
	sleep 5000
	send {enter}
	sleep 5000
	send %text%
	sleep 1000
	send {enter}
	sleep 1000
	send {enter}
	sleep 1000
}
For Subtraction and addition

Code:
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, add.png
if (ErrorLevel = 0)
{
     gosub, addsubtract
}

ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, sub.png
if (ErrorLevel = 0)
{
     gosub, addsubtract
}


addsubtract::
{
     text := OCR([x, y, w, h])
     text :=StrReplace(text, "[", "")
     text :=StrReplace(text, "]", "")
     text :=StrReplace(text, " ", "")
     text :=StrReplace(text, "|", "")

     Loop, parse, text, `*/+-
     {
          if A_Index = 1
			number1 := A_LoopField
          if A_Index = 2
			number2 := A_LoopField
     }
     If InStr(text, "-")
     {
	number := number1 - number2
	sleep 5000
	send {enter}
	sleep 5000
	send %number%
	sleep 1000
	send {enter}
	sleep 1000
	send {enter}
	sleep 1000
     }

     If InStr(text, "+")
     {
	number := number1 + number2
	sleep 5000
	send {enter}
	sleep 5000
	send %number%
	sleep 1000
	send {enter}
	sleep 1000
	send {enter}
	sleep 1000
     }
}
return

Before i quit this was the only captcha to appear i dont know if more captcha was added. You need to imagesearch Antibot so that the script would know when to start answering the captcha. For each anti bot question you need a imagesearch for each of them.

[Only registered and activated users can see links. Click Here To Register...]