[AutoIt] CrayonCode Bot Project (OpenSource & Free)

05/27/2017 04:56 Acrediur#601
Amity bot please!
05/27/2017 07:31 m00se#602
Ive noticed since patch 0.20 the feed workers havnt really been working because the feed worker and repeat all tasks button coords are too low
05/27/2017 17:49 ahmedwork#603
Quote:
Originally Posted by iNiperx View Post
It's going to be a paid bot sadly, randomized title says "pay", illuminati confirmed :D xD so far so good bro, if you aren't going to sell it you can always make it open source for others to learn and change to their likings (:
hehehe no xD i won't sell it it was meant from the beginning to be for learning purpose i just started learning c# 4 months ago and yea I'll release it for public wheb i get the maximum of it :3
05/28/2017 15:03 Excepter#604
Bot no changes rods? Oh 0.21v not changed and not use foods, but in 0.18 perfect working
05/28/2017 15:08 ClientX#605
Hi CrayonCode,

thanks for the open source of this program.

I was curious how you did the detection of the letters from the fishing mini game so I started looking into your code.

I understand how you did it from the top level but I am confused in some areas. I would appreciate it if you could PM me a quick explanation.

I dont understand some of the lines below except that you are taking a snapshot with FFSnapShot() and then saving the letter color into $LetterColor, but how you're using the functions with the parameters such as with FFSnapShot and FFGetPixel, and what $COffest is what I don't understand:

Code:
Local $C = FindRiddleAnchor()
If $C[0] = -1 Or $C[1] = -1 Then Return False
FFSnapShot($C[0] - 90, $C[1] - 90, $C[0] + $Spacing * 10 + 90, $C[1], $SSN)
$LetterColor = FFGetPixel($C[0] - 90 + $COffset[0], $C[1] - 90 + $COffset[1], $SSN)
Local $AnchorC[2] = [$C[0] - 90 + $COffset[0], $C[1] - 90 + $COffset[1]]
Then I see that you use Riddle() in a loop to find what the letters are where each time, you save the the letter into the $Word[] array as you increment to the next element:
Code:
For $i = 0 To 9 Step 1
        $Riddle = Riddle($AnchorC[0] + $Spacing * $i, $AnchorC[1], $LetterColor, $SSN)
        If $Riddle = 4 Then ; If unidentified exit loop
            $Word[$i] = $L[$Riddle]
            ExitLoop
        Else
            $Word[$i] = $L[$Riddle]
            $Wordlength += 1
        EndIf
    Next
I am mainly confused about what $C, $COffset,$AnchorC, and $C[0] -90 is (basically what are you passing into all the parameters of those functions used above?

By the way, does anyone have 1440p resolution settings? I searched the thread and found other people requesting but no .ini file yet.
05/28/2017 15:33 killzone#606
Quote:
Originally Posted by s3anlike View Post
Hey guys is it possible to upload the stats from bot on a ftp server to see what the bot did collect if you are not on pc?
A better solution is to "Send you the logs" as an SMS.

Pushbullet can do this.

Quote:
Originally Posted by Acrediur View Post
Amity bot please!
Amity? Like pressing F5?

Quote:
Originally Posted by ahmedwork View Post
hehehe no xD i won't sell it it was meant from the beginning to be for learning purpose i just started learning c# 4 months ago and yea I'll release it for public wheb i get the maximum of it :3
Github perhaps?
Im a VB guy since 2000s (Yea Im old, and still doesnt like scripting like language) so C# is not my main forte but I know some. Would be great start to learn C# botting and then move to C# when Im confident enough.

Quote:
Originally Posted by ClientX View Post
Snipped
The Riddle solver looks for the . (mid point of > V ^ <).
If Im correct, this has been explained by @[Only registered and activated users can see links. Click Here To Register...] in earlier post.

Also in Page 23s, you can see the post of CrayonCode explaining how to Setup your own Resolution_settings.ini
05/28/2017 22:31 CrayonCode#607
Quote:
Originally Posted by ClientX View Post
I dont understand some of the lines below except that you are taking a snapshot with FFSnapShot() and then saving the letter color into $LetterColor, but how you're using the functions with the parameters such as with FFSnapShot and FFGetPixel, and what $COffest is what I don't understand:

Code:
Local $C = FindRiddleAnchor()
If $C[0] = -1 Or $C[1] = -1 Then Return False
FFSnapShot($C[0] - 90, $C[1] - 90, $C[0] + $Spacing * 10 + 90, $C[1], $SSN)
$LetterColor = FFGetPixel($C[0] - 90 + $COffset[0], $C[1] - 90 + $COffset[1], $SSN)
Local $AnchorC[2] = [$C[0] - 90 + $COffset[0], $C[1] - 90 + $COffset[1]]
I am mainly confused about what $C, $COffset,$AnchorC, and $C[0] -90 is (basically what are you passing into all the parameters of those functions used above?
That's one of the early functions I wrote for this project and a perfect display of the bad habits I started with. This is how it looks in the reworked version and should hopefully make things more clear.

Code:
Func Riddler() ; Solves the fishing letter minigame
	Local Const $AnchorOffset[2] = [16, 25] ; relative position to Anchor (pointing to center of the arrow beneath each letter)
	Local Const $Spacing = 35 ; Space between each Letter
	Local Const $L[5] = ["s", "w", "d", "a", "."] ; basic minigame letters ("." for unidentified)
	Local $Word[10], $LetterColor, $text, $Riddle, $Wordlength = 0, $SSN = 1

	Local $aAnchor = FindRiddleAnchor()
	If Not IsArray($aAnchor) Then
		SetGUIStatus("Perfect Catch?")
		Return False
	EndIf

	$aAnchor[0] -= 45 ; Base Offset to include letters since anchor is below
	$aAnchor[1] -= 60
	FFSnapShot($aAnchor[0] - 10, $aAnchor[1] - 10, $aAnchor[0] + $Spacing * 10 + 10, $aAnchor[1] + 40, $SSN)
	$LetterColor = FFGetPixel($aAnchor[0] + $AnchorOffset[0], $aAnchor[1] + $AnchorOffset[1], $SSN)

	; Riddle each letter position from left to right until one is unidentified or last position is reached.
	For $i = 0 To 9 Step 1
		$Riddle = Riddle($aAnchor[0] + $AnchorOffset[0] + $Spacing * $i, $aAnchor[1] + $AnchorOffset[1], $LetterColor, $SSN)
		If $Riddle = 4 Then ; If unidentified exit loop
			$Word[$i] = $L[$Riddle]
			ExitLoop
		Else
			$Word[$i] = $L[$Riddle]
			$Wordlength += 1
		EndIf
	Next

	; If Wordlenght is >= 2 Then send each letter
	If $Wordlength < 2 Then
		Return (False)
	Else
		For $i = 0 To 9 Step 1
			If $Word[$i] <> "." Then
				Sleep(50) ; TODO Settings
				CoSe($Word[$i])
				$text &= $Word[$i]
			EndIf
			Sleep(100)
		Next
		Return (True)
	EndIf
EndFunc   ;==>Riddler

PS: New version is delayed a little more due to the perfect weather. Cba to sit at home atm, sorry.
05/29/2017 01:59 †Deadly†#608
Quote:
Originally Posted by CrayonCode View Post
That's one of the early functions I wrote for this project and a perfect display of the bad habits I started with. This is how it looks in the reworked version and should hopefully make things more clear.

Code:
Func Riddler() ; Solves the fishing letter minigame
	Local Const $AnchorOffset[2] = [16, 25] ; relative position to Anchor (pointing to center of the arrow beneath each letter)
	Local Const $Spacing = 35 ; Space between each Letter
	Local Const $L[5] = ["s", "w", "d", "a", "."] ; basic minigame letters ("." for unidentified)
	Local $Word[10], $LetterColor, $text, $Riddle, $Wordlength = 0, $SSN = 1

	Local $aAnchor = FindRiddleAnchor()
	If Not IsArray($aAnchor) Then
		SetGUIStatus("Perfect Catch?")
		Return False
	EndIf

	$aAnchor[0] -= 45 ; Base Offset to include letters since anchor is below
	$aAnchor[1] -= 60
	FFSnapShot($aAnchor[0] - 10, $aAnchor[1] - 10, $aAnchor[0] + $Spacing * 10 + 10, $aAnchor[1] + 40, $SSN)
	$LetterColor = FFGetPixel($aAnchor[0] + $AnchorOffset[0], $aAnchor[1] + $AnchorOffset[1], $SSN)

	; Riddle each letter position from left to right until one is unidentified or last position is reached.
	For $i = 0 To 9 Step 1
		$Riddle = Riddle($aAnchor[0] + $AnchorOffset[0] + $Spacing * $i, $aAnchor[1] + $AnchorOffset[1], $LetterColor, $SSN)
		If $Riddle = 4 Then ; If unidentified exit loop
			$Word[$i] = $L[$Riddle]
			ExitLoop
		Else
			$Word[$i] = $L[$Riddle]
			$Wordlength += 1
		EndIf
	Next

	; If Wordlenght is >= 2 Then send each letter
	If $Wordlength < 2 Then
		Return (False)
	Else
		For $i = 0 To 9 Step 1
			If $Word[$i] <> "." Then
				Sleep(50) ; TODO Settings
				CoSe($Word[$i])
				$text &= $Word[$i]
			EndIf
			Sleep(100)
		Next
		Return (True)
	EndIf
EndFunc   ;==>Riddler

PS: New version is delayed a little more due to the perfect weather. Cba to sit at home atm, sorry.
No problem take your time ! :)
05/29/2017 03:13 262626262626#609
Quality before quantity, I don't mind waiting. In the meantime, if someone could help me figure out that PurpleBag missing thing, I would be thankful, tried everything (Well, obviously not since it isn't working but you get me); No resolution problems, correct image in RES folder, tried replacing it with a custom *.bmp, I am lost. I am a noob but I searched and have been patient :D

y'all enjoy the weather now :)
05/29/2017 04:14 Logilac#610
The bot works great but, sometimes its faster than the UI can load up when talking to NPC´s, that means that it gets stuck on these tasks, to get around this problem it would be nice if you could set a delay of maybe 2-3 seconds after each action. Or let the user self decide on how long the delay should be by adding a little tab under settings.

edit: the bot does also not collect the new Striker Event Seals (probably lack of image for the Seals)
05/29/2017 17:14 palancho#611
First of all, great job!!!- first free bot for bdo :)
I have found few bugs:
1. bot recognise event items as green fish, disabling looting green fish stops looting event items
2. when more than one event item appears in loot window bot loots only one and starts to bug itself- stops fishing and starting to cast fishing all the time

And I got few questions:
1. Does the selling fish to trade manager work?- also do I need to set up path to this npc- if yes: how?
THX a lot!!!

Edit: Also workers feeding does not work properly- it triggers, but it seems coordinates are wrong- cursor does not move in proper directions.
05/29/2017 19:54 vaandoom32#612
Can someone make a video tutorial on how to use this? Or at least kind of layout the steps? I only ask because I do not see a .exe so when looking at this I really am unsure what needs to be done. I can pay if need be.
05/29/2017 20:16 palancho#613
Quote:
Originally Posted by vaandoom32 View Post
Can someone make a video tutorial on how to use this? Or at least kind of layout the steps? I only ask because I do not see a .exe so when looking at this I really am unsure what needs to be done. I can pay if need be.
Install Autoit- newest version.
Open Bot: Crayon Code
Setup Bot

Good luck.
05/29/2017 21:05 Scrainer11#614
Nice bot man. Awesome one.

Autofishing works like a charm!
05/29/2017 21:49 palancho#615
Could anyone help me to fix workers feeding pls? Which line to edit and how? Thank You!!!