[AutoIt] CrayonCode Bot Project (OpenSource & Free)

04/04/2017 15:33 CrayonCode#1
New Version for all resolutions: [Only registered and activated users can see links. Click Here To Register...]

I'm looking for testers and feedback. Images with avaible GUI and settings will follow when I've reached enough posts.

All new versions will be posted here.

Current functionality:
  • Autofishes and completes fishing minigame
  • Classifies loot (Rarity and Specials) [Lootsettings]
  • Equip/discard fishingrods from Inventory (only discards unrepairable)
  • Uses bufffood
  • Keeps track of your fishing stats
  • Stops when Free and Reserved Inventory is full or no fishingrods are avaible.
  • Basic GUI [It's so shiny]
  • NEW: Auto-Restock (selling fish, repairing rods, auctioning relic, storing money/relics)
  • NEW: Feed Workers
  • NEW: Drying feature
  • Improved error feedback
  • NEW: Digging
  • NEW: Auto-Restart
  • NEW: Marketplace
  • NEW: Milking

Requires English Client and 100% UI Scale. This doesn't work in the background, since it's screen-reading.

Guide for custom Presets [Only registered and activated users can see links. Click Here To Register...]

Run CrayonCode.au3 to start the GUI.

Latest changes:
Quote:
v0.21

- Few more Status messages added.
- Added handling if ReelIn window is obstructed. (Moved dailyspam escape to reelin instead of riddle)
- Fixed bug in DetectFullscreenToWindowedOffset() where the global $hBDO was overwritten by local.
- Fixed Buttons for sidefunctions not working after they started (Missing GUILoopSwitch)
- Changed loot_silverkey.bmp to stop certain fish from pretending to be silverkeys.

CrayonCodeProcessing.au3 added
- SimpleProcessing will just process all selected materials until you run out.
- CustomProcessing will enable custom recipes and supports up to two ingredients.
- Scans the complete warehouse inventory
- Supported materials are limited to Lumber, Planks, Ores and Melted Shards for now.
- Use of the Alchemy Stone can be enabled.

Requirements:
Standing next to a warehouse with Transport Option.
Auto-Sort for the Warehouse must be ENABLED.
Auto-Sort for the Inventory must be DISABLED.
The first 4 Player Inventory will be used for the processing.

Since I need an image of every material that you wan't to process I will need the help of the community for this.
There is a specific way the images need to be captured, because of the strange rendering of warehouse inventories.
Details will follow soon.



Patchnote history:
04/04/2017 21:01 sunny55#2
Thanks, gonna try this.
04/04/2017 22:05 laservic#3
Error while starting script not found!Failed to load FastFind.dll.
04/04/2017 22:17 anonamus111#4
I'll try it when I get home. Will post results.

Tested it out (windows 10 x64)
Worked fine for me. When I changed the fish settings to white it wouldn't pick up fish until I shut it down and reloaded. If you get it to work on 1440p that'd be awesome!

Great work though so far!
04/04/2017 22:22 killzone#5
Archive Error, for me when I dled.

Quote:
Originally Posted by laservic View Post
Error while starting script not found!Failed to load FastFind.dll.
FastFind.au3 (.dll)
[Only registered and activated users can see links. Click Here To Register...]

ImageSearch.au3 (.dll)
[Only registered and activated users can see links. Click Here To Register...]

Quote:
Originally Posted by CrayonCode View Post
Snipped.
Used 3 different browsers to check if its my end who has the issues. It appears your upload is corrupted.
04/04/2017 23:39 CrayonCode#6
@[Only registered and activated users can see links. Click Here To Register...] @[Only registered and activated users can see links. Click Here To Register...]: I forgot the FastFind.dll for the x86 support. Running the script in x64 should work fine.

I updated the files, so it should work both ways now. Thanks for the notice!

If you are running a 32bit system and still have trouble try following:
Change line 12 in CrayonCode.au3 from "#AutoIt3Wrapper_UseX64=y" to "#AutoIt3Wrapper_UseX64=n"
04/05/2017 01:53 Wyn10#7
Check your pm's.
04/05/2017 02:38 Griffit85#8
do i need to have some extra program installed for this ?

[Only registered and activated users can see links. Click Here To Register...]
04/05/2017 09:10 killzone#9
Quote:
Originally Posted by Griffit85 View Post
do i need to have some extra program installed for this ?

[Only registered and activated users can see links. Click Here To Register...]
Perhaps open your inventory so the bot sees your rods.


Edited the code, I made changes to folder structures so that future development will be easier (for me at least).
Steps:
Create a res folder.
Create a config folder.
Move all *.bmp files into the res folder.
Move data.ini into config folder.

I did it this way so that in future, when adding more images, it'll be much more organize and easier to manage.
@[Only registered and activated users can see links. Click Here To Register...]
Add a function that detects rods with +s
[Only registered and activated users can see links. Click Here To Register...]
Im not sure but I think it does not detect the rods properly.
Also, might as well as add color variation to the pixel search function.

Its also a good idea to let the user specify the X/Y of your Rod in your inventory.
So the bot will look for it exactly in that coordinate.

Also, I made an Auto-turn-in macro.
Its in dotnet the idea is there.
Basically what it does is that after X minutes, it will stop fishing by switching weapons and finding the repair npc and trade npc then goes to find the horse.
Which the horse is parked near the shoreline. XD

The Process
The auto-turn in works. However, its best noted that sometimes you have to "click twice" on the NPC Icon for it to locate the npc.
This is the reason why you will see at the code above I made it "click 2x" or "right click 2x".
Specially when locating the horse.
04/05/2017 10:07 Wyn10#10
Quote:
Originally Posted by killzone View Post
-snip-
I sent CrayonCode some images of rods and floats hopefully it should be enough for testing.
04/05/2017 11:59 niexi#11
Stopped. No fishing rod equipped
04/05/2017 12:29 killzone#12
Quote:
Originally Posted by Wyn10 View Post
I sent CrayonCode some images of rods and floats hopefully it should be enough for testing.
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.
04/05/2017 15:37 CrayonCode#13
Quote:
Originally Posted by Griffit85 View Post
do i need to have some extra program installed for this ?
No since you already received the error message, but it seems to be unable to find the hardcoded states. (Start fishing, Currently fishing, Bite)

Since it can't find the state on the screen make sure its 1920x1080 resolution and you set the UI Scale to 100%. If you could send a complete fullscreen screenshot I could find out.
Quote:
Originally Posted by killzone View Post
Im not sure but I think it does not detect the rods properly.
Also, might as well as add color variation to the pixel search function.

Its also a good idea to let the user specify the X/Y of your Rod in your inventory.
So the bot will look for it exactly in that coordinate.
The imagesearches all have a variation. The problem with BDO is that the UI scales gradually and the size distortion will make the searches fail everytime.
The transparency of most UI elements is a big problem as well. So I had to find the few solid pixels and had to make sure the color is consistent to avoid wrong state detection.

If you turn autosort off then you can sort your rods yourself. It will pick identified rods from left to right and then go to the next line in the 8x8 inventory without scrolling. In my oppinion this was sufficient. What do you think? (Enchantable and repairable rods will be added later.)

The horse as an anchorpoint for the the pathfinding is a pretty neat idea.
Though we all know how easily the pathfinding just gets stuck on a rock or a mob. I could add it as experimental feature.

I will add a folder structure in the next version and also add tests and improved error messages so I can troubleshoot more effectively.
04/05/2017 16:01 killzone#14
Quote:
left to right and then go to the next line in the 8x8 inventory without scrolling
This is good enough for the user to understand that the bot will only check the first 2 lines of your inventory.
So this means, the Row1 & Row2 of your inventory is reserved ONLY for fishing rods.

Maybe also update the instructions in the first post that users must be in Full Window Mode + 100% UI Scaling.

It is worth mentioning what you want the users do before pressing the start.
Lets say, do you want the user to just open inventory then press Start so the bot will pick the Rod and start fishing?
Or you want the user to start the fishing process and then press start bot?
Things like this gets easily confused by the users.
04/05/2017 16:30 CrayonCode#15
Quote:
Originally Posted by killzone View Post
It is worth mentioning what you want the users do before pressing the start.
Lets say, do you want the user to just open inventory then press Start so the bot will pick the Rod and start fishing?
Or you want the user to start the fishing process and then press start bot?
Things like this gets easily confused by the users.
The bot is designed to identify the current state. So you can start it while having a fishing rod equipped, or while fishing, or while a fish is already on the line.

I will add instructions instead of the "Settings loaded" to "Please equip a fishing rod. Then start."