Better than always returning to a set point after killing a dog, would be to have multiple (4, 5, or more) spots and have the bot randomly determine which spot to go to after killing a dog. More random looks much better and less botty.
For example in my butterflies script, My bot has 4 possible areas to kill the butterflies in (Outer Right, Inner Right, Inner Left, and Outer Left). Also, the path the bot takes to get there is random as well. It may run around the first set of 4 dogs so as to not draw aggro, or it may run straight through. It may pass them on the left, or on the right. In the area where the first Copper Gardener is, depending if It decided to farm left or right butterflies, it will go the coinciding direction but it may go around the outside, or it may take a more direct route through the dogs and gardener area. It would be very difficult for someone to easily notice that it's a bot unless they watch it for several rounds of butterflies.
For the dogs, in fact, instead of having 4 or 5 set coordinates to go to after killing a dog, you could have multiple areas where the X and Z values are random within a certain area. Say for example you want your bot to go somewhere between X of 1200 and 1500 and a Z of between 750 and 1020. Then you just do random numbers for each coordinate value. The only trick for doing it this way would be making it go to a waypoint of random numbers (or variables that were created randomly). I haven't figured out a way to do that and don't know if it's possible. Maybe something like this would work. I haven't testing it so it may need some work.
Code: Select all
function KillDogs()
local meatWanted = 990 -- stop when we have 10 stacks
repeat
local myX = math.random(1200,1500)
local myZ = math.random(750,1020)
player:moveTo(CWaypoint(myX,myZ), true)
while not player.Battling do
yrest(100)
local dog = player:findNearestNameOrId("Infernal Guard Dog")
if 400 > distance(dog, player) then
player:target_Object(dog.Id)
Attack()
end
end
local meatOnHand = inventory:itemTotalCount("Guard Dog Meat","bags")
until meatOnHand >= meatWanted
end
Of course, it will have to have some tweaking done to it to make it work how you want it, but this is the general idea of what I would try.