[AutoIt] CrayonCode Bot Project (OpenSource & Free)

04/09/2017 21:46 killzone#76
@[Only registered and activated users can see links. Click Here To Register...]
In order to make it easier to port with lower resolution, perhaps add textboxes for users to input the X/Y coordinates manually or by using a Timer with HotKey.
[Only registered and activated users can see links. Click Here To Register...]
I made this auto worker feeder prior to the release of your script.

Just make a helpfile or a tutorial where to find the image in your screen and let the user find it themselves so the script will work on any resolution.

The sample HotKey for clicking the "..." to find the Worker Icon.
Code:
        workHotkey = GetAsyncKeyState(Keys.Insert)
        numWorkX.Value = MousePosition.X
        numWorkY.Value = MousePosition.Y
        Status.Text = "Locate worker icon && press {INS} Key to save."
        If workHotkey = True Then
            workHotkey = False
            tmrWorkerHotkey.Stop()
            Status.Text = "Worker Icon location has been saved."
        End If
So yea, with this we can make a universal resolution script.
Of course you'll have to add each X/Y textboxes for each Pixel/images to find.

This will save time into converting the script and less support given to the users who is using your script because they can now tweak the script at will without touching the source directly.
04/09/2017 22:10 CrayonCode#77
@[Only registered and activated users can see links. Click Here To Register...] No I can't Imagesearch for the cursor. Neither FastFind nor Imagesearch will capture the mouse when they take a screen. It is not detectable like that.

Loot is already returned individually. If only the second slot meets the lootfilter it will only pick the second. If the first and the third slot meet the lootfilter it will pick both of those but not the second. Like I said before, each slot is handled individually.

@[Only registered and activated users can see links. Click Here To Register...] I'm more interested in solving the logic and exploring features at the moment.
Support for different resolutions and languages will follow later.
Everything takes time and I'm not payed to do this, nor am I specifically trained. So you will have to be patient.
04/09/2017 22:21 killzone#78
Fair enough. Its good to know there's a future plan for supporting multiple resolutions.
04/09/2017 22:54 sunny55#79
Ok here is my updated comment on v0.14

Firstly, the bot does not discard useless junk. Also I could not get it to leave 2 open slots for drying idk why. So inventory just gets full of fish. The reeling and loot function work really well.

Gonna keep using v0.12 for a while as it works the best atm for me.
04/10/2017 01:32 killzone#80
@[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
Inventory count gets negative.

Scenario:
Was changing settings while I have 68 Slots, I counted from Potions, Rods & Beers a total of 18 Slots. So I used the 18 slots as "reserved slots" thus making it 50/50 (68-18).
I restarted the bot, didnt changed any value and hit F4.
Bot detects inventory is full.
Opened inventory, then scrolled down until it sees the "unopened slots" (those slots with white squares in middle denoting its closed).
Closes inventory, then detecting "undefined" and trying to use the rod and continue fishing.
Then bot updates the counter into what the image shown above.

My attempt was hoping it will detect that the inventory was full and do the drying process then resumes the fishing.

Edit:
Im very sure this is not the bot's issue but mine as Im very sure it has to do with my inventory settings & reservation of slots which I am not familiar with.

So, any tip? Has total of 68 slots (with value pack).
Then currently has 17 extra items in inventory including 8 rods, beer, pet food, dried fish, key, relic & lamp oil.
How much reserved slots will I put, 17 or 20 to make sure?


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

BUG REPORT
Version: 14
Status: Drying Fish
Scenario: Bot tries to Dry fish while player is equipped with fishing rod.
Possible solution: Allow the bot to do 2 checks, if check returns true on both check it will process the fish.

Example idea:

Code:
If IsEquippedRod = True And IsInventoryFull = True Then
	UnEquipRod()
	sleep(3000)
	DryFish()
else
	StopFishing()
End If
04/10/2017 12:07 KKK76#81
While drying takes a step forward, especially when the fish are of the same type. I think you just decrease the time between press "L" to open the processing window

Sorry for my bad english.
04/10/2017 19:42 limital#82
I have the same problems with the inventory...it does not recognize when the inventory is full and so auto-restock doesnt work...but aside from that Crayon did an amazing job :) kudos to you!
04/10/2017 20:31 s3anlike#83
Hey Killzone how u changed the routines for npcs? i need to change it to for better experiences

PS: Restock Option, after trading items on Trader bot goes to the Blacksmith and typing 3 times the same npc name Blacksmith ..
04/10/2017 21:57 CrayonCode#84
Quote:
Originally Posted by s3anlike View Post
Hey Killzone how u changed the routines for npcs? i need to change it to for better experiences

PS: Restock Option, after trading items on Trader bot goes to the Blacksmith and typing 3 times the same npc name Blacksmith ..

Code:
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 ; Trader
		SetGUIStatus("Selling Fish.")
		If SellFish($RestockSettings[4][1]) = True Then SetGUIInventory(0)
	EndIf
	If $RestockSettings[5][1] = 1 Then ; Repair
		SetGUIStatus("Repairing.")
		RepairInv($RestockSettings[6][1])
	EndIf
	If $RestockSettings[7][1] = 1 Then ; Auction
		SetGUIStatus("Auctioning Relics.")
		BrokerRelics($RestockSettings[6][1])
	EndIf
	If $RestockSettings[9][1] = 1 Then ; Bank
		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
Search this function and just swap the position yourself. Next version will have an option for npc order.




Next version will be out sometime today with some additions but mostly fixes.
04/11/2017 09:11 sunny55#85
Man you work so fast damn. I have no knowledge about coding but it looks so smooth. Keep up the good work :)
04/11/2017 14:06 Slayve#86
Congratulations for your work, I look forward to other resolution ^^
.
04/11/2017 16:09 3XE#87
Thank you so much for making this! I can finally make decent money from fishing while doing something else at home, or simply working. I have no knowledge about coding, but if you need any help in the future, anything that I can help you with, just let me know! :)
04/11/2017 18:51 CrayonCode#88
V0.15 is out! Grab it while it's hot!
04/11/2017 19:00 721560329#89
idk if im the only one having the issue but my worker button isnt on 4th slot its on 3rd maybe option to pick which slot to click on ?
04/11/2017 19:55 s3anlike#90
Quote:
Originally Posted by CrayonCode View Post
V0.15 is out! Grab it while it's hot!
whats the randomization min and max default settings crayon?

PS: Crayon is it possible to press T if bot checked the red waypoint and then press t if not try again like pixelsearch on the map for the red waypoint?

PS: Crayon u need a Discord channel! xD