--Gates of Kryta (Oink Oink) Farming script
local slowcpu = 0;
function main()
while (true) do
ClearConsole();
FinishRoute();
UseAbility(7, 0);
Sleep(2000);
UseAbility(6, 0);
Sleep(1500);
-- ------------------------------
Sleep(2000 + slowcpu * 3000);
GoTo(2658, 22550);
GoTo(2776, 18510);
GoTo(4908, 17513);
GoTo(5735, 17831);
GoTo(5784, 18681);
GoTo(6909, 18671);
GoTo(7405, 16065);
GoTo(8002, 15902);
GoTo(7911, 14484);
GoTo(7911, 14484);
GoTo(8640, 14400);
WaitForFoes();
end
end
--################################################## ##--
function WaitForFoes()
local BlockCnt = 0;
while(true) do
local result = Fight(150);
BlockCnt = BlockCnt + 1;
if(result == -1 or BlockCnt > 20) then
break;
end
end
if(PlayerHp > 0) then
Loot();
end
end
--################################################## ##--
function CheckItem()
if(ItemIndex == 0) then
return 0;
elseif(ItemType == 9383) then
return 0;
elseif(ItemRarity >= 2) then
return 0;
-- ------Keep Bones and Emblems----
-- elseif(ItemType == 19658) then
-- return 0;
-- elseif(ItemType == 136309) then
-- return 0;
-- ---------------------------------------
else
return 1;
end
end
function GetToolIndex()
for i = 0, 9 do
GetItem(3, i);
Sleep(200);
if (ItemType == 130582) then
return ItemIndex;
elseif (ItemType == 153970) then
return ItemIndex;
end
end
return 0;
end
function StoreGoldInVault()
TargetNpc(-510, 25387);
Sleep(5000);
StoreGold(0, GoldVault + Gold);
Sleep(100);
end
function Sell()
TargetNpc(145, 23462);
Sleep(8000);
local Tool = GetToolIndex();
for i=0, 19 do
GetItem(0, i);
Sleep(400);
if(ItemIndex == 0) then
return;
end
if(CheckItem() == 1) then
if(ItemIdentified == 0 and Tool ~= 0) then
UseItem(Tool, ItemIndex);
Sleep(200);
GetItem(0, i);
Sleep(400);
end
SellItem();
end
end
end
--################################################## ##--
function Fight(maxdistance)
while(true) do
SearchByFaction(3);
if(SearchIndex == 0) then
return -1;
end
if(SearchDistance > maxdistance) then
return;
end
TargetByIndex(0, SearchIndex);
while (TargetHpMax == 0 or TargetHp > 0) do
if (PlayerHp == 0) then
return -1;
end
if (TargetIndex == 0) then
do break end
end
--################################################## ##--
if (PlayerEnergy < 10 and IsAbilityUsable(3) and
IsEffectActiv(372) == 0) then
UseAbility(1, 0);
local time = GetTickCount();
local curtime = time;
while(curtime < time + 6000 and IsEffectActiv(380) == 1) do
if(PlayerEnergy == PlayerEnergyMax) then
break;
end
Sleep(100);
curtime = GetTickCount();
end
end
-- Zyklon Axt
if (IsAbilityUsable(0) and PlayerEnergy > 5 and
IsEffectActiv(254) == 1) then
UseAbility(0, 0);
end
-- Gladiators Defense
if (IsAbilityUsable(2) and PlayerEnergy > 15) then
UseAbility(2, 0);
end
-- ...**** BUFFS ****...
-- Vigourus Spirit
if (IsEffectActiv(254) == 0 and IsAbilityUsable(4)
and PlayerEnergy > 5) then
UseAbility(4, 0);
Sleep(800);
-- Heeling Breeze
elseif (IsEffectActiv(288) == 0 and IsAbilityUsable(3)
and PlayerEnergy > 10) then
UseAbility(3, 0);
Sleep(800);
-- Judges Insight
elseif (IsEffectActiv(267) == 0 and IsAbilityUsable(5)
and PlayerEnergy > 5) then
UseAbility(5, 0);
Sleep(1800);
end
Sleep(150);
end
end
end
--################################################## ##--
function Loot()
SearchByType(4);
if (SearchIndex ~= 0) then
if (SearchDistance > 1000) then
return;
end
TargetByIndex(0, SearchIndex);
while (TargetIndex ~= 0) do
-- wrong target
if (TargetType ~= 4) then
do break end
end
Sleep(50);
end
-- Recursive
Loot();
end
end
--################################################## ##--
function GoTo(x, y)
local text = "Goto "..x.." "..y;
Console(text);
MoveTo(x, y);
while (PlayerX ~= x and PlayerY ~= y) do
Sleep(100);
-- mob in range
SearchByFaction(3);
if(SearchIndex ~= 0 and SearchDistance < 100) then
return;
end
-- if blocked
if(IsMoving == 0) then
return;
end
end
end
--################################################## ##--
function TargetNpc(x, y)
SearchIndex = 0;
-- necessary because of loading screen
while(SearchIndex == 0) do
SearchByCoord(x, y);
Sleep(200);
end
TargetByIndex(0, SearchIndex);
end
--################################################## ##--
function FinishRoute()
GoToZone(14);
-- put gold into vault
if(Gold > 50000) then
StoreGoldInVault();
end
Sell();
EnterMission();
Sleep(5000 + slowcpu * 5000);
ClearEffectList();
while(PlayerX == 0) do -- loading screen
Sleep(100);
end
Sleep(5000 + slowcpu * 5000);
end
--################################################## ##--
function GoToZone(zone)
TravelToZone(zone);
Sleep(5000 + slowcpu * 5000);
while(PlayerX == 0) do -- loading screen
Sleep(100);
end
Sleep(5000 + slowcpu * 5000);
end
--################################################## ##--
-- entry point
main();
|