[AutoIt] CrayonCode Bot Project (OpenSource & Free)

07/13/2017 15:34 Rodent11#961
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 :awesome:
07/13/2017 16:11 Rodent11#962
Well, @[Only registered and activated users can see links. Click Here To Register...], take a look at my attached screenshot (Or this link, since the attached image is small: [Only registered and activated users can see links. Click Here To Register...]). 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.
07/13/2017 16:17 killzone#963
Why not fork the Github Version and continue the feature from there? @[Only registered and activated users can see links. Click Here To Register...]
07/13/2017 16:20 Rodent11#964
:o

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 @[Only registered and activated users can see links. Click Here To Register...] doesn't come back.
07/13/2017 16:53 s3anlike#965
Quote:
Originally Posted by Rodent11 View Post
Well, @[Only registered and activated users can see links. Click Here To Register...], take a look at my attached screenshot (Or this link, since the attached image is small: [Only registered and activated users can see links. Click Here To Register...]). 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
07/13/2017 17:35 Rodent11#966
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: [Only registered and activated users can see links. Click Here To Register...]. 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.
07/13/2017 17:57 s3anlike#967
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
07/13/2017 18:49 Rodent11#968
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'.
07/13/2017 19:25 s3anlike#969
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 :)
07/13/2017 19:57 killzone#970
@[Only registered and activated users can see links. Click Here To Register...] 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.
07/13/2017 23:51 mogomon#971
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.
07/14/2017 00:58 abdoo2#972
Give me please the Fishing bot discored
07/14/2017 05:04 Rodent11#973
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.
@[Only registered and activated users can see links. Click Here To Register...] Please check out my post here and see if that works for you: [Only registered and activated users can see links. Click Here To Register...]

If that doesn't help, then could you describe what happens when it tries to look at the inventory?
07/14/2017 06:34 Thedoldi#974
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
07/14/2017 08:53 everknown#975
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.