Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Black Desert
You last visited: Today at 03:47

  • Please register to post and access all features, it's quick, easy and FREE!

 

[AutoIt] CrayonCode Bot Project (OpenSource & Free)

Reply
 
Old   #961
 
elite*gold: 0
Join Date: Jul 2017
Posts: 16
Received Thanks: 11
Quote:
Originally Posted by s3anlike View Post
I can scroll down self .. i think the log will nothing show im at work >,< post it later
Might as well, at least we can see what's it doing. If you watch the mouse when it tries to scroll, is it making it all the way into the inventory? What if you move the mouse a bit to the right (shouldn't matter if you move over an item)?

Quote:
Originally Posted by s3anlike View Post
Im on v.20 not the github version i need the relog snd restock function
I'll see if I can take a look at the v.20, I have only used the github version myself.

Quote:
Originally Posted by LoL-PaxJax Sale View Post
detection rate in terms of bans?
Hard to say I guess (who really knows), but I would say it's very safe. Doesn't read/inject any memory, it just looks at pixels on the screen and sends mouse movements/ keyboard inputs into the game. As far as the game can tell their human inputs (besides being linear/ repetitive)

Quote:
Originally Posted by LoL-PaxJax Sale View Post
is crayon still working on this project?
No updates on github and hasn't been here in a month, no idea but here to hoping



Rodent11 is offline  
Old   #962
 
elite*gold: 0
Join Date: Jul 2017
Posts: 16
Received Thanks: 11
Well, @s3anlike, take a look at my attached screenshot (Or this link, since the attached image is small: http://i.epvpimg.com/geeEcab.png). We can see what's different here, mostly the offset value.

I would try out a change like this (replace your v.20's OCInventory function with this, should be line 859 in v.20 source):

Code:
Func OCInventory($open = True)
	Local Const $Offset[2] = [-298, 30] ; Offset from reference_inventory to left border of first Inventory Slot. For future use.
	Local $IS = False
	Local $C[2]
	Local $timer = TimerInit()
	While Not $IS And $Fish
		Sleep(250)
		$IS = _ImageSearchArea("res/reference_inventory.bmp", 0, $ResOffset[0], $ResOffset[1], $ResOffset[2], $ResOffset[3], $C[0], $C[1], 15, 0)
		Sleep(250)
		If $IS = True Then
			If $open = True Then
				$C[0] += $Offset[0]
				$C[1] += $Offset[1]
				Return ($C)
			ElseIf $open = False Then
				CoSe("i")
				Sleep(500)
			EndIf
		ElseIf $IS = False Then
			If $open = True Then
				CoSe("i")
				MouseMove($ResOffset[0] + 30, $ResOffset[1] + 30)
				Sleep(500)
			ElseIf $open = False Then
				SetGUIStatus("Inventory closed")
				Return False
			EndIf
		EndIf
		If TimerDiff($timer) / 1000 >= 6 Then
			SetGUIStatus("OCInventory Timeout")
			Return False
		EndIf
	WEnd
EndFunc   ;==>OCInventory
This pretty much aligns it with how it is in the current version, leave the true/false on line 26 alone, in v.20 it is expecting False. The differences in line 8 and 22 don't matter. Line 8 is just different variable names (they're basically the same value), line 22 is just a different position for the mouse, which is in the top left corner of the game window to make sure it's out of the way.

Let me know if that works, if not, the results of testing from my last post.
Attached Images
File Type: jpg Screenshot_8.jpg (21.1 KB, 47 views)


Rodent11 is offline  
Old   #963
 
elite*gold: 100
Join Date: Mar 2006
Posts: 1,620
Received Thanks: 329
Why not fork the Github Version and continue the feature from there? @Rodent11
killzone is offline  
Old   #964
 
elite*gold: 0
Join Date: Jul 2017
Posts: 16
Received Thanks: 11


I haven't had a chance yet to really look over the whole thing, I still don't understand enough of it to start making (big) changes. I was thinking about it if I get more time and @CrayonCode doesn't come back.


Rodent11 is offline  
Old   #965
 
elite*gold: 0
Join Date: Mar 2011
Posts: 97
Received Thanks: 4
Quote:
Originally Posted by Rodent11 View Post
Well, @s3anlike, take a look at my attached screenshot (Or this link, since the attached image is small: http://i.epvpimg.com/geeEcab.png). We can see what's different here, mostly the offset value.

I would try out a change like this (replace your v.20's OCInventory function with this, should be line 859 in v.20 source):

Code:
Func OCInventory($open = True)
	Local Const $Offset[2] = [-298, 30] ; Offset from reference_inventory to left border of first Inventory Slot. For future use.
	Local $IS = False
	Local $C[2]
	Local $timer = TimerInit()
	While Not $IS And $Fish
		Sleep(250)
		$IS = _ImageSearchArea("res/reference_inventory.bmp", 0, $ResOffset[0], $ResOffset[1], $ResOffset[2], $ResOffset[3], $C[0], $C[1], 15, 0)
		Sleep(250)
		If $IS = True Then
			If $open = True Then
				$C[0] += $Offset[0]
				$C[1] += $Offset[1]
				Return ($C)
			ElseIf $open = False Then
				CoSe("i")
				Sleep(500)
			EndIf
		ElseIf $IS = False Then
			If $open = True Then
				CoSe("i")
				MouseMove($ResOffset[0] + 30, $ResOffset[1] + 30)
				Sleep(500)
			ElseIf $open = False Then
				SetGUIStatus("Inventory closed")
				Return False
			EndIf
		EndIf
		If TimerDiff($timer) / 1000 >= 6 Then
			SetGUIStatus("OCInventory Timeout")
			Return False
		EndIf
	WEnd
EndFunc   ;==>OCInventory
This pretty much aligns it with how it is in the current version, leave the true/false on line 26 alone, in v.20 it is expecting False. The differences in line 8 and 22 don't matter. Line 8 is just different variable names (they're basically the same value), line 22 is just a different position for the mouse, which is in the top left corner of the game window to make sure it's out of the way.

Let me know if that works, if not, the results of testing from my last post.
Nothing changes Scroll down function is not working.. :S maybe its not enough to change only OCInventory maybe we need to change DetectFreeInventory too?

Func DetectFreeInventory()
Local $Free, $IS, $x, $y
SetGUIStatus("Detecting free inventory space")
OCInventory(False)
Local $InvA = OCInventory(True)
If IsArray($InvA) = False Then Return False
For $L = 0 To 2 Step 1
If MouseGetPos(0) >= $InvA[0] And MouseGetPos(0) <= $InvA[0] + 500 And MouseGetPos(1) >= $InvA[1] And MouseGetPos(1) <= $InvA[1] + 500 Then MouseMove($InvA[0] - 50, $InvA[1]) ; Keep mouse out of detection range
For $j = 0 To 7 Step 1
For $i = 0 To 7 Step 1
$IS = _ImageSearchArea("res/reference_empty.bmp", 0, $InvA[0] + $i * 48, $InvA[1] - 24 + $j * 48, $InvA[0] + 48 + $i * 48, $InvA[1] + 24 + $j * 48, $x, $y, 10, 0)
If $IS Then
$Free += 1
EndIf
Next
Next
If $L < 2 Then
MouseMove($InvA[0], $InvA[1])
Sleep(50)
MouseWheel("down", 8)
EndIf
Sleep(150)
Next
OCInventory(False)
SetGUIStatus($Free & " empty slots")
Return ($Free)
EndFunc ;==>DetectFreeInventory
s3anlike is offline  
Old   #966
 
elite*gold: 0
Join Date: Jul 2017
Posts: 16
Received Thanks: 11
Quote:
Originally Posted by s3anlike View Post
Nothing changes Scroll down function is not working.. :S maybe its not enough to change only OCInventory maybe we need to change DetectFreeInventory too?
Sorry, it was still early for me, that will probably need to be changed too. Try this:

Code:
Func DetectFreeInventory()
	Local $Free, $IS, $x, $y
	SetGUIStatus("Detecting free inventory space")
	OCInventory(False)
	Local $InvA = OCInventory(True)
	If IsArray($InvA) = False Then Return False
	For $L = 0 To 2 Step 1
		If MouseGetPos(0) >= $InvA[0] And MouseGetPos(0) <= $InvA[0] + 500 And MouseGetPos(1) >= $InvA[1] And MouseGetPos(1) <= $InvA[1] + 500 Then MouseMove($InvA[0] - 50, $InvA[1]) ; Keep mouse out of detection range
		For $j = 0 To 7 Step 1
			For $i = 0 To 7 Step 1
				$IS = _ImageSearchArea("res/reference_empty.bmp", 0, $InvA[0] + $i * 48, $InvA[1] - 24 + $j * 48, $InvA[0] + 48 + $i * 48, $InvA[1] + 24 + $j * 48, $x, $y, 20, 0)
				If $IS Then
					$Free += 1
				EndIf
			Next
		Next
		If $L < 2 Then
			MouseMove($InvA[0] + 5, $InvA[1])
			Sleep(50)
			For $mw = 0 To 7
				MouseWheel("down")
				Sleep(50)
			Next
		EndIf
		Sleep(150)
	Next
	OCInventory(False)
	SetGUIStatus($Free & " empty slots")
	Return ($Free)
EndFunc   ;==>DetectFreeInventory
Specifically there are two changes. First, we're adding 5 pixels to the 'MouseMove' in the X direction (moving it to the right), to make sure it's going into the inventory. Second, changing the 'MouseWheel' to match the current version, which should help if the game isn't running smoothly and misses inputs.

See this screenshot: http://i.epvpimg.com/QaCxdab.png. It should look about like that.

If that doesn't help, again, watch the mouse as it tries to do the 'MouseWheel' event. Is the mouse far enough over into the inventory window? If not, try increasing that "+ 5" (should be on line 1405) to + 10, or something.
Rodent11 is offline  
Old   #967
 
elite*gold: 0
Join Date: Mar 2011
Posts: 97
Received Thanks: 4
Got it now thanks

Func DetectFreeInventory()
Local $Free, $IS, $x, $y
SetGUIStatus("Detecting free inventory space")
OCInventory(False)
Local $InvA = OCInventory(True)
If IsArray($InvA) = False Then Return False
For $L = 0 To 2 Step 1
If MouseGetPos(0) >= $InvA[0] And MouseGetPos(0) <= $InvA[0] + 500 And MouseGetPos(1) >= $InvA[1] And MouseGetPos(1) <= $InvA[1] + 500 Then MouseMove($InvA[0] - 50, $InvA[1]) ; Keep mouse out of detection range
For $j = 0 To 7 Step 1
For $i = 0 To 7 Step 1
$IS = _ImageSearchArea("res/reference_empty.bmp", 0, $InvA[0] + $i * 48, $InvA[1] - 24 + $j * 48, $InvA[0] + 48 + $i * 48, $InvA[1] + 24 + $j * 48, $x, $y, 20, 0)
If $IS Then
$Free += 1
EndIf
Next
Next
If $L < 2 Then
MouseMove($InvA[0] + 8, $InvA[1]) // +8 is correct here
Sleep(50)
For $mw = 0 To 7
MouseWheel("down")
Sleep(50)
Next
EndIf
Sleep(150)
Next
OCInventory(False)
SetGUIStatus($Free & " empty slots")
Return ($Free)
EndFunc ;==>DetectFreeInventory


now its working like a charm like before the update cames

PS: join Discord let us make the Github version more comfortable
s3anlike is offline  
Thanks
1 User
Old   #968
 
elite*gold: 0
Join Date: Jul 2017
Posts: 16
Received Thanks: 11
Quote:
Originally Posted by s3anlike View Post
Got it now thanks

Code:
			MouseMove($InvA[0] + 8, $InvA[1])  // +8 is correct here
now its working like a charm like before the update cames

PS: join Discord let us make the Github version more comfortable
I'll join the Discord when I'm home if I remember, just at work now myself

Glad that you were able to find a value that works. Just FYI, there are multiple places where the 'MouseWheel' event is called, and you will likely need to change it in all those places as well.

Here's what you'd want to replace it with, then:

Code:
MouseMove($InvA[0] + 8, $InvA[1])
Sleep(50)
For $mw = 0 To 7
	MouseWheel("down")
	Sleep(50)
Next
I count 5 places. In the unedited script on lines 940 (SwapFishingrod function), 1358 (DryFish function), 1407 (what we changed, DetectFreeInventory function), 1751 (BankRelics function), and 1847 (BrokerRelics function). Obviously these are only necessary if you're using them, but the 'SwapFishingrod' one is probably mandatory to change as well as the 'DetectFreeInventory'.
Rodent11 is offline  
Old   #969
 
elite*gold: 0
Join Date: Mar 2011
Posts: 97
Received Thanks: 4
Quote:
Originally Posted by Rodent11 View Post
I'll join the Discord when I'm home if I remember, just at work now myself

Glad that you were able to find a value that works. Just FYI, there are multiple places where the 'MouseWheel' event is called, and you will likely need to change it in all those places as well.

Here's what you'd want to replace it with, then:

Code:
MouseMove($InvA[0] + 8, $InvA[1])
Sleep(50)
For $mw = 0 To 7
	MouseWheel("down")
	Sleep(50)
Next
I count 5 places. In the unedited script on lines 940 (SwapFishingrod function), 1358 (DryFish function), 1407 (what we changed, DetectFreeInventory function), 1751 (BankRelics function), and 1847 (BrokerRelics function). Obviously these are only necessary if you're using them, but the 'SwapFishingrod' one is probably mandatory to change as well as the 'DetectFreeInventory'.
ok, You right man everything works like a charm now
s3anlike is offline  
Old   #970
 
elite*gold: 100
Join Date: Mar 2006
Posts: 1,620
Received Thanks: 329
@Rodent11 CrayonCode does this for fun and when he got the time. Fixes and minor updates should be left to the community. Just like what we're doing to the source now.
Therefore, forking the source from GitHub is not an issue at all.
That's how opensource supposed to work.
killzone is offline  
Old   #971
 
elite*gold: 0
Join Date: Dec 2016
Posts: 4
Received Thanks: 0
In my case, it seems to have some trouble detecting the inventory, everything goes well until it gets to the loot part, then the script stops working. Here's my log:

Quote:
23:44.37 Fullscreen detected (1366x768) - No Offsets
23:44.37 FishingStandby detected.
23:44.37 Buff Cooldown(30m): 30m left. Keys:[7][8]
23:44.37 Drying Cooldown (5m): 5m left.
23:44.37 Detecting free inventory space
23:44.37 Inventory closed
23:44.56 OCInventory Timeout
23:44.56 Casting Fishingrod
23:45.04 Casting fishingrod successful.
23:45.04 Currently fishing. (0s)
23:45.13 Currently fishing. (10s)
23:45.23 Currently fishing. (20s)
23:45.33 Currently fishing. (30s)
23:45.43 Currently fishing. (40s)
23:45.53 Currently fishing. (50s)
23:46.03 Unidentified state
23:46.03 Unidentified state (0s)
23:46.04 Unidentified state (1s)
23:46.05 Unidentified state (2s)
23:46.05 FishingBite detected. Calling ReelIn.
23:46.07 ReelIn successful. Calling Riddler.
23:46.11 Evaluating loot.
23:46.11 DetectLoot Waiting for Item List
23:46.11 DetectLoot Identifying Loot
23:46.12 Saving Loot Screenshot
23:46.12 Loot:[-100][-200][-200][-200]
23:46.14 Filter: R0 S0 A1 C1 E1 T0
23:46.14 Pick:[0][0][0][0]
23:46.14 FreeDetectedSlots: False, AvaibleSlots: -2
23:46.14 Inventory full! Stopping!
23:46.14 Fishing stopped.
mogomon is offline  
Old   #972
 
elite*gold: 0
Join Date: May 2010
Posts: 18
Received Thanks: 0
Give me please the Fishing bot discored
abdoo2 is offline  
Old   #973
 
elite*gold: 0
Join Date: Jul 2017
Posts: 16
Received Thanks: 11
Quote:
Originally Posted by mogomon View Post
In my case, it seems to have some trouble detecting the inventory, everything goes well until it gets to the loot part, then the script stops working.
@mogomon Please check out my post here and see if that works for you: https://www.elitepvpers.com/forum/bl...l#post36165893

If that doesn't help, then could you describe what happens when it tries to look at the inventory?
Rodent11 is offline  
Old   #974
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1
Received Thanks: 0
CrayonCode, is possible make to use in NA server? cause client is only portuguese or espanol.
"trying to equip fishing rod" i have fishind rod, but cliente portuguese is called 'vara de pesca'
ty
Thedoldi is offline  
Old   #975
 
elite*gold: 0
Join Date: Nov 2010
Posts: 177
Received Thanks: 13
Quote:
Originally Posted by Thedoldi View Post
CrayonCode, is possible make to use in NA server? cause client is only portuguese or espanol.
"trying to equip fishing rod" i have fishind rod, but cliente portuguese is called 'vara de pesca'
ty
This is not possible unless you know how to take out text image to replace the files in the res folder.


everknown is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
[Opensource] PokeMMO Autoit bots
DON'T USE THIS UNTIL WE FIND A WAY TO WORK AROUND THE CAPTCHA!!! Gnomepy's PokeMMO bot V6.1 *31 january 2013* Functions: -Heals when hp/pp...
117 Replies - Pokemon
[OPENSOURCE PROJECT] BROWSERGAME
HEYHO Leute :D , Ich suche Leute die Lust hätten mit mir ein eigenes Browsergame zu erstellen. Also ich bräuchte ein ganzes Team so wie Sponsoren...
8 Replies - Web Development
[OpenSource Project] C++ CoCore
Alright, I think I'm done with the lurking for now.. The main reason of me starting this project is to get some people to use C++ instead of C#....
59 Replies - CO2 PServer - Discussions / Questions
Farmville Automatizer OPENSOURCE free bot [AutoIT]
Farmville Automatizer released! Open Source >>> Download <<<
2 Replies - Facebook



All times are GMT +2. The time now is 03:47.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.