-
Member
-
Member
Originally Posted by
stonebent
Instead of having actual color codes, use a texture along with SetTexCoord.
It does the trick.
Do you mean using hundreds of pictures with different colors in them? And then having the addon to change the picture of the texture instead of just changing the color with SetColorTexture?
-
Member
Hello, the weakaura works for me outside of BGs, but in AV it stops working, anyone who has the same issue can help me ?
-
Last edited by GlittPrizes; 04-29-2020 at 09:35 PM.
-
Nice! I finally got it reading the pixels:
Player Stats.jpg
Last edited by GlittPrizes; 05-01-2020 at 07:22 PM.
Reason: blah
-
Originally Posted by
Evildev
Hello, the weakaura works for me outside of BGs, but in AV it stops working, anyone who has the same issue can help me ?
You have to read memory to do stuff in instances and BG's. Blizzard did that to prevent bots that can farm instances all day, but instance farming is pretty dead now anyways compared to the actual lucrative stuff. I think Interact with target is also disabled in BG's, so that multiboxers can only do their thing in the open world. You have to have pure math based steering if you want to pixel bot in instances. You could in theory use some of the ideas like a target marker being read along lua error messages to do it, but you might as well focus that energy on a memory bot at that point.
-
Member
Thanks for your reply hycolyte, i will dedicate some months in creating a pixel bot without reading memory to leech av honor but mostly to learn, if anyone has any source code he can share with me i would like to see it for learning purposes only
-
Originally Posted by
Evildev
Thanks for your reply hycolyte, i will dedicate some months in creating a pixel bot without reading memory to leech av honor but mostly to learn, if anyone has any source code he can share with me i would like to see it for learning purposes only
On second thought I found there are ways to still face your target in AV. There are several quest items that exist in retail at least (not sure about classic) that will face your target. Certain spells also have this behavior. However, I don't think there is a way to get your coords, so you would be without navigation.
How should I send keypresses though? I get disconnected from using PostMessage after like 5 minutes. Maybe it's something else, I can't properly diagnose it.
Update edit: the disconnects seem to be from immediately interacting with a new target while turning with virtual keypresses. Humanized timing/safe randoms didn't matter it was simply turning/interacting together that would disconnect.
Last edited by GlittPrizes; 06-09-2020 at 05:14 AM.
Reason: update
-
I was able to get it working as a blazor app
Last edited by GlittPrizes; 05-14-2020 at 12:25 AM.
Reason: spacing
-
Member
I stumbled across this post and since i dabble with programming from time to time I decided to see what I could do with the information provided. I actually surprised myself with the progress I have made. I am able to record and follow a route. The bot will check for targets periodically and when it finds one will engage in combat. I did not plan out my code or have any idea what I was getting myself into and its starting to become difficult to make sense of it. I spent far too long writing the algorithm to turn the player the shortest direction especially across the 0/360 degree value. I believe I need to implement some FSM but I still don't understand them. Just wanted to say thanks for the information here and leave my two cents.
-
Here are some important functions I use you might find helpful for turning:
Turn
Code:
public void Turn(object sender)
{
if (!GameData.HasTarget)
{
var turnDegrees = GetTurnDegs(DegToTarget(Next));
bool turnRight = GetTurnDir(turnDegrees.Item1, turnDegrees.Item2);
int turnTime;
if (!turnRight)
turnTime = GetTurnTime(turnDegrees.Item1);
else
turnTime = GetTurnTime(turnDegrees.Item2);
KeyWrap turnKey;
if (turnRight)
turnKey = Keys.TurnRight;
else
turnKey = Keys.TurnLeft;
if (turnTime > MIN_TURN_TIME)
{
turnKey.PressKey(ID);
Thread.Sleep(turnTime);
turnKey.ReleaseKey(ID);
}
}
}
Turn Functions
Code:
int DegToTarget(PointF point)
{
var angle = Math.Atan2(Location.X - point.X, Location.Y - point.Y);
var degree = angle * 57.2958;
degree = degree % 360;
return (int)degree;
}
Tuple<int, int> GetTurnDegs(int degToTarget)
{
int facing = Facing;
int degreesLeft = degToTarget - facing;
int degreesRight = facing - degToTarget;
if (degreesLeft < 0) degreesLeft += 360;
if (degreesRight < 0) degreesRight += 360;
return new Tuple<int, int>(degreesLeft, degreesRight);
}
bool GetTurnDir(float degreesLeft, float degreesRight)
{
return degreesRight < degreesLeft ? true : false;
}
int GetTurnTime(int turnDegrees)
{
float radians = (float)(turnDegrees * 0.0174533);
return (int)(1000 * (radians / Math.PI));
}
Last edited by GlittPrizes; 06-09-2020 at 05:08 AM.
Reason: locks
-
Post Thanks / Like - 2 Thanks
-
Member
Nice, this is what I settled on after a couple hours in bed awake one night after having too much caffeine.
Code:
// CALCULATE ANGLE
double r = Math.Atan2(-target.Y, target.X); // Radians, WoW is Y+ down so invert the Y value
double a = r * (180 / Math.PI); // Convert radians to degrees
a = (a < 0) ? a += 360 : a; // Convert to 360 instead of 180-(-179)
double f = player.Facing; // Angle the player is facing in degrees
double error = f - a;
if (Math.Abs(error) > 180)
{
f = (f < a) ? player.Facing + 360 : player.Facing - 360;
error = f - a; // Recalculate the error for the new angle
}
If the error is negative i turn the player left, if its positive i turn the player right instead.
-
Post Thanks / Like - 1 Thanks
GlittPrizes (1 members gave Thanks to tessier-ashpool for this useful post)
-
Member
Thank you for the pixel bot idea with c# but i am missing the function that decodes the RGB colour. Anyone who can help me pls?
-
Originally Posted by
Plobbi
Thank you for the pixel bot idea with c# but i am missing the function that decodes the RGB colour. Anyone who can help me pls?
Code:
int ColorToInt(Color color)
{
return (int)(Math.Pow(256, 2) * color.R + 256 * color.G + color.B);
}
And this is what I use for the lua code to generate the RGB int
Code:
function IntToRGB(n)
if n >= (math.pow(256,3)) then -- 16777215 is the MAX_RGB_INT
error("Can't encode integer (too large)")
end
local r = math.floor(n / 65536)
local g = math.floor(math.fmod(n / 256, 256))
local b = math.floor(math.fmod(n, 256))
-- RGB percent conversion
return { r = r / 255, g = g / 255, b = b / 255 }
end
-
Post Thanks / Like - 1 Thanks
Plobbi (1 members gave Thanks to GlittPrizes for this useful post)
-
Member
Originally Posted by
hycolyte
Code:
int ColorToInt(Color color)
{
return (int)(Math.Pow(256, 2) * color.R + 256 * color.G + color.B);
}
And this is what I use for the lua code to generate the RGB int
Code:
function IntToRGB(n)
if n >= (math.pow(256,3)) then -- 16777215 is the MAX_RGB_INT
error("Can't encode integer (too large)")
end
local r = math.floor(n / 65536)
local g = math.floor(math.fmod(n / 256, 256))
local b = math.floor(math.fmod(n, 256))
-- RGB percent conversion
return { r = r / 255, g = g / 255, b = b / 255 }
end
thank you so much! It works like a charm