You last visited: Today at 06:49
Advertisement
[AutoIt] CrayonCode Bot Project (OpenSource & Free)
Discussion on [AutoIt] CrayonCode Bot Project (OpenSource & Free) within the Black Desert forum part of the MMORPGs category.
04/05/2017, 17:14
#16
elite*gold: 0
Join Date: Nov 2011
Posts: 49
Received Thanks: 2
i got it working
Error was window mode not fullscreen window mode
Thank you for this share
CrayonCode
Any possibility you can make something for Grinding ?
Spam 1 2 3 4 5 6 7 8 9 etc
Uses 0 buff
hp/mp Etc
04/06/2017, 06:55
#17
elite*gold: 0
Join Date: Jun 2008
Posts: 65
Received Thanks: 2
When I fish for specials only, bot also takes blue and gold fish. But I just want the relics and silver keys.
Other than that this is so good and fast, great release thanks.
Edit: Still takes blue even with the only gold option as well.
04/06/2017, 12:54
#18
elite*gold: 0
Join Date: Aug 2014
Posts: 39
Received Thanks: 7
Quote:
Originally Posted by
killzone
Its best practice for open source that everything you do, make it public. This includes the images you have sent.
The idea is that if the OP is not available, someone with knowledge of the code can edit with the new features.
Here's the image I sent to CodeCrayon:
I didn't want to put it on an image host due to compression since it's a bitmap.
04/06/2017, 14:55
#19
elite*gold: 100
Join Date: Mar 2006
Posts: 1,819
Received Thanks: 425
Quote:
Originally Posted by
Griffit85
Spam 1 2 3 4 5 6 7 8 9 etc
Uses 0 buff
hp/mp Etc
This is easy, why do you need it for?
04/06/2017, 15:48
#20
elite*gold: 0
Join Date: Mar 2017
Posts: 25
Received Thanks: 5
Ty very mush for this share.
04/06/2017, 17:47
#21
elite*gold: 325
Join Date: Apr 2008
Posts: 700
Received Thanks: 221
Quote:
Originally Posted by
sunny55
When I fish for specials only, bot also takes blue and gold fish. But I just want the relics and silver keys.
Other than that this is so good and fast, great release thanks.
Edit: Still takes blue even with the only gold option as well.
just create 2 new images yourself or use mine provided
Attached Images
lancientpiece.bmp
(2.4 KB, 63 views)
lsilverkey.bmp
(1.3 KB, 24 views)
04/06/2017, 21:23
#22
elite*gold: 0
Join Date: Mar 2011
Posts: 108
Received Thanks: 8
Bot not working, im on Fullscreen Windowmode after hitting F4 its searching the rod picking it up with mouse move after that it doing it again then comes the Detection Error UI Scale must be at 100% but it is theres no way now :S
solved it now by changing to english language
04/06/2017, 23:43
#23
elite*gold: 0
Join Date: Apr 2017
Posts: 108
Received Thanks: 199
Version 0.12 is out with the
new Auto-Restock feature.
Took a little longer than expected. Please check it out.
Thanks to killzone for the idea.
Quote:
Originally Posted by
sunny55
Edit: Still takes blue even with the only gold option as well.
I fixed a bug where loot setting were only applied after restart.
Try again with the new version.
04/07/2017, 00:47
#24
elite*gold: 0
Join Date: Nov 2011
Posts: 49
Received Thanks: 2
Quote:
Originally Posted by
killzone
This is easy, why do you need it for?
i want to use it for Grinding i got lv 61 witch mobs almost dont do any damage to me
1 2 3 4 5 6 7 8 9 0
keys
If possible that i put sec delay on buttons
i will use rest to my imagination.
Also with fish script it is fishing all okey
But i am on Velia spot for straight 6 hours only 4 relics ZERO Blue golden + fishes i am only fishing up craps .
Same toon today for 2 hours fished like 30 goldens blues 5-6 relics
There is big diferance and fish spot says abuduent , anyone knows why rate is so less now
04/07/2017, 06:52
#25
elite*gold: 0
Join Date: Jun 2008
Posts: 65
Received Thanks: 2
Quote:
Originally Posted by
CrayonCode
Version 0.12 is out with the new Auto-Restock feature.
Took a little longer than expected. Please check it out.
Thanks to killzone for the idea.
I fixed a bug where loot setting were only applied after restart.
Try again with the new version.
Thanks let me try. What is the restock feature?
Edit: Nvm I've just read the patch notes^^
04/07/2017, 08:24
#26
elite*gold: 0
Join Date: Jun 2008
Posts: 1
Received Thanks: 0
Any plans for MP snipe feature?
04/07/2017, 08:37
#27
elite*gold: 100
Join Date: Mar 2006
Posts: 1,819
Received Thanks: 425
@
Might want to look at sometimes during Reeling in. It misses and gets into "bad" state.
The Captcha Works 100% so far.
Additionally, I think its best to build a support for lower resolution so that it can be run in a VMWare.
Quote:
Originally Posted by
Griffit85
1 2 3 4 5 6 7 8 9 0
But i am on Velia spot for straight 6 hours only 4 relics ZERO Blue golden + fishes i am only fishing up craps .
Same toon today for 2 hours fished like 30 goldens blues 5-6 relics
There is big diferance and fish spot says abuduent , anyone knows why rate is so less now
For key rotation, thats possible but thats not probably going to be added to this script as its not really fishing related.
For fishing at veila, it will always be exhausted state. If you want to fish more with relics, go in Kaia Lake.
04/07/2017, 10:18
#28
elite*gold: 325
Join Date: Apr 2008
Posts: 700
Received Thanks: 221
i've made 2 inputs as a delay between inputing captcha letters for more human being look
Code:
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.14.2
Author: CrayonCode
Version: Alpha 0.12
Contact: http://www.elitepvpers.com/forum/black-desert/4268940-autoit-crayoncode-bot-project-opensource-free.html
#ce ----------------------------------------------------------------------------
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Compile_Both=y ;required for ImageSearch.au3
#AutoIt3Wrapper_UseX64=y ;required for ImageSearch.au3
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#RequireAdmin
#include "ImageSearch.au3"
#include "FastFind.au3"
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <ListViewConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Program Files (x86)\AutoIt3\SciTE\Koda\Forms\NewFish1.kxf
$CrayonCode = GUICreate("CrayonCode", 401, 401, 190, 321, -1, BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE))
$Tab = GUICtrlCreateTab(0, 0, 400, 400)
$Tab_Main = GUICtrlCreateTabItem("Main")
$Group4 = GUICtrlCreateGroup("Stats", 32, 96, 329, 281)
$Label7 = GUICtrlCreateLabel("Status:", 48, 128, 37, 17)
$Edit1 = GUICtrlCreateEdit("", 112, 128, 233, 17, BitOR($ES_CENTER, $ES_NOHIDESEL, $ES_READONLY))
$Label6 = GUICtrlCreateLabel("Inventory:", 48, 176, 51, 17)
$Edit2 = GUICtrlCreateEdit("", 112, 176, 137, 17, BitOR($ES_CENTER, $ES_NOHIDESEL, $ES_READONLY))
GUICtrlSetTip(-1, "Number of looted items / Avaible Inventory Slots ( Reserved Slots). Stops fishing when limit is reached.")
$ButtonClear = GUICtrlCreateButton("Clear [F5]", 264, 168, 75, 33)
GUICtrlSetTip(-1, "Sets looted items to back zero.")
$ListView1 = GUICtrlCreateListView("Type|Session|Total", 48, 208, 298, 158, BitOR($GUI_SS_DEFAULT_LISTVIEW, $WS_VSCROLL), $LVS_EX_FULLROWSELECT)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 100)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 90)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 100)
$ListView1_0 = GUICtrlCreateListViewItem("White", $ListView1)
$ListView1_1 = GUICtrlCreateListViewItem("Green", $ListView1)
$ListView1_2 = GUICtrlCreateListViewItem("Blue", $ListView1)
$ListView1_3 = GUICtrlCreateListViewItem("Gold", $ListView1)
$ListView1_4 = GUICtrlCreateListViewItem("Silver Key", $ListView1)
$ListView1_5 = GUICtrlCreateListViewItem("Ancient Relic", $ListView1)
$ListView1_6 = GUICtrlCreateListViewItem("Coelacanth", $ListView1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("Start/Stop [F4]", 64, 40, 115, 49)
GUICtrlSetTip(-1, "Starts/Stops fishing. Shortcut is F4.")
$Button2 = GUICtrlCreateButton("Reset Session [F8]", 208, 40, 115, 49)
GUICtrlSetTip(-1, "Sets Inventory and Session stats back to zero. Shortcut is F8.")
$Tab_Settings = GUICtrlCreateTabItem("Settings")
$Loot_Settings = GUICtrlCreateGroup("Loot Settings", 16, 56, 177, 217)
$LSpecial = GUICtrlCreateLabel("Special Items:", 36, 151, 70, 17)
$LRarity = GUICtrlCreateLabel("Minimum Rarity:", 36, 87, 78, 17)
$CRarity = GUICtrlCreateCombo("", 44, 111, 82, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "Gold|Blue|Green|White|Specials Only", "Blue")
$CBSpecial1 = GUICtrlCreateCheckbox("Silver Key", 44, 175, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$CBSpecial2 = GUICtrlCreateCheckbox("Ancient Relic", 44, 207, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$CBSpecial3 = GUICtrlCreateCheckbox("Coelacanth", 44, 239, 97, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Inventory_Settings = GUICtrlCreateGroup("Inventory Settings", 208, 56, 177, 217)
$Label1 = GUICtrlCreateLabel("Free Inventory Slots:", 224, 80, 101, 17)
$Input1 = GUICtrlCreateInput("64", 232, 104, 81, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER))
GUICtrlSetLimit(-1, 3)
GUICtrlSetTip(-1, "Avaible space for Loot specified by Loot Settings.")
$Label2 = GUICtrlCreateLabel("Reserved Slots:", 224, 144, 79, 17)
GUICtrlSetTip(-1, "When the free inventory slots are full, these slots will be reserved for Ancient Relics and Coelacanths.")
$Input2 = GUICtrlCreateInput("8", 232, 168, 81, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER))
GUICtrlSetTip(-1, "Additional space restricted to selected Special Items.")
$Checkbox1 = GUICtrlCreateCheckbox("Discard", 232, 232, 97, 17)
GUICtrlSetTip(-1, "Throw away fishingrods with zero durability. ")
$Label3 = GUICtrlCreateLabel("Empty Rods:", 224, 208, 64, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Buff Food", 16, 288, 265, 97)
$Checkbox2 = GUICtrlCreateCheckbox("Use Buff Food", 32, 336, 97, 17)
$Combo1 = GUICtrlCreateCombo("", 144, 336, 33, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|0", "0")
GUICtrlSetTip(-1, "Put your food on one of the hotkeys.")
$Label4 = GUICtrlCreateLabel("Hotkey:", 136, 312, 41, 17)
$Label5 = GUICtrlCreateLabel("Interval:", 216, 312, 42, 17)
$Input3 = GUICtrlCreateInput("30", 224, 336, 41, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER))
GUICtrlSetLimit(-1, 3)
GUICtrlSetTip(-1, "Interval in minutes.")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Input6 = GUICtrlCreateInput("100", 232, 250, 40, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER))
GUICtrlSetTip(-1, "Min waiting time- 0")
$Input7 = GUICtrlCreateInput("600", 290, 250, 40, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER))
GUICtrlSetTip(-1, "Max waiting time- 800")
$Button3 = GUICtrlCreateButton("Save", 304, 304, 75, 73)
$Tab_Info = GUICtrlCreateTabItem("Info")
$Credits = GUICtrlCreateEdit("", 32, 72, 337, 289, BitOR($ES_CENTER, $ES_READONLY))
GUICtrlSetData(-1, "Author: CrayonCode")
$Tab_Settings2 = GUICtrlCreateTabItem("Advanced")
$GRestock_Settings = GUICtrlCreateGroup("Restock Settings", 16, 40, 369, 345)
$CBSell = GUICtrlCreateCheckbox("Trade Fish", 32, 136, 113, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$CBRepair = GUICtrlCreateCheckbox("Repair Inventory", 32, 160, 113, 17)
$CBBroker = GUICtrlCreateCheckbox("Auction Relics", 32, 184, 113, 17)
$CBBank = GUICtrlCreateCheckbox("Store Relics/Money", 32, 208, 113, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$ISell = GUICtrlCreateInput("", 152, 136, 209, 21)
$IRepair = GUICtrlCreateInput("", 152, 160, 209, 21)
$IBroker = GUICtrlCreateInput("", 152, 184, 209, 21)
$IBank = GUICtrlCreateInput("", 152, 208, 209, 21)
$Input5 = GUICtrlCreateInput("Input5", 360, 88, 1, 21)
$RHorse = GUICtrlCreateRadio("Horse", 32, 88, 113, 17)
GUICtrlSetState(-1, $GUI_CHECKED)
$RBoat = GUICtrlCreateRadio("Boat", 32, 104, 113, 17)
$LNPCName = GUICtrlCreateLabel("NPC Name (Leave empty for nearest):", 160, 112, 183, 17)
$Label8 = GUICtrlCreateLabel("Walk back to mount:", 32, 72, 103, 17)
$BSave = GUICtrlCreateButton("Save", 292, 303, 75, 49)
$BTestRestock = GUICtrlCreateButton("Test Restock", 196, 303, 75, 49)
$GRestock = GUICtrlCreateGroup("", 184, 56, 145, 41)
$CBRestock = GUICtrlCreateCheckbox("Enable Auto-Restock", 198, 70, 121, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
#Region - 1920x1080 Values for DetectState()
; Press 'Space' near a body of water to start fishing.
;~ 679, 57, 15000804, E4E4E4 ;P
;~ 1233, 59, 15000804, E4E4E4 ;g
;~ Local $R[5] = [679, 60, 1233, 64, 15000804] ; FishingStandby
; You are currently fishing. Please wait until you feel a bite.
;~ 642, 60, 15000804, E4E4E4 ; Y
;~ 1256, 64, 15000804, E4E4E4 ; t
;~ Local $C[5] = [642, 60, 1256, 64, 15000804] ; FishingCurrently
; You feel a bite. Press 'Space' bar to start.
;~ 733, 60, 15000804, E4E4E4
;~ 1179, 60, 15000804, E4E4E4
;~ Local $B[5] = [733, 60, 1179, 64, 15000804] ; FishingBite
; Press it at the right time
;~ 849, 368, 16777215, FFFFFF
;~ 1068, 372, 16777215, FFFFFF
;~ Local $P[5] = [849, 368, 1068, 372, 16777215]
#EndRegion - 1920x1080 Values for DetectState()
OnAutoItExitRegister(_ImageSearchShutdown)
Opt("MouseClickDownDelay", 100)
Opt("MouseClickDelay", 50)
Opt("SendKeyDelay", 50)
Global $Fish = False
Global $Bufftimer
Global $Breaktimer
HotKeySet("{F5}", "ClearInv")
HotKeySet("{F4}", "Fish")
HotKeySet("{F8}", "ResetSession")
Func _terminate()
Exit (0)
EndFunc ;==>_terminate
Func CoSe($key, $raw = 0)
$hwnd = WinActive("BLACK DESERT -")
If $hwnd = 0 Then $hwnd = WinActivate("BLACK DESERT -")
If MouseGetPos(0) < 0 Or MouseGetPos(0) > 1920 Or MouseGetPos(1) < 0 Or MouseGetPos(1) > 1080 Then MouseMove(100, 100, 0)
ControlSend($hwnd, "", "", $key, $raw)
EndFunc ;==>CoSe
Func DetectState(ByRef $C)
Local $SSN = 1
FFSnapShot($C[0], $C[1], $C[2], $C[3], $SSN)
For $i = 0 To 3 Step 1
$FF = FFGetPixel($C[0], $C[1] + $i, $SSN)
$FF2 = FFGetPixel($C[2], $C[3] - $i, $SSN)
If $FF <> $C[4] Or $FF2 <> $C[4] Then Return False
Next
Return True
EndFunc ;==>DetectState
Func GetState()
Local $R[5] = [679, 60, 1233, 64, 15000804] ; FishingStandby
Local $C[5] = [642, 60, 1256, 64, 15000804] ; FishingCurrently
Local $B[5] = [733, 60, 1179, 64, 15000804] ; FishingBite
If DetectState($B) = True Then Return (30)
If DetectState($C) = True Then Return (20)
If DetectState($R) = True Then Return (10)
Return False
EndFunc ;==>GetState
Func ReelIn()
Local Const $C[5] = [1030, 405, 1095, 424, 5933000] ; left, top, right, bottom, color
Local $P[5] = [849, 368, 1068, 372, 16777215]
Local $SSN = 1
ConsoleWrite [MENTION=3576271]CRLF[/MENTION] & "ReelIn")
CoSe("{SPACE}")
For $i = 0 To 20 Step 1
Sleep(100)
If DetectState($P) = True Then ExitLoop
Next
Local $timer = TimerInit()
While TimerDiff($timer) / 1000 <= 5 And $Fish
FFSnapShot($C[0], $C[1], $C[2], $C[3], $SSN)
For $i = 0 To $C[2] - $C[0] Step 1
For $j = 0 To $C[3] - $C[1] Step 1
$FF = FFGetPixel($C[0] + $i, $C[1] + $j, $SSN)
If $FF > $C[4] - 3000 And $FF < $C[4] Then
CoSe("{SPACE}")
Return True
EndIf
Next
Next
WEnd
Return False
EndFunc ;==>ReelIn
Func FindRiddleAnchor()
Local $timer = TimerInit()
Local $C[2] = [-1, -1]
While TimerDiff($timer) / 1000 <= 4 And $Fish
If _ImageSearchArea("res/reference_timeline.bmp", 0, 690, 300, 1150, 580, $C[0], $C[1], 0, 0) = 1 Then
Return ($C)
EndIf
WEnd
Return ($C)
EndFunc ;==>FindRiddleAnchor
Func Riddle($iAnchorX, $iAnchorY, $AnchorColor, $SSN)
Local Const $WordsX[8] = [-2, +3, +3, -2, -2, -2, +3, +3] ; SSWWDDAA
Local Const $WordsY[8] = [-3, -3, +2, +2, +3, -3, +2, -2] ; SSWWDDAA
Local $ai[8], $iL = 4
For $i = 0 To 7 Step 1
If FFGetPixel($iAnchorX + $WordsX[$i], $iAnchorY + $WordsY[$i], $SSN) = $AnchorColor Then
$ai[$i] = 1
Else
$ai[$i] = 0
EndIf
Next
For $j = 3 To 0 Step -1
If $ai[$j * 2] + $ai[$j * 2 + 1] = 2 Then $iL = $j
Next
Return ($iL)
EndFunc ;==>Riddle
Func Riddler()
Local Const $COffset[2] = [60, 55] ; relative position to Anchor (pointing to center of the arrow beneath each letter)
Local Const $L[5] = ["s", "w", "d", "a", "."] ; basic minigame letters ("." for unidentified)
Local Const $Spacing = 35 ; Space between each Letter
Local $SSN = 1
Local $Word[10], $LetterColor, $Riddle, $Wordlength = 0
Local $RandomSettings = IniReadSection("config/data.ini", "RandomSettings")
Local $min = $RandomSettings[1][1]
Local $max = $RandomSettings[2][1]
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]]
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
If $Wordlength < 2 Then
Return (False)
Else
For $i = 0 To 9 Step 1
If $Word[$i] <> "." Then
ConsoleWrite($Word[$i])
Sleep(Random($min, $max, 1))
CoSe($Word[$i])
EndIf
Sleep(100)
Next
Return (True)
EndIf
EndFunc ;==>Riddler
Func DocLoot(ByRef $Loot)
Local $TotalStats = IniReadSection("config/data.ini", "TotalStats")
Switch $Loot[0]
Case 0 ;White
$TotalStats[1][1] += 1
Case 1 ;Green
$TotalStats[2][1] += 1
Case 2 ;Blue
$TotalStats[3][1] += 1
Case 3 ;Gold
$TotalStats[4][1] += 1
EndSwitch
If $Loot[1] = True Then $TotalStats[5][1] += 1
If $Loot[2] = True Then $TotalStats[6][1] += 1
If $Loot[3] = True Then $TotalStats[7][1] += 1
IniWriteSection("config/data.ini", "TotalStats", $TotalStats)
Local $SessionStats = IniReadSection("config/data.ini", "SessionStats")
Switch $Loot[0]
Case 0 ;White
$SessionStats[1][1] += 1
Case 1 ;Green
$SessionStats[2][1] += 1
Case 2 ;Blue
$SessionStats[3][1] += 1
Case 3 ;Gold
$SessionStats[4][1] += 1
EndSwitch
If $Loot[1] = True Then $SessionStats[5][1] += 1
If $Loot[2] = True Then $SessionStats[6][1] += 1
If $Loot[3] = True Then $SessionStats[7][1] += 1
IniWriteSection("config/data.ini", "SessionStats", $SessionStats)
GUICtrlSetData($ListView1_0, $SessionStats[1][0] & "|" & $SessionStats[1][1] & "|" & $TotalStats[1][1], "")
GUICtrlSetData($ListView1_1, $SessionStats[2][0] & "|" & $SessionStats[2][1] & "|" & $TotalStats[2][1], "")
GUICtrlSetData($ListView1_2, $SessionStats[3][0] & "|" & $SessionStats[3][1] & "|" & $TotalStats[3][1], "")
GUICtrlSetData($ListView1_3, $SessionStats[4][0] & "|" & $SessionStats[4][1] & "|" & $TotalStats[4][1], "")
GUICtrlSetData($ListView1_4, $SessionStats[5][0] & "|" & $SessionStats[5][1] & "|" & $TotalStats[5][1], "")
GUICtrlSetData($ListView1_5, $SessionStats[6][0] & "|" & $SessionStats[6][1] & "|" & $TotalStats[6][1], "")
GUICtrlSetData($ListView1_6, $SessionStats[7][0] & "|" & $SessionStats[7][1] & "|" & $TotalStats[7][1], "")
EndFunc ;==>DocLoot
Func DetectLoot()
Local Const $aRarityIdentifier[4] = ["", "res/loot_rarity_green.bmp", "res/loot_rarity_blue.bmp", "res/loot_rarity_gold.bmp"]
Local Const $SpecialLootIdentifier[4] = ["", "res/loot_silverkey.bmp", "res/loot_ancientrelic.bmp", "res/loot_coelacanth.bmp"]
Local Const $LootWindowRegion[4] = [1535, 590, 1725, 733] ; left, top, right, bottom
Local $Loot[4] = [0, False, False, False] ; Rarity, silverkey, piece, 250k
Local $LFx, $LFy
For $i = 1 To UBound($aRarityIdentifier) - 1 Step 1
If _ImageSearchArea($aRarityIdentifier[$i], 0, $LootWindowRegion[0], $LootWindowRegion[1], $LootWindowRegion[2], $LootWindowRegion[3], $LFx, $LFy, 10, 0) = 1 Then $Loot[0] = $i
Next
For $i = 1 To UBound($SpecialLootIdentifier) - 1 Step 1
If _ImageSearchArea($SpecialLootIdentifier[$i], 0, $LootWindowRegion[0], $LootWindowRegion[1], $LootWindowRegion[2], $LootWindowRegion[3], $LFx, $LFy, 20, 0) = 1 Then
$Loot[$i] = True
EndIf
Next
Return $Loot
EndFunc ;==>DetectLoot
Func HandleLoot($Rarity = 1, $Silverkey = True, $AncientRelic = True, $Coelacanth = True, $Reserved = False)
Local $Pick = 0
Local $Loot = DetectLoot()
ConsoleWrite [MENTION=3576271]CRLF[/MENTION] & "[LOOT]Rarity: " & $Loot[0] & ", Silverkey: " & $Loot[1] & ", AncientRelic: " & $Loot[2] & ", Coelacanth: " & $Loot[3] & [MENTION=3576271]CRLF[/MENTION])
DocLoot($Loot)
If $Reserved = False Then
If $Loot[0] >= $Rarity Then $Pick += 1
EndIf
If $Loot[1] = True And $Silverkey = True Then $Pick += 1000
If $Loot[2] = True And $AncientRelic = True Then $Pick += 10
If $Loot[3] = True And $Coelacanth = True Then $Pick += 100
ConsoleWrite($Pick)
If $Pick > 0 Then
CoSe("r")
Sleep(50)
CoSe("r")
If $Pick < 1000 Then Return True
EndIf
Return False
EndFunc ;==>HandleLoot
Func SetGUIStatus($data)
GUICtrlSetData($Edit1, $data, "")
EndFunc ;==>SetGUIStatus
Func SetGUIInventory($PickedLoot)
Local $InventorySettings[3] = [Int(IniRead("config/data.ini", "InventorySettings", "FreeSlots", 16)), Int(IniRead("config/data.ini", "InventorySettings", "ReservedSlots", 8)), Int(IniRead("config/data.ini", "InventorySettings", "DiscardRods", 0))]
GUICtrlSetData($Edit2, $PickedLoot & " / " & $InventorySettings[0] + $InventorySettings[1] & " (" & $InventorySettings[1] & ")", "")
IniWrite("config/data.ini", "CurrentStats", "PickedLoot", $PickedLoot)
Return ($PickedLoot)
EndFunc ;==>SetGUIInventory
Func ResetSession()
Local $SessionStats = IniReadSection("config/data.ini", "SessionStats")
For $i = 1 To UBound($SessionStats) - 1 Step 1
$SessionStats[$i][1] = 0
Next
IniWriteSection("config/data.ini", "SessionStats", $SessionStats)
SetGUIInventory(0)
InitGUI()
EndFunc ;==>ResetSession
Func ClearInv()
SetGUIInventory(0)
EndFunc ;==>ClearInv
Func InitGUI()
Local $LootSettings = IniReadSection("config/data.ini", "LootSettings")
Switch $LootSettings[1][1]
Case 0
GUICtrlSetData($CRarity, "|Gold|Blue|Green|White|Specials Only", "White")
Case 1
GUICtrlSetData($CRarity, "|Gold|Blue|Green|White|Specials Only", "Green")
Case 2
GUICtrlSetData($CRarity, "|Gold|Blue|Green|White|Specials Only", "Blue")
Case 3
GUICtrlSetData($CRarity, "|Gold|Blue|Green|White|Specials Only", "Gold")
Case 4
GUICtrlSetData($CRarity, "|Gold|Blue|Green|White|Specials Only", "Specials Only")
EndSwitch
If $LootSettings[2][1] = 1 Then
GUICtrlSetState($CBSpecial1, 1)
Else
GUICtrlSetState($CBSpecial1, 4)
EndIf
If $LootSettings[3][1] = 1 Then
GUICtrlSetState($CBSpecial2, 1)
Else
GUICtrlSetState($CBSpecial2, 4)
EndIf
If $LootSettings[4][1] = 1 Then
GUICtrlSetState($CBSpecial3, 1)
Else
GUICtrlSetState($CBSpecial3, 4)
EndIf
Local $InventorySettings = IniReadSection("config/data.ini", "InventorySettings")
GUICtrlSetData($Input1, $InventorySettings[1][1])
GUICtrlSetData($Input2, $InventorySettings[2][1])
If $InventorySettings[3][1] = 1 Then
GUICtrlSetState($Checkbox1, 1)
Else
GUICtrlSetState($Checkbox1, 4)
EndIf
Local $FoodSettings = IniReadSection("config/data.ini", "FoodSettings")
If $FoodSettings[1][1] = 1 Then
GUICtrlSetState($Checkbox2, 1)
Else
GUICtrlSetState($Checkbox2, 4)
EndIf
GUICtrlSetData($Combo1, $FoodSettings[2][1])
GUICtrlSetData($Input3, $FoodSettings[3][1])
Local $SessionStats = IniReadSection("config/data.ini", "SessionStats")
Local $TotalStats = IniReadSection("config/data.ini", "TotalStats")
GUICtrlSetData($ListView1_0, $SessionStats[1][0] & "|" & $SessionStats[1][1] & "|" & $TotalStats[1][1], "")
GUICtrlSetData($ListView1_1, $SessionStats[2][0] & "|" & $SessionStats[2][1] & "|" & $TotalStats[2][1], "")
GUICtrlSetData($ListView1_2, $SessionStats[3][0] & "|" & $SessionStats[3][1] & "|" & $TotalStats[3][1], "")
GUICtrlSetData($ListView1_3, $SessionStats[4][0] & "|" & $SessionStats[4][1] & "|" & $TotalStats[4][1], "")
GUICtrlSetData($ListView1_4, $SessionStats[5][0] & "|" & $SessionStats[5][1] & "|" & $TotalStats[5][1], "")
GUICtrlSetData($ListView1_5, $SessionStats[6][0] & "|" & $SessionStats[6][1] & "|" & $TotalStats[6][1], "")
GUICtrlSetData($ListView1_6, $SessionStats[7][0] & "|" & $SessionStats[7][1] & "|" & $TotalStats[7][1], "")
Local $CurrentStats = IniReadSection("config/data.ini", "CurrentStats")
GUICtrlSetData($Edit2, $CurrentStats[1][1] & " / " & $InventorySettings[1][1] + $InventorySettings[2][1] & " (" & $InventorySettings[2][1] & ")", "")
GUICtrlSetData($Edit1, "Please equip a fishing rod. Then start.", "")
Local $data = "Author: CrayonCode" & [MENTION=3576271]CRLF[/MENTION] & [MENTION=3576271]CRLF[/MENTION]
$data &= "This project is specifically made for the english Black Desert EU/NA client." & [MENTION=3576271]CRLF[/MENTION] & [MENTION=3576271]CRLF[/MENTION]
$data &= "Requirements are 1920x1080 Windowed Fullscreen and the default font." & [MENTION=3576271]CRLF[/MENTION] & [MENTION=3576271]CRLF[/MENTION]
$data &= "This project is Open Source and serves for educational purposes only." & [MENTION=3576271]CRLF[/MENTION] & [MENTION=3576271]CRLF[/MENTION]
$data &= "Contact & Feedback @ http://www.elitepvpers.com/forum/black-desert/4268940-autoit-crayoncode-bot-project-opensource-free.html"
GUICtrlSetData($Credits, $data)
GUICtrlSetData($ListView1_0, $SessionStats[1][0] & "|" & $SessionStats[1][1] & "|" & $TotalStats[1][1], "")
Local $RestockSettings = IniReadSection("config/data.ini", "RestockSettings")
If $RestockSettings[1][1] = 1 Then ; Enable Auto-Restock
GUICtrlSetState($CBRestock, 1)
Else
GUICtrlSetState($CBRestock, 4)
EndIf
If $RestockSettings[2][1] = 0 Then ; Enable Auto-Restock
GUICtrlSetState($RHorse, 1)
Else
GUICtrlSetState($RBoat, 1)
EndIf
If $RestockSettings[3][1] = 1 Then ; Trade Fish
GUICtrlSetState($CBSell, 1)
Else
GUICtrlSetState($CBSell, 4)
EndIf
GUICtrlSetData($ISell, $RestockSettings[4][1])
If $RestockSettings[5][1] = 1 Then ; Repair Inventory
GUICtrlSetState($CBRepair, 1)
Else
GUICtrlSetState($CBRepair, 4)
EndIf
GUICtrlSetData($IRepair, $RestockSettings[6][1])
If $RestockSettings[7][1] = 1 Then ; Auction Relics
GUICtrlSetState($CBBroker, 1)
Else
GUICtrlSetState($CBBroker, 4)
EndIf
GUICtrlSetData($IBroker, $RestockSettings[8][1])
If $RestockSettings[9][1] = 1 Then ; Store Relics/Money
GUICtrlSetState($CBBank, 1)
Else
GUICtrlSetState($CBBank, 4)
EndIf
GUICtrlSetData($IBank, $RestockSettings[10][1])
Local $RandomSettings = IniReadSection("config/data.ini", "RandomSettings")
GUICtrlSetData($Input6, $RandomSettings[1][1])
GUICtrlSetData($Input7, $RandomSettings[2][1])
EndFunc ;==>InitGUI
Func StoreGUI()
Local $LootSettings = IniReadSection("config/data.ini", "LootSettings")
Switch GUICtrlRead($CRarity)
Case "White"
$LootSettings[1][1] = 0
Case "Green"
$LootSettings[1][1] = 1
Case "Blue"
$LootSettings[1][1] = 2
Case "Gold"
$LootSettings[1][1] = 3
Case "Specials Only"
$LootSettings[1][1] = 4
EndSwitch
If GUICtrlRead($CBSpecial1) = 1 Then
$LootSettings[2][1] = 1
Else
$LootSettings[2][1] = 0
EndIf
If GUICtrlRead($CBSpecial2) = 1 Then
$LootSettings[3][1] = 1
Else
$LootSettings[3][1] = 0
EndIf
If GUICtrlRead($CBSpecial3) = 1 Then
$LootSettings[4][1] = 1
Else
$LootSettings[4][1] = 0
EndIf
IniWriteSection("config/data.ini", "LootSettings", $LootSettings)
Local $InventorySettings = IniReadSection("config/data.ini", "InventorySettings")
$InventorySettings[1][1] = Int(GUICtrlRead($Input1))
$InventorySettings[2][1] = Int(GUICtrlRead($Input2))
If GUICtrlRead($Checkbox1) = 1 Then
$InventorySettings[3][1] = 1
Else
$InventorySettings[3][1] = 0
EndIf
IniWriteSection("config/data.ini", "InventorySettings", $InventorySettings)
Local $FoodSettings = IniReadSection("config/data.ini", "FoodSettings")
If GUICtrlRead($Checkbox2) = 1 Then
$FoodSettings[1][1] = 1
Else
$FoodSettings[1][1] = 0
EndIf
$FoodSettings[2][1] = GUICtrlRead($Combo1)
$FoodSettings[3][1] = GUICtrlRead($Input3)
IniWriteSection("config/data.ini", "FoodSettings", $FoodSettings)
Local $RestockSettings = IniReadSection("config/data.ini", "RestockSettings")
If GUICtrlRead($CBRestock) = 1 Then
$RestockSettings[1][1] = 1
Else
$RestockSettings[1][1] = 0
EndIf
If GUICtrlRead($RHorse) = 1 Then
$RestockSettings[2][1] = 0
Else
$RestockSettings[2][1] = 1
EndIf
If GUICtrlRead($CBSell) = 1 Then
$RestockSettings[3][1] = 1
Else
$RestockSettings[3][1] = 0
EndIf
$RestockSettings[4][1] = GUICtrlRead($ISell)
If GUICtrlRead($CBRepair) = 1 Then
$RestockSettings[5][1] = 1
Else
$RestockSettings[5][1] = 0
EndIf
$RestockSettings[6][1] = GUICtrlRead($IRepair)
If GUICtrlRead($CBBroker) = 1 Then
$RestockSettings[7][1] = 1
Else
$RestockSettings[7][1] = 0
EndIf
$RestockSettings[8][1] = GUICtrlRead($IBroker)
If GUICtrlRead($CBBank) = 1 Then
$RestockSettings[9][1] = 1
Else
$RestockSettings[9][1] = 0
EndIf
$RestockSettings[10][1] = GUICtrlRead($IBank)
IniWriteSection("config/data.ini", "RestockSettings", $RestockSettings)
Local $RandomSettings = IniReadSection("config/data.ini", "RandomSettings")
$RandomSettings[1][1] = Int(GUICtrlRead($Input6))
$RandomSettings[2][1] = Int(GUICtrlRead($Input7))
IniWriteSection("config/data.ini", "RandomSettings", $RandomSettings)
EndFunc ;==>StoreGUI
Func Fish()
$Fish = Not $Fish
If $Fish = False Then
SetGUIStatus("Pausing.")
Else
SetGUIStatus("Starting.")
EndIf
EndFunc ;==>Fish
Func GUILoopSwitch()
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $Button3 ;Save
StoreGUI()
Case $Button2
ResetSession()
Case $Button1
Fish()
Case $ButtonClear
ClearInv()
Case $BSave
StoreGUI()
Case $BTestRestock
Restock()
EndSwitch
EndFunc ;==>GUILoopSwitch
Func OCInventory($open = True)
Local Const $InventoryRegion = [1095, 226, 1919, 855]
Local $SRx, $SRy, $IS = False
Local $timer = TimerInit()
While Not $IS And $Fish
Sleep(250)
$IS = _ImageSearchArea("res/reference_inventory.bmp", 0, $InventoryRegion[0], $InventoryRegion[1], $InventoryRegion[2], $InventoryRegion[3], $SRx, $SRy, 10, 0)
Sleep(250)
If $IS = True Then
If $open = True Then
Return (True)
ElseIf $open = False Then
CoSe("i")
Sleep(500)
EndIf
ElseIf $IS = False Then
If $open = True Then
CoSe("i")
Sleep(500)
ElseIf $open = True Then
Return (True)
EndIf
EndIf
If TimerDiff($timer) / 1000 >= 3 Then Return False
WEnd
EndFunc ;==>OCInventory
Func InspectFishingrod()
Local Const $WeaponRegion = [1200, 584, 1250, 628]
Local $SRx, $SRy, $IS = False
OCInventory(True)
If MouseGetPos(0) >= $WeaponRegion[0] And MouseGetPos(0) <= $WeaponRegion[2] And MouseGetPos(1) >= $WeaponRegion[1] And MouseGetPos(1) <= $WeaponRegion[3] Then MouseMove(10, 10) ; Keep mouse out of detection range
$IS = _ImageSearchArea("res/rod_empty.bmp", 0, $WeaponRegion[0], $WeaponRegion[1], $WeaponRegion[2], $WeaponRegion[3], $SRx, $SRy, 50, 0)
If $IS = True Then
Return True
ElseIf $IS = False Then
OCInventory(False)
Return False
EndIf
EndFunc ;==>InspectFishingrod
Func SwapFishingrod($discard = False)
Local Const $InvS[3] = [1528, 350, 48] ; X,Y,OFFSET
Local $SRx, $SRy, $IS = False
Local $Fishingrods[5] = ["res/rod_default.bmp", "res/rod_balenos.bmp", "res/rod_calpheon.bmp", "res/rod_epheria.bmp", "res/rod_mediah.bmp"]
OCInventory(True)
If MouseGetPos(0) >= $InvS[0] And MouseGetPos(0) <= $InvS[0] + 500 And MouseGetPos(1) >= $InvS[1] And MouseGetPos(1) <= $InvS[1] + 500 Then MouseMove(10, 10) ; Keep mouse out of detection range
For $j = 0 To 7 Step 1
For $i = 0 To 7 Step 1
For $k = 0 To UBound($Fishingrods) - 1 Step 1
$IS = _ImageSearchArea($Fishingrods[$k], 0, $InvS[0] - 30 + $i * $InvS[2], $InvS[1] - 30 + $j * $InvS[2], $InvS[0] + 30 + $i * $InvS[2], $InvS[1] + 30 + $j * $InvS[2], $SRx, $SRy, 10, 0)
If $IS = True Then
MouseMove($InvS[0] + $i * $InvS[2], $InvS[1] + $j * $InvS[2])
Sleep(50)
MouseClick("right", $InvS[0] + $i * $InvS[2], $InvS[1] + $j * $InvS[2])
If $discard = True Then DiscardEmptyRod()
OCInventory(False)
Return True
EndIf
Next
Next
Next
If $discard = True Then DiscardEmptyRod()
OCInventory(False)
Return False
EndFunc ;==>SwapFishingrod
Func DiscardEmptyRod()
Local Const $InvS[3] = [1528, 350, 48] ; X,Y,OFFSET
Local Const $TrashCan[2] = [1862, 780] ; X,Y
Local $SRx, $SRy, $IS = False
OCInventory(True)
If MouseGetPos(0) >= $InvS[0] And MouseGetPos(0) <= $InvS[0] + 500 And MouseGetPos(1) >= $InvS[1] And MouseGetPos(1) <= $InvS[1] + 500 Then MouseMove(10, 10) ; Keep mouse out of detection range
For $j = 0 To 7 Step 1
For $i = 0 To 7 Step 1
$IS = _ImageSearchArea("res/rod_default_discard.bmp", 0, $InvS[0] - 20 + $i * $InvS[2], $InvS[1] - 20 + $j * $InvS[2], $InvS[0] + 20 + $i * $InvS[2], $InvS[1] + 20 + $j * $InvS[2], $SRx, $SRy, 20, 0)
If $IS = True Then
MouseMove($InvS[0] + $i * $InvS[2], $InvS[1] + $j * $InvS[2])
Sleep(150)
MouseClickDrag("left", $InvS[0] + $i * $InvS[2], $InvS[1] + $j * $InvS[2], $InvS[0] + $i * $InvS[2] + 30, $InvS[1] + $j * $InvS[2], 500)
MouseMove($TrashCan[0], $TrashCan[1])
MouseClick("left", $TrashCan[0], $TrashCan[1])
Sleep(350)
CoSe("{SPACE}")
Sleep(200)
OCInventory(False)
Return True
EndIf
Next
Next
OCInventory(False)
Return False
EndFunc ;==>DiscardEmptyRod
Func Cast()
Local $C[5] = [642, 60, 1256, 64, 15000804] ; FishingCurrently
If Buff($Bufftimer) = True Then $Bufftimer = TimerInit()
Sleep(1000)
CoSe("{SPACE}")
$timer = TimerInit()
While DetectState($C) = False And $Fish
Sleep(500)
If TimerDiff($timer) / 1000 >= 12 Then Return False
WEnd
Return True
EndFunc ;==>Cast
Func Buff($timer)
Local $FoodSettings = IniReadSection("config/data.ini", "FoodSettings")
If $FoodSettings[1][1] = 1 And TimerDiff($timer) / 1000 / 60 > Int($FoodSettings[3][1]) Then
CoSe($FoodSettings[2][1])
Return True
EndIf
Return False
EndFunc ;==>Buff
Func CheckClientResolution()
Local $CCR = WinGetClientSize("BLACK DESERT -")
If [MENTION=2544426]Error T[/MENTION]hen
Return False
ElseIf $CCR[0] = 1920 And $CCR[1] = 1080 Then
Return True
EndIf
Return False
EndFunc ;==>CheckClientResolution
Func Main()
Local $LootSettings[4] = [Int(IniRead("config/data.ini", "LootSettings", "Rarity", 2)), Int(IniRead("config/data.ini", "LootSettings", "Silverkey", True)), Int(IniRead("config/data.ini", "LootSettings", "AncientRelic", True)), Int(IniRead("config/data.ini", "LootSettings", "Coelacanth", True))]
Local $InventorySettings[3] = [Int(IniRead("config/data.ini", "InventorySettings", "FreeSlots", 16)), Int(IniRead("config/data.ini", "InventorySettings", "ReservedSlots", 8)), Int(IniRead("config/data.ini", "InventorySettings", "DiscardRods", 0))]
Local $RandomSettings[2] = [Int(IniRead("config/data.ini", "RandomSettings", "min", 100)), Int(IniRead("config/data.ini", "RandomSettings", "max", 800))]
Global $PickedLoot = Int(IniRead("config/data.ini", "CurrentStats", "PickedLoot", 0))
Global $SwappedRods = 0
Local $fishingtimer = 0
Local $Reserved = False
Local $CorrectRes = False
Local $ScreenSaver = TimerInit()
$Fish = False
InitGUI()
While True
GUILoopSwitch()
While $Fish
If $CorrectRes = False Then $CorrectRes = CheckClientResolution()
If $CorrectRes = False Then
SetGUIStatus("E: must be 1920x1080 Windowed Fullscreen")
$Fish = False
ExitLoop
EndIf
GUILoopSwitch()
Switch GetState()
Case 30 ; You feel a bite. Press 'Space' bar to start.
$Breaktimer = 0
SetGUIStatus("Reeling in.")
If ReelIn() = True Then
SetGUIStatus("Solving riddle.")
Riddler()
SetGUIStatus("Evaluating loot.")
Sleep(3000)
$PickedLoot = Int(IniRead("config/data.ini", "CurrentStats", "PickedLoot", 0))
$LootSettings[0] = Int(IniRead("config/data.ini", "LootSettings", "Rarity", 2))
$LootSettings[1] = Int(IniRead("config/data.ini", "LootSettings", "Silverkey", True))
$LootSettings[2] = Int(IniRead("config/data.ini", "LootSettings", "AncientRelic", True))
$LootSettings[3] = Int(IniRead("config/data.ini", "LootSettings", "Coelacanth", True))
If HandleLoot($LootSettings[0], $LootSettings[1], $LootSettings[2], $LootSettings[3], $Reserved) = True Then $PickedLoot += 1
SetGUIInventory($PickedLoot)
$InventorySettings[0] = Int(IniRead("config/data.ini", "InventorySettings", "FreeSlots", 16))
$InventorySettings[1] = Int(IniRead("config/data.ini", "InventorySettings", "ReservedSlots", 8))
$InventorySettings[2] = Int(IniRead("config/data.ini", "InventorySettings", "DiscardRods", 0))
If $InventorySettings[0] - $PickedLoot <= 0 Then
If $InventorySettings[1] > 0 Then $Reserved = True
If $InventorySettings[0] + $InventorySettings[1] - $PickedLoot <= 0 Then
SetGUIStatus("Inventory full. Stopping.")
$Fish = False
If IniRead("config/data.ini", "RestockSettings", "EnableRestock", 0) Then Restock() ; EXPERIMENTAL
ExitLoop
EndIf
EndIf
EndIf
Case 20 ; You are currently fishing. Please wait until you feel a bite.
If TimerDiff($ScreenSaver) / 1000 / 60 >= 2 Then ; To fix ScreenSaver messing up
MouseMove(MouseGetPos(0) + 10, MouseGetPos(1))
MouseMove(MouseGetPos(0) - 10, MouseGetPos(1))
$ScreenSaver = TimerInit()
EndIf
$Breaktimer = 0
If $fishingtimer <> 0 Then
SetGUIStatus("Currently fishing. (" & Round(TimerDiff($fishingtimer) / 1000, 0) & "s)")
Else
SetGUIStatus("Currently fishing.")
EndIf
Case 10 ; Press 'Space' near a body of water to start fishing.
$Breaktimer = 0
SetGUIStatus("Ready for fishing.")
If Cast() = False Then
SetGUIStatus("Cast failed. Inspecting equipped fishingrod.")
If InspectFishingrod() = True Then
SetGUIStatus("Swapping fishingrods.")
If SwapFishingrod($InventorySettings[2]) = True Then
$SwappedRods += 1
Else
SetGUIStatus("No fishingrods found. Stopping.")
$Fish = False
If IniRead("config/data.ini", "RestockSettings", "EnableRestock", 0) Then Restock() ; EXPERIMENTAL
ExitLoop
EndIf
EndIf
EndIf
$fishingtimer = TimerInit()
Case Else
SetGUIStatus("Unidentified state.")
If $Breaktimer = 0 Then
$Breaktimer = TimerInit()
ElseIf TimerDiff($Breaktimer) / 1000 > 10 Then
SetGUIStatus("Unidentified state. Trying to equip fishingrod.")
If SwapFishingrod() = False Then
SetGUIStatus("Detection Error. UI Scale must be at 100%")
$Fish = False
ExitLoop
Else
Sleep(3000)
EndIf
EndIf
EndSwitch
Sleep(100)
If $Fish = False Then
SetGUIStatus("Fishing stopped.")
$fishingtimer = 0
EndIf
WEnd
WEnd
EndFunc ;==>Main
Func UnequipRod()
Local Const $WeaponRegion = [1200, 584, 1250, 628]
Local $SRx, $SRy, $IS = False
OCInventory(True)
MouseClick("right", 1225, 600)
OCInventory(False)
Return True
EndFunc ;==>UnequipRod
Func TrackNPC($npcname)
Local Const $NPCSearchIcon[2] = [1556, 30]
Local Const $NPCs[4] = ["res/npc_bank.bmp", "res/npc_repair.bmp", "res/npc_trade.bmp", "res/npc_broker.bmp"]
Local Const $Offset[2] = [515, 345]
Local $C[2] = [-1, -1]
Local $IS, $counter = 3
While $Fish
UnequipRod()
CoSe("{LCTRL}")
Sleep(250)
MouseClick("left", $NPCSearchIcon[0], $NPCSearchIcon[1])
Sleep(250)
$IS = _ImageSearchArea($NPCs[1], 1, 1175, 50, 1600, 676, $C[0], $C[1], 50, 0)
If $IS = True Then
MouseMove($C[0], $C[1] + $Offset[0])
MouseClick("left")
Sleep(250)
Send($npcname) ; Send instead of CoSe because of trouble with > key
CoSe("{ENTER}")
MouseMove($C[0], $C[1] + $Offset[1])
MouseClick("left")
Sleep(250)
CoSe("t")
CoSe("{ESC}")
CoSe("{LCTRL}")
Return True
Else
$counter -= 1
If $counter <= 0 Then Return False
EndIf
WEnd
EndFunc ;==>TrackNPC
Func NearbyNPC($npc_type) ; 0 = bank, 1 = repair, 2 = trader, 3 = broker
Local Const $NPCSearchIcon[2] = [1556, 30]
Local Const $NPCs[4] = ["res/npc_bank.bmp", "res/npc_repair.bmp", "res/npc_trade.bmp", "res/npc_broker.bmp"]
Local $x, $y, $IS, $counter = 3
While $Fish
UnequipRod()
CoSe("{LCTRL}")
Sleep(250)
MouseClick("left", $NPCSearchIcon[0], $NPCSearchIcon[1])
Sleep(250)
$IS = _ImageSearchArea($NPCs[$npc_type], 1, 1175, 50, 1600, 676, $x, $y, 50, 0)
If $IS = True Then
MouseMove($x, $y)
Sleep(50)
MouseClick("left", $x, $y)
Sleep(50)
MouseClick("right", $x, $y)
Sleep(50)
CoSe("{ESC}")
CoSe("{LCTRL}")
Return True
Else
$counter -= 1
If $counter <= 0 Then Return False
EndIf
WEnd
EndFunc ;==>NearbyNPC
Func MapMovement()
Local Const $MapRegion = [1815, 48, 1830, 50]
Local $FF[6][2]
Local $dif = 0, $SSN = 1
Local $timer = TimerInit()
SetGUIStatus("Autopathing...")
While TimerDiff($timer) / 1000 <= 180 And $Fish
Sleep(250)
FFSnapShot($MapRegion[0], $MapRegion[1], $MapRegion[2], $MapRegion[3], $SSN)
For $i = 0 To UBound($FF) - 1 Step 1
$FF[$i][0] = FFGetPixel($MapRegion[0] + 2 * $i, $MapRegion[1], $SSN)
Next
Sleep(500)
FFSnapShot($MapRegion[0], $MapRegion[1], $MapRegion[2], $MapRegion[3], $SSN)
For $i = 0 To UBound($FF) - 1 Step 1
$FF[$i][1] = FFGetPixel($MapRegion[0] + 2 * $i, $MapRegion[1], $SSN)
If $FF[$i][0] = $FF[$i][1] Then $dif += 1
Next
If $dif >= 3 Then
Return True
Else
$dif = 0
Sleep(4000)
MouseMove(MouseGetPos(0) + 10, MouseGetPos(1)) ; Stop Screensaver
MouseMove(MouseGetPos(0) - 10, MouseGetPos(1))
Sleep(1000)
EndIf
WEnd
ConsoleWrite("MapMovement failed.")
Return False
EndFunc ;==>MapMovement
Func NPCType($type, $npcname) ; bank, repair, trade, broker
Local Const $ButtonRegion = [431, 822, 1522, 906]
Local Const $NPCs[4][2] = [["res/npc_bank.bmp", "res/npc_bank_button.bmp"], ["res/npc_repair.bmp", "res/npc_repair_button.bmp"], ["res/npc_trade.bmp", "res/npc_trade_button.bmp"], ["res/npc_broker.bmp", "res/npc_broker_button.bmp"]]
Local $IS, $x, $y, $SSN = 1, $counter = 10
If $npcname <> "" Then
TrackNPC($npcname)
Else
NearbyNPC($type)
EndIf
MapMovement()
While $counter >= 0
CoSe("r") ; Talk to NPC
Sleep(750)
$IS = _ImageSearchArea($NPCs[$type][1], 1, $ButtonRegion[0], $ButtonRegion[1], $ButtonRegion[2], $ButtonRegion[3], $x, $y, 20, 0)
If $IS = True Then ; Check for correct dialogue
MouseClick("left", $x, $y, 2)
Sleep(500)
Return True
Else
; Close dialog and slowly pan camera to the right in case multiple npcs are overlapping
CoSe("{ESC}")
Sleep(500)
MouseMove(MouseGetPos(0) + 500, MouseGetPos(1), 50)
EndIf
$counter -= 1
If $counter <= 0 Then Return False
WEnd
EndFunc ;==>NPCType
Func BankRelics($npcname = "")
Local Const $Relic = "res/loot_ancientrelic.bmp"
Local Const $InvS[3] = [1528, 350, 48] ; X,Y,OFFSET
Local Const $Money[2] = [1534, 795]
Local $IS, $x, $y
If NPCType(0, $npcname) = True Then
SetGUIStatus("Storing Relics & Money.")
For $k = 0 To 1 Step 1
If MouseGetPos(0) >= $InvS[0] And MouseGetPos(0) <= $InvS[0] + 500 And MouseGetPos(1) >= $InvS[1] And MouseGetPos(1) <= $InvS[1] + 500 Then MouseMove($InvS[0] - 50, $InvS[1]) ; Keep mouse out of detection range
For $i = 0 To 7 Step 1
For $j = 0 To 7 Step 1
$IS = _ImageSearchArea($Relic, 0, $InvS[0] - 30 + $i * $InvS[2], $InvS[1] - 30 + $j * $InvS[2], $InvS[0] + 30 + $i * $InvS[2], $InvS[1] + 30 + $j * $InvS[2], $x, $y, 20, 0)
If $IS = True Then MouseClick("right", $x, $y, 2)
Next
Next
MouseMove($InvS[0], $InvS[1])
Sleep(50)
MouseWheel("down", 8)
Sleep(150)
Next
MouseClick("left", $Money[0], $Money[1], 2)
Sleep(150)
CoSe("f")
CoSe("{SPACE}")
Sleep(250)
CoSe("{ESC}")
CoSe("{ESC}")
Return True
Else
Return False
; TODO ERROR HANDLING
EndIf
EndFunc ;==>BankRelics
Func RepairInv($npcname = "")
Local Const $RepairInven[3] = [1151, 1036, 10569571]
If NPCType(1, $npcname) = True Then
SetGUIStatus("Repairing.")
MouseClick("left", $RepairInven[0], $RepairInven[1], 2)
Sleep(250)
CoSe("{SPACE}")
Sleep(250)
CoSe("{ESC}")
CoSe("{ESC}")
Return True
Else
Return False
; TODO ERROR HANDLING
EndIf
EndFunc ;==>RepairInv
Func BrokerRelics($npcname = "")
Local Const $MyListingsButton[3] = [819, 1039, 460812]
Local Const $RegisterItemButton[2] = [1314, 304]
Local Const $ConfirmButton[2] = [1212, 399]
Local $InvS[3] = [1528, 350, 48] ; X,Y,OFFSET
Local Const $Relic = "res/broker_ancientrelic.bmp"
Local $IS, $x, $y
If NPCType(3, $npcname) = True Then
SetGUIStatus("Auctioning Relics.")
MouseClick("left", $MyListingsButton[0], $MyListingsButton[1], 2)
Sleep(500)
MouseClick("left", $RegisterItemButton[0], $RegisterItemButton[1], 2)
Sleep(500)
For $k = 0 To 1 Step 1
If MouseGetPos(0) >= $InvS[0] And MouseGetPos(0) <= $InvS[0] + 500 And MouseGetPos(1) >= $InvS[1] And MouseGetPos(1) <= $InvS[1] + 500 Then MouseMove($InvS[0] - 50, $InvS[1]) ; Keep mouse out of detection range
For $i = 0 To 7 Step 1
For $j = 0 To 7 Step 1
$IS = _ImageSearchArea($Relic, 0, $InvS[0] - 30 + $i * $InvS[2], $InvS[1] - 30 + $j * $InvS[2], $InvS[0] + 30 + $i * $InvS[2], $InvS[1] + 30 + $j * $InvS[2], $x, $y, 20, 0)
If $IS = True Then
MouseClick("right", $x, $y, 2)
Sleep(250)
MouseClick("left", $ConfirmButton[0], $ConfirmButton[1], 2)
Sleep(250)
CoSe("{SPACE}")
CoSe("{SPACE}")
EndIf
Next
Next
MouseMove($InvS[0], $InvS[1])
Sleep(50)
MouseWheel("down", 8)
Sleep(150)
Next
CoSe("{ESC}")
CoSe("{ESC}")
CoSe("{ESC}")
Return True
Else
Return False
; TODO ERROR HANDLING
EndIf
EndFunc ;==>BrokerRelics
Func SellFish($npcname = "")
Local Const $SellAllButton[2] = [1782, 753]
If NPCType(2, $npcname) = True Then
SetGUIStatus("Selling Fish.")
MouseClick("left", $SellAllButton[0], $SellAllButton[1])
Sleep(500)
CoSe("{SPACE}")
Sleep(500)
CoSe("{ESC}")
CoSe("{ESC}")
Sleep(500)
Return True
Else
Return False
; TODO ERROR HANDLING
EndIf
EndFunc ;==>SellFish
Func BackToMount($Boat = 0)
Local Const $Mount[2][2] = [[39, 128], [98, 122]]
Local Const $NPCSearchIcon[2] = [1556, 30]
Local Const $NPCs[4] = ["res/npc_bank.bmp", "res/npc_repair.bmp", "res/npc_trade.bmp", "res/npc_broker.bmp"]
Local $x, $y, $IS
Sleep(500)
UnequipRod()
CoSe("{LCTRL}")
;Workaround to improve correct pathing to mount
Sleep(250)
MouseClick("left", $NPCSearchIcon[0], $NPCSearchIcon[1])
Sleep(750)
$IS = _ImageSearchArea($NPCs[1], 1, 1175, 50, 1600, 676, $x, $y, 50, 0)
If $IS = True Then
MouseMove($x, $y)
Sleep(50)
MouseClick("right", $x, $y)
Sleep(50)
MouseClick("left", $x, $y)
Sleep(50)
MouseMove($Mount[$Boat][0], $Mount[$Boat][1])
Sleep(250)
MouseClick("right", $Mount[$Boat][0], $Mount[$Boat][1])
Sleep(250)
MouseClick("right", $Mount[$Boat][0], $Mount[$Boat][1])
Sleep(500)
CoSe("t")
CoSe("{ESC}")
CoSe("{LCTRL}")
MapMovement()
Return True
EndIf
Return False
EndFunc ;==>BackToMount
Func Restock()
Local $RestockSettings = IniReadSection("config/data.ini", "RestockSettings")
If $RestockSettings[1][1] = 0 Then Return False
SetGUIStatus("Restocking...")
WinActivate("BLACK DESERT - ")
Sleep(500)
$Fish = True
If $RestockSettings[3][1] = 1 Then
SetGUIStatus("Selling Fish.")
If SellFish($RestockSettings[4][1]) = True Then SetGUIInventory(0)
EndIf
If $RestockSettings[5][1] = 1 Then
SetGUIStatus("Repairing.")
RepairInv($RestockSettings[6][1])
EndIf
If $RestockSettings[7][1] = 1 Then
SetGUIStatus("Auctioning Relics.")
BrokerRelics($RestockSettings[6][1])
EndIf
If $RestockSettings[9][1] = 1 Then
SetGUIStatus("Storing Relics & Money.")
If BankRelics($RestockSettings[6][1]) = True Then SetGUIInventory(0)
EndIf
SetGUIStatus("Autopathing to mount.")
BackToMount($RestockSettings[2][1])
SetGUIStatus("Autopath to mount complete.")
Return True
EndFunc ;==>Restock
Main()
you have to add also those 2 lines in config file
Code:
[RandomSettings]
min=200
max=700
also it's much better to loot with mouse click so it can get event items without taking any fish grade you don't want i think we will have to check every slot alone to get the coordinates of every item
04/07/2017, 14:32
#29
elite*gold: 0
Join Date: Jan 2006
Posts: 530
Received Thanks: 135
@
works good, i would suggest include worker feeding "recover all + repeat all"
04/07/2017, 15:09
#30
elite*gold: 100
Join Date: Mar 2006
Posts: 1,819
Received Thanks: 425
Pattern for Worker Feeding Open Inventory
Scan for Beer.bmp (Icon)
Right click Beer if found.
If No Beer detected, exit loop. Throws a warning.
If Beer is found, right click on Beer.
Worker List Open: Click Recover All
Worker List Open: Click confirm button
Worker List Open: Click Repeat all
Close Worker List
Wait X minutes to check Worker Stamina.
So add a string randomizer in the title of the app.
Similar Threads
[Opensource] PokeMMO Autoit bots
01/12/2014 - Pokemon - 117 Replies
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 is low
-Catches shiny's
-Train EV (currently only Attack, Speed and Sp.Attack are added)
[OPENSOURCE PROJECT] BROWSERGAME
02/06/2012 - Web Development - 8 Replies
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 usw.
Wir Brauchen Programmierer
Und eine Idee.
Was genau wir veröffentlichen wollen.
Alle die Vielleicht nicht mit machen wollen aber eine idee haben bitte in den Kommis Schreiben
LG
StreetFight
[OpenSource Project] C++ CoCore
01/26/2011 - CO2 Private Server - 59 Replies
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#. There are a few members who I believe have potential, and I think those are pretty much the ones who will take interests into this project.
What is this CoCore, and what does it contain?:
Unknown (?)
Yes.. Unknown. I think I want the members who are interested to provide me with a list of things that should be put in, for example, custom...
Farmville Automatizer OPENSOURCE free bot [AutoIT]
04/05/2010 - Facebook - 2 Replies
Farmville Automatizer released!
Open Source
>>> Download <<<
All times are GMT +2. The time now is 06:49 .