Profile for another BoT . I am not sure how to make it work for HB
I hope some one can convert this in to a HB farm profile
Tilling = {}
------- Configuration section -------
-- set to 1 for more verbose logging
Tilling.DebugLevel = 1;
-- Grind out reputation for pandaria factions using the farm.
Tilling.PandariaRepGrindMode = 0;
-- which seed to plant when not rep grinding
Tilling.PlantSeedId = 89233; -- 89233 = "Songbell" seed
Tilling.BeforeTillersReveredSeedId = 80590; -- 80590 = "Juicycrunch Carrot" seed
-- buy seed bags if available (starting at revered tillers reputation)
Tilling.BuySeedBags = 1;
-- which pandaria faction to grind reputation for
-- can be one of: "auto", "dominance_offensive", "operation_shieldwall", "golden_lotus", "shado_pan", "august_celestials", "klaxxi"
-- "auto" will grind reputation for all factions you are not 999/999 exalted with yet starting with those you have the most rep with already
Tilling.PandariaRepGrindModeFaction = "auto";
-- do work order dailies even if exalted with the pandaria factions
Tilling.ForceRepGrindMode = 0;
-- Force grind Tillers rep? This mode will harvest bursting crops, destroy all normal growing
-- crops and repeat
Tilling.TillersEndlessMode = 0;
------- End of configuration section -------
Tilling.DoneLanes = {}
Tilling.PlantSeedIds = {};
Tilling.TotalPlots = 0;
Tilling.RepGrindFactions = {
["dominance_offensive"] = {
["name"] = "Dominance Offensive",
["player_faction"] = 0,
["faction_id"] = 1375,
["seed_id"] = 80593,
["step_1_quest"] = 32642,
["step_2_quest"] = 32643
},
["operation_shieldwall"] = {
["name"] = "Operation Shieldwall",
["player_faction"] = 1,
["faction_id"] = 1376,
["seed_id"] = 89326,
["step_1_quest"] = 32645,
["step_2_quest"] = 32646
},
["golden_lotus"] = {
["name"] = "Golden Lotus",
["faction_id"] = 1269,
["seed_id"] = 80595,
["step_1_quest"] = 32647,
["step_2_quest"] = 32648
},
["shado_pan"] = {
["name"] = "Shado-Pan",
["faction_id"] = 1270,
["seed_id"] = 79102,
["step_1_quest"] = 32649,
["step_2_quest"] = 32650
},
["august_celestials"] = {
["name"] = "The August Celestials",
["faction_id"] = 1341,
["seed_id"] = 89329,
["step_1_quest"] = 32653,
["step_2_quest"] = 32657
},
["klaxxi"] = {
["name"] = "The Klaxxi",
["faction_id"] = 1337,
["seed_id"] = 80592,
["step_1_quest"] = 32658,
["step_2_quest"] = 32659
}
}
Tilling.YoonQuests = {
[31672] = 80592,
[31942] = 89329,
[31673] = 80593,
[31941] = 89328,
[31670] = 80590,
[31669] = 79102,
[31674] = 80594,
[31675] = 80595,
[31943] = 89326,
[31671] = 80591
}
Tilling.SeedVendor = {
["name"] = "Merchant Greenfield",
["id"] = 58718,
["waypoint"] = {-234.487,587.89,167.643},
["walk_to"] = {-268.316,603.411,167.548}
}
Tilling.GardeningTools = {
{
["name"] = "Vintage Bug Sprayer",
["item_id"] = 80513,
["object_id"] = 211331,
["skip"] = function() if Tilling.TotalPlots == 1 or (Tilling.TotalPlots == 2 and GetObjectByID(Tilling.BulkGardeningTools.repellers[1]) == 0) or Tilling.TotalPlots == 3 or (Tilling.TotalPlots == 4 and GetObjectByID(Tilling.BulkGardeningTools.repellers[2]) == 0) then return 0 else return 1 end end
},
{
["name"] = "Rusty Watering Can",
["item_id"] = 79104,
["object_id"] = 211330,
["skip"] = function() if Tilling.TotalPlots == 1 or (Tilling.TotalPlots == 2 and GetObjectByID(Tilling.BulkGardeningTools.sprinklers[1]) == 0) or Tilling.TotalPlots == 3 or (Tilling.TotalPlots == 4 and GetObjectByID(Tilling.BulkGardeningTools.sprinklers[2]) == 0) then return 0 else return 1 end end
},
{
["name"] = "Dented Shovel",
["item_id"] = 89880,
["object_id"] = 215719,
["skip"] = function() if Tilling.TillersEndlessMode == 1 then return 0 else return 1 end end
},
{
["name"] = "Master Plower",
["item_id"] = 89815,
["object_id"] = 215698,
["skip"] = function() if Tilling.TotalPlots == 4 then return 0 else return 1 end end
}
}
Tilling.SeedBagPositions = {
{-169.389;639.76;165.41},
{-169.674;648.307;165.41},
{-154.178;649.213;165.41},
{-153.214;640.603;165.41}
}
Tilling.PlowPositions = {
{-171.428;633.416;165.409;1},
{-166.731,653.804,165.409;1},
{-155.77,635.865,165.409;1},
{-151.725,653.482,165.409;1}
}
Tilling.BulkGardeningTools = {
["repellers"] = {215162,215163},
["sprinklers"] = {215135,215137}
}
Tilling.CropLocations = {
-- first patch
{
{-172.036,637.776,165.409},
{-166.274,637.094,165.409},
{-166.781,641.316,165.409},
{-172.022,642.157,165.409}
},
-- second patch
{
{-171.902,646.503,165.409},
{-166.631,645.583,165.409},
{-166.712,649.865,165.409},
{-172.751,650.672,165.409}
},
-- third patch
{
{-157.057,651.572,165.409},
{-150.850,650.656,165.409},
{-150.979,646.145,165.409},
{-156.996,647.659,165.409}
},
-- fourth patch
{
{-156.133,643.073,165.409},
{-150.537,642.583,165.409},
{-150.857,638.232,165.409},
{-156.468,638.921,165.409}
}
}
Tilling.SeedBags = {
-- Green Cabbage
[79102] = 80809,
-- Juicycrunch
[80590] = 84782,
-- Scallion
[80591] = 84783,
-- Mogu Pumpkin
[80592] = 85153,
-- Red Blossom Leek
[80593] = 85158,
-- Pink Turnip
[80594] = 85162,
-- White Turnip
[80595] = 85163,
-- Jade Squash
[89328] = 89848,
-- Witchberry
[89326] = 89847,
-- Striped Melon
[89329] = 89849,
-- Enigma
[85216] = 95449,
-- Magebulb
[85217] = 95451,
-- Raptorleaf
[89202] = 95457,
-- Snakeroot
[85215] = 95447,
-- Windshear Cactus
[89197] = 95454,
-- Songbell
[89233] = 95445
}
function Tilling.LogMsg(text)
if (Tilling.DebugLevel > 0) then
_Log(text);
end
end
function Tilling.RepRequired(faction_id)
WowLuaDoString(string.format('_,_,_,_,_,rep,_,_,_,_,_,_,_=GetFactionInfoByID(%d)', faction_id));
local currentrep = tonumber(WowGetLuaValue("rep"));
return 42999 - currentrep;
-- return 43000 - currentrep;
end
function Tilling.DoFightWith(obj, sleep, id, is_npc, cancel_shapeshift)
Tilling.LogMsg("starting DoFightWith");
Tilling.DoInteractWith(obj, sleep, -1, is_npc, cancel_shapeshift);
local TargetGUID = 0;
local targetobj = 0;
repeat
WowLuaDoString("creatureID=0 TargetNearestEnemy(false) if (UnitExists('target')) then guid = UnitGUID('target') creatureID = tonumber('0x'..strsub(guid,7,10)) end");
TargetGUID = tonumber(WowGetLuaValue("creatureID"));
targetobj = GetObjectByID(TargetGUID);
Sleep(200);
until TargetGUID ~= 0 and targetobj ~= 0 and Tilling.Distance(GetUnitPos(GetPlayer()), GetUnitPos(targetobj)) <= 5;
Tilling.LogMsg("Target GUID: ".. TargetGUID);
Tilling.LogMsg("Target object address: ".. targetobj);
Tilling.LogMsg("Target object location: ");
Tilling.LogBotPos(GetUnitPos(targetobj));
Tilling.LogMsg("handing over control to bot KillMob()");
-- Sleep(sleep);
KillMob(targetobj);
-- FightCheck();
Tilling.LogMsg("received control back from bot");
Tilling.WaitForDespawn(obj, id);
Tilling.LogMsg("ending DoFightWith");
end
function Tilling.DoWrestleWith(obj, sleep, id, is_npc, cancel_shapeshift, spellid)
Tilling.LogMsg("starting DoWrestleWith");
Tilling.DoInteractWith(obj, sleep, -1, is_npc, cancel_shapeshift);
while Tilling.InVehicle() ~= 1 do Sleep(200) end;
while Tilling.InVehicle() == 1 do
-- Tilling.LogMsg("in vehicle");
CastSpellByID(spellid, nil, true);
end
Tilling.WaitForDespawn(obj, id);
Tilling.LogMsg("ending DoWrestleWith");
end
function Tilling.DoSnapWith(obj, sleep, id)
Tilling.LogMsg("starting DoSnapWith");
Tilling.DoInteractWith(obj, sleep);
Tilling.WalkTo({-191.029,625.291,165.768});
Tilling.WalkTo(Tilling.CropLocations[1][1]);
Tilling.WaitForDespawn(obj, id);
Tilling.LogMsg("ending DoSnapWith");
end
function Tilling.DoTillSoil(obj, sleep, id, is_npc, cancel_shapeshift)
Tilling.LogMsg("starting DoTillSoil");
local pos = GetUnitPos(obj);
local lane = Tilling.PosIsLane({pos[0], pos[1], pos[2]});
Tilling.LogMsg("found lane: " .. lane);
if Tilling.HasNumItems(89815) == 0 or Tilling.DoneLanes[lane] == 1 then
-- no master plower
Tilling.DoInteractWith(obj, sleep, id, is_npc, cancel_shapeshift);
else
Tilling.DoneLanes[lane] = 1;
-- SetTarget(obj);
Tilling.WalkTo(Tilling.PlowPositions[lane]);
local face_target = function()
local should_patch;
if lane == 1 then
should_patch = {1,4};
elseif lane == 2 then
should_patch = {1,2};
elseif lane == 3 then
should_patch = {3,1};
elseif lane == 4 then
should_patch = {4,3};
else
error("Invalid lane.");
end
local object_list = GetObjectList();
for _, object in ipairs(object_list) do
if GetObjectType(object) == 3 then
local unit_pos = GetUnitPos(object);
local exact_patch = Tilling.PosIsExactPatch({unit_pos[0], unit_pos[1], unit_pos[2]});
if exact_patch ~= nil and exact_patch[1] == should_patch[1] and exact_patch[2] == should_patch[2] then
FaceTarget(object);
break;
end
end
end
end
face_target();
WowLuaDoString("UseItemByName(89815)");
Sleep(5000);
local mob = GetObjectByID(70447);
if mob ~= 0 then
if lane <= 2 then
Tilling.WalkTo({-169.502;643.547;165.409});
else
Tilling.WalkTo({-154.01;644.72;165.409});
end
KillMob(mob);
while Tilling.InCombat() == true do
mob = GetObjectByID(70447);
if mob ~= 0 and IsUnitAlive(mob) == true then
KillMob(mob);
else
--FightCheck();
Sleep(500);
end
end
else
Sleep(sleep);
end
end
Tilling.LogMsg("ending DoTillSoil");
end
function Tilling.InCombat(target)
if target == nil then target = "player" end;
WowLuaDoString("combat=UnitAffectingCombat('" .. target .. "')");
if WowGetLuaValue("combat") == "1" then
return true;
else
return false;
end
end
function Tilling.DoInteractWith(obj, sleep, id, is_npc, cancel_shapeshift)
Tilling.LogMsg("starting DoInteractWith");
if sleep == nil then sleep = 0 end;
if is_npc == nil then is_npc = 1 end;
if id == nil then id = -1 end;
local pos;
if is_npc == 1 then
pos = GetUnitPos(obj);
else
pos = GetObjectPos(obj);
end
Tilling.LogMsg("starting to walk to " .. obj);
Tilling.WalkTo({ pos[0], pos[1], pos[2] });
Tilling.LogMsg("finished walking");
if cancel_shapeshift == 1 then
WowLuaDoString("index = GetShapeshiftForm()");
if tonumber(WowGetLuaValue("index")) > 0 then
Tilling.LogMsg("cancelling shapeshift");
WowLuaDoString("CancelShapeshiftForm()");
end
end
Tilling.LogMsg("interacting with " .. obj);
InteractWith(obj);
Sleep(sleep);
Tilling.LogMsg("ending DoInteractWith");
end
function Tilling.DoPlantSeed(obj, sleep, id, is_npc, cancel_shapeshift)
for _, seed in ipairs(Tilling.PlantSeedIds) do
if seed.count > 0 then
if Tilling.HasNumItems(seed.id) > 0 then
SetTarget(obj);
Tilling.DoInteractWith(obj);
Tilling.UseItemByID(seed.id);
seed.count = seed.count - 1;
elseif Tilling.HasNumItems(Tilling.SeedBags[seed.id]) > 0 then
if Tilling.Distance(GetUnitPos(GetPlayer()), Tilling.CropLocations[1][1], 0, 1) > 2 then
Tilling.WalkTo(Tilling.CropLocations[1][1]);
end
local pos = GetUnitPos(obj);
local patch = Tilling.PosIsPatch({pos[0],pos[1],pos[2]});
if patch == nil then error("invalid patch") end;
local target = Tilling.SeedBagPositions[patch];
Tilling.UseItemByID(Tilling.SeedBags[seed.id]);
DoTerrainClick(target[1], target[2], target[3]);
seed.count = seed.count - 4;
else
error("Ran out of seeds. Shouldn't have happpened.");
end
break;
end
end
Sleep(3000);
end
function Tilling.DoWaterWith(obj, sleep, id)
local sprinkler = 0;
local pos = GetUnitPos(obj);
local posispatch = Tilling.PosIsPatch({pos[0],pos[1],pos[2]});
if posispatch ~= nil and posispatch <= 2 then
sprinkler = GetObjectByID(Tilling.BulkGardeningTools.sprinklers[1]);
elseif posispatch ~= nil and posispatch >= 3 then
sprinkler = GetObjectByID(Tilling.BulkGardeningTools.sprinklers[2]);
end
if sprinkler ~= 0 then
Tilling.DoInteractWith(sprinkler, sleep, -1, 0);
Sleep(3000);
else
Tilling.DoInteractWith(obj, sleep);
Tilling.UseItemByID(79104);
Tilling.WaitForDespawn(obj, id);
end
end
function Tilling.DoBugSprayWith(obj, sleep, id)
local repeller = 0;
local pos = GetUnitPos(obj);
local posispatch = Tilling.PosIsPatch({pos[0],pos[1],pos[2]});
if posispatch ~= nil and posispatch <= 2 then
repeller = GetObjectByID(Tilling.BulkGardeningTools.repellers[1]);
elseif posispatch ~= nil and posispatch >= 3 then
repeller = GetObjectByID(Tilling.BulkGardeningTools.repellers[2]);
end
if repeller ~= 0 then
Tilling.DoInteractWith(repeller, sleep, -1, 0);
Sleep(3000);
else
Tilling.DoInteractWith(obj, sleep);
Tilling.UseItemByID(80513);
Tilling.WaitForDespawn(obj, id);
end
end
function Tilling.DoJumpWith(obj, sleep, id)
Tilling.DoInteractWith(obj, sleep);
WowLuaDoString('JumpOrAscendStart()');
Tilling.WaitForDespawn(obj, id);
end
function Tilling.DoRazeWith(obj, sleep, id)
SetTarget(obj);
Tilling.DoInteractWith(obj, sleep);
Tilling.UseItemByID(89880);
Tilling.WaitForDespawn(obj, id);
end
Tilling.Crops = {
{
["name"] = "Green Cabbage",
["alluring"] = 60070,
["bursting"] = 63157,
["growing"] = 58566,
["infested"] = 60026,
["parched"] = 58565,
["plump"] = 60113,
["ripe"] = 58567,
["runty"] = 60218,
["smothered"] = 60181,
["tangled"] = 60270,
["wiggling"] = 60029,
["wild"] = 60207
},
{
["name"] = "Juicycrunch Carrot",
["alluring"] = 63147,
["bursting"] = 63158,
["growing"] = 63153,
["infested"] = 63145,
["parched"] = 63144,
["plump"] = 63156,
["ripe"] = 63154,
["runty"] = 63150,
["smothered"] = 63148,
["tangled"] = 63151,
["wiggling"] = 63146,
["wild"] = 63149
},
{
["name"] = "Scallions",
["alluring"] = 63159,
["bursting"] = 63160,
["growing"] = 63161,
["infested"] = 63162,
["parched"] = 63163,
["plump"] = 63164,
["ripe"] = 63165,
["runty"] = 63166,
["smothered"] = 63167,
["tangled"] = 63168,
["wiggling"] = 63169,
["wild"] = 63170
},
{
["name"] = "Mogu Pumpkin",
["alluring"] = 63178,
["bursting"] = 63180,
["growing"] = 63181,
["infested"] = 63182,
["parched"] = 63183,
["plump"] = 63184,
["ripe"] = 63185,
["runty"] = 63186,
["smothered"] = 63187,
["tangled"] = 63188,
["wiggling"] = 63189,
["wild"] = 63190
},
{
["name"] = "Red Blossom Leek",
["alluring"] = 63222,
["bursting"] = 63223,
["growing"] = 63224,
["infested"] = 63226,
["parched"] = 63227,
["plump"] = 63228,
["ripe"] = 63229,
["runty"] = 63230,
["smothered"] = 63231,
["tangled"] = 63232,
["wiggling"] = 63233,
["wild"] = 63234
},
{
["name"] = "Pink Turnip",
["alluring"] = 63243,
["bursting"] = 63245,
["growing"] = 63246,
["infested"] = 63247,
["parched"] = 63248,
["plump"] = 63249,
["ripe"] = 63250,
["runty"] = 63251,
["smothered"] = 63252,
["tangled"] = 63253,
["wiggling"] = 63254,
["wild"] = 63255
},
{
["name"] = "White Turnip",
["alluring"] = 63259,
["bursting"] = 63260,
["growing"] = 63261,
["infested"] = 63262,
["parched"] = 63263,
["plump"] = 63264,
["ripe"] = 63265,
["runty"] = 63267,
["smothered"] = 63268,
["tangled"] = 63269,
["wiggling"] = 63270,
["wild"] = 63271
},
{
["name"] = "Jade Squash",
["alluring"] = 66107,
["bursting"] = 66108,
["growing"] = 66109,
["infested"] = 66110,
["parched"] = 66111,
["plump"] = 66112,
["ripe"] = 66113,
["runty"] = 66114,
["smothered"] = 66115,
["tangled"] = 66116,
["wiggling"] = 66117,
["wild"] = 66118
},
{
["name"] = "Witchberries",
["alluring"] = 66079,
["bursting"] = 66080,
["growing"] = 66081,
["infested"] = 66082,
["parched"] = 66083,
["plump"] = 66084,
["ripe"] = 66085,
["runty"] = 66086,
["smothered"] = 66087,
["tangled"] = 66088,
["wiggling"] = 66089,
["wild"] = 66090
},
{
["name"] = "Striped Melon",
["alluring"] = 66122,
["bursting"] = 66123,
["growing"] = 66124,
["infested"] = 66125,
["parched"] = 66127,
["plump"] = 66128,
["ripe"] = 66129,
["runty"] = 66130,
["smothered"] = 66131,
["tangled"] = 66132,
["wiggling"] = 66133,
["wild"] = 66134
},
{
["name"] = "Autumn Blossom",
["growing"] = 66172,
["ripe"] = 66175
},
{
["name"] = "Spring Blossom",
["growing"] = 66189,
["ripe"] = 66192
},
{
["name"] = "Winter Blossom",
["growing"] = 66171,
["ripe"] = 66173
},
{
["name"] = "Enigma",
["alluring"] = 65913,
["growing"] = 65916,
["infested"] = 65918,
["parched"] = 65919,
["ripe"] = { 65929, 65930, 65931, 65932, 65933, 65938 },
["runty"] = 65920,
["smothered"] = 65921,
["tangled"] = 65922,
["wiggling"] = 65924,
["wild"] = 65925
},
{
["name"] = "Magebulb",
["alluring"] = 65985,
["growing"] = 65986,
["infested"] = 65987,
["parched"] = 65988,
["ripe"] = 65989,
["runty"] = 65990,
["smothered"] = 65991,
["tangled"] = 65992,
["wiggling"] = 65993,
["wild"] = 65994
},
{
["name"] = "Raptorleaf",
["alluring"] = 66012,
["growing"] = 66013,
["infested"] = 66014,
["parched"] = 66015,
["ripe"] = 66016,
["runty"] = 66017,
["smothered"] = 66018,
["tangled"] = 66019,
["wiggling"] = 66020,
["wild"] = 66021
},
{
["name"] = "Snakeroot",
["alluring"] = 65964,
["growing"] = 65965,
["infested"] = 65966,
["parched"] = 65967,
["ripe"] = 65973,
["runty"] = 65968,
["smothered"] = 65969,
["tangled"] = 65970,
["wiggling"] = 65971,
["wild"] = 65972
},
{
["name"] = "Windshear Cactus",
["alluring"] = 66002,
["growing"] = 66003,
["infested"] = 66004,
["parched"] = 66005,
["ripe"] = 66006,
["runty"] = 66007,
["smothered"] = 66008,
["tangled"] = 66009,
["wiggling"] = 66010,
["wild"] = 66011
},
{
["name"] = "Songbell",
["alluring"] = 66039,
["growing"] = 66040,
["infested"] = 66041,
["parched"] = 66042,
["ripe"] = 66043,
["runty"] = 66044,
["smothered"] = 66045,
["tangled"] = 66046,
["wiggling"] = 66047,
["wild"] = 66048
},
{
["name"] = "Portal Shard",
["unstable"] = 67446,
["growing"] = 67482,
["stable"] = 67486
}
}
Tilling.Soils = {
{
["name"] = "Stubborn Weed",
["id"] = 60153,
["action"] = Tilling.DoWrestleWith,
["sleep"] = 500,
["spellid"] = 115857
},
{
["name"] = "Untilled Soil",
["id"] = 58562,
["action"] = Tilling.DoTillSoil,
["sleep"] = 3000,
["unshift"] = 1
},
{
["name"] = "Occupied Soil",
["id"] = 60172,
["action"] = Tilling.DoFightWith,
["sleep"] = 3000
},
{
["name"] = "Untilled Soil",
["id"] = 58562,
["action"] = Tilling.DoInteractWith,
["sleep"] = 3000,
["unshift"] = 1
},
{
["name"] = "Tilled Soil",
["id"] = 58563,
["action"] = Tilling.DoPlantSeed,
["sleep"] = 500
}
}
Tilling.CropFixes = {
{
["name"] = "wiggling",
["action"] = Tilling.DoFightWith,
["sleep"] = 3000
},
{
["name"] = "alluring",
["action"] = Tilling.DoFightWith,
["sleep"] = 3000
},
{
["name"] = "unstable",
["action"] = Tilling.DoFightWith,
["sleep"] = 3000
},
{
["name"] = "infested",
["action"] = Tilling.DoBugSprayWith,
["sleep"] = 500
},
{
["name"] = "parched",
["action"] = Tilling.DoWaterWith,
["sleep"] = 500
},
{
["name"] = "runty",
["action"] = Tilling.DoJumpWith,
["sleep"] = 3000
},
{
["name"] = "wild",
["action"] = Tilling.DoWrestleWith,
["sleep"] = 500,
["spellid"] = 116073
},
{
["name"] = "tangled",
["action"] = Tilling.DoSnapWith,
["sleep"] = 1000
}
}
Tilling.CropDestructions = {
{
["name"] = "growing",
["action"] = Tilling.DoRazeWith,
["sleep"] = 500
}
}