PDA

View Full Version : walkToTileMS/walkToTileMM



kingarabian
07-25-2017, 11:37 PM
Is there any particular reason on to why there's no randomization when Reflect.Mouse.Move is initiated within the two functions? The randomness is at 0,0 for both functions. So with the way things currently stand, if you use walkToTileMS/walkToTileMM, your mouse coordinates will always be static when the mouse clicks on the specified tile. Meaning, it'll click on the tile but with the same mouse coordinates each time. So you'll be a big ban risk if your script has a short walking path or simply deals with specific tiles.

The fix for this is just to increase the randomness from the current values of 0,0.

function TReflectLocalPlayer.WalkToTileMM(Tile: TTile): Boolean;
var
Point: TPoint;
begin
Result := False;
if not Reflect.Map.TileOnMM(Tile) then
Exit;
Point := Reflect.Tiles.TileToMM(Tile);
Reflect.Mouse.Move(Point, 0, 0);
Wait(RandomRange(150, 220));
Reflect.Mouse.Click(Mouse_Left);
Result := True;
end;

function TReflectLocalPlayer.WalkToTileMS(Tile: TTile): Boolean;
var
Point: TPoint;
Timer: TReflectTimer;
begin
if not IsLoggedIn then
Exit;
Point := Reflect.Tiles.TileToMS(Tile);
if (Point.X = -1) or (Point.Y = -1) then
Exit;
Reflect.Mouse.Move(Point, 0, 0);
Wait(RandomRange(50, 100));
if Reflect.Text.IsUpText('Walk here', 50) then
Reflect.Mouse.Click(Mouse_Left)
else
begin
Reflect.Mouse.Click(Mouse_Right);
Wait(RandomRange(400, 500));
if not Reflect.Text.ChooseOption('Walk here') then
Reflect.Text.ChooseOption('Cancel')
end;
Timer.Start;
while not Self.IsMoving do
begin
if Timer.ElapsedTime > 2500 then
Break;
Wait(150);
end;
Timer.Restart;
while Self.IsMoving do
Wait(250);
Result := Timer.ElapsedTime < 30000;
end;

jstemper
07-26-2017, 01:03 AM
Why not just pm a reflection dev and ask them? For WalkToTileMM it makes more sense to have it accurately click a tile on the minimap. Just look at how it is used in the include... Blindwalk functions paired with WindPath (adds randomness). And WalkStraightPathMM (emphasis on StraightPath). Now for WalkToTileMS I do agree with you, it could use some randomness. But imo you are better off adding randomness via the TileToMS parameter offsets, instead of reflect.mouse.move. Nothing is stopping anyone from editing the include to their liking/preferences though...

kingarabian
07-26-2017, 07:39 PM
Why not just pm a reflection dev and ask them? For WalkToTileMM it makes more sense to have it accurately click a tile on the minimap. Just look at how it is used in the include... Blindwalk functions paired with WindPath (adds randomness). And WalkStraightPathMM (emphasis on StraightPath). Now for WalkToTileMS I do agree with you, it could use some randomness. But imo you are better off adding randomness via the TileToMS parameter offsets, instead of reflect.mouse.move. Nothing is stopping anyone from editing the include to their liking/preferences though...

I have no idea what you just said.

The point here is that walkToTileMS/walkToTileMM do not have a problem with clicking tiles. They have a problem in that the Tile is being clicked on at the same MOUSE COORDS.

Example of clicking a tile without randomization within the walkToTileMS function:


ClickTileMousePointsArray[
{X = 288, Y = 174},
{X = 288, Y = 174},
{X = 288, Y = 174},
{X = 288, Y = 174},
{X = 288, Y = 174},
{X = 288, Y = 174},
{X = 288, Y = 174},
{X = 288, Y = 174},
{X = 288, Y = 174},
{X = 288, Y = 174}]

Example of clicking a tile with randomization within the walkToTileMS function:


ClickTileMousePointsArray[
{X = 263, Y = 168},
{X = 295, Y = 175},
{X = 292, Y = 175},
{X = 287, Y = 175},
{X = 288, Y = 178},
{X = 289, Y = 169},
{X = 286, Y = 177},
{X = 283, Y = 172},
{X = 289, Y = 176},
{X = 287, Y = 171},
{X = 284, Y = 171},

Both instances, the tile is 100% accurately clicked. However, one instance (the first one) is clicking the tile with the same mouse coordinates each time. That's a big flag if you're simply using walkToTileMS/walkToTileMM

slacky
07-27-2017, 07:00 AM
I'll tell you why! It's because we want reflection include users/scripters to be banned!
[PS: That's not the only place last I checked - All Reflection scripters must be banished, long live color, reflection sucks, learn to script, /slacky out]

- Happy scripting

Flight
07-27-2017, 01:43 PM
I'll tell you why! It's because we want reflection include users/scripters to be banned!
[PS: That's not the only place last I checked - All Reflection scripters must be banished, long live color, reflection sucks, learn to script, /slacky out]

- Happy scripting

Hahaha that caught me off guard...

My assumption is because the Reflection include is official so pretty much custom or random anything is out of the question because otherwise it might cause arguments from users whose game play doesn't mimic the way it functions. For example, you might have something like "walkToTile()" that, by default, adds a 5 pixel randomness to that exact point on the minimap in which it clicks. Some users might say "That's great, +/-5 is a perfect amount of randomness considering inaccurate (actual) player clicking" while others would argue "Far too random, I never get to the exact tile I need to walk to". Having none, even though it's unwise and may not be favored by some, puts the include in a neutral zone, hopefully avoiding criticism. At least this is my theory, I've nothing to do with the Reflection include so it's just my $0.02.

It's related to one of the biggest reasons AeroLib exists rather than my personal work going into an official include: I can make it as custom, as random, and as human-like as I want without forcing anyone to utilize my code for their scripts. AeroLib is simply an alternative to script with.

kingarabian
07-27-2017, 11:34 PM
Hahaha that caught me off guard...

My assumption is because the Reflection include is official so pretty much custom or random anything is out of the question because otherwise it might cause arguments from users whose game play doesn't mimic the way it functions. For example, you might have something like "walkToTile()" that, by default, adds a 5 pixel randomness to that exact point on the minimap in which it clicks. Some users might say "That's great, +/-5 is a perfect amount of randomness considering inaccurate (actual) player clicking" while others would argue "Far too random, I never get to the exact tile I need to walk to". Having none, even though it's unwise and may not be favored by some, puts the include in a neutral zone, hopefully avoiding criticism. At least this is my theory, I've nothing to do with the Reflection include so it's just my $0.02.

It's related to one of the biggest reasons AeroLib exists rather than my personal work going into an official include: I can make it as custom, as random, and as human-like as I want without forcing anyone to utilize my code for their scripts. AeroLib is simply an alternative to script with.

I understand the neutral stance. But there should at least be an argument within the function to adjust the randomness so users will know that there is none. Just as we do with the old school SRL functions (MMouse(x,y) etc).