# Thread: [under development] Stuff I'm working on

1. ## [under development] Stuff I'm working on

Greetings all!

I've been working with an Autoit script I found here, and heavily modified it. Also working on my own things I might post here that others will find useful.
That is, if there is community interest. Otherwise I'll keep stuff to myself.
So far what I've done:

Function clientSizeTooltip()
Used for visual debugging.
Posts client position, width, height, client area width, client area height, mousePercentX, mousePercentY, mouseX, mouseY, Mouse Dist to player, mDistX, mDistY
This is important because now we can use any resolution.
Instead of using absolute pixel coordinates, we only need to find the percents. Then it will work on any resolution. I've tested things on 800x600, 1440x900, 1600x900 and they all work perfectly.
Might need testing on higher resolutions like 1920x1080
So instead of using a position under the player like (950,550) instead use \$aClientSize[0]*0.5,\$aClientSize[1]*0.52
This works because in Autoit I'm using coordmode relative to the client area of the active window.

Function _isSkillWithinRange()
Most of the time I calculate a skills radius based on the pixel distance to the player.
I need a way to figure out how to scale this distance based on client size.
Regardless, I'm recording most skill shot distances. Currently working on Evoker and Canoneer.

I try to find the X-horizontal distance first, when distance to player y=0. Then the function scaling does the rest.
This function works based off this: formula if point is inside ellipse: x^2 / a^2 + y^2 / b^2 <= 1
Returns true or false.
This is not exact, since the ellipse is skewed. Top half is visible, while bottom half is offscreen. I worked around this in most cases.
You can generally offscreen mobs or cast spells/skills to the bottom right or left corners. While this is not possible on the top left or top right.
So that's why I wrote the function! Works like 95% of the time if I get the right skill range.
Again still need to test on higher resolutions.

Usage: isSkillWithinRange(\$passedRanged, \$passedMouse_X_Distance=0, \$passedMouse_Y_Distance=0)
I'm going to modify it so I will later pass mouse position, but I don't even need that. If the default distances are used I get the current mouse position and test that range.

Function _Quest_AutoRun() For both inside/outside dungeons as they change position.
Function _Quest_Accept() For both inside/outside dungeons as they change position.
Function _lootSearch() Similar to enemySearch. Specify color and Area.
Function _enemySearch(\$color) Heavily modified to remove duplicate code.
Specify a single color to check for (hp bar, name color, monster color, etc.)
Specify an area of the screen to search. If non specified will default to area 1. See below.

Function _areaToCheck()
Sample Image
Areas 1-5. Area 1 is the main search box which should not conflict with minimap, quest text, or bottom client UI if it's the smallest possible.
Areas 2-4 will search the remaining small portions of the top left, top right, and bottom right areas.
Area 5 is Tricky. This area will search th remaining right area of the screen, PROVIDED the quest tracker UI text is hidden. Otherwise you might receive false positives and get stuck infinitely.
I think I still need to fix the percents for Area 5, because it might overlap the "Exit" dungeon button.
----------
I know it doesn't seem like much, but that's what I've been working on for the past few days? week?
At least when I get internet connection issues to the game. Otherwise I'm actually playing.

Later I'm going to work on finding HP/Mana area detection, loot color detection, quest color detection, quest turn-in / auto walk, and other stuff.
It's important for me later because I plan to write my bot solely on pixel detection. I don't do memory stuff. That's either too difficult for me or too time consuming, and constantly changing on patches. The way I'm going to write it I never have to deal with that.
On the plus side, they don't use randomly generated areas. So this is good for path finding and waypoint usage. Although waypoints will get you banned, path finding is somewhat simpler because of static zone layouts.

Well that's my rant so far. Will periodically update as needed.
Stay safe!