var
tx, ty, tx1, ty1, i, x, y: integer;
monsterColor, monsterColor1: TPointArray;
monsters, monsters1: T2DPointArray;
monsterPoint, monsterPoint1: TPoint;
clickPoint: TPoint;
check1, check2 : boolean;
const
CombatType = 'warrior'; //Set to either melee, range, or mage
UseAbility = True; //True or False to use abilities or not.
ColorOfMonster = 11734684; //Enter the first color of the monster
SecondMonsterColor = 11762702; //Enter the second color of the monster
maxDistance = 100; //Max distance between monster colors ( You can leave this alone )
waitTimeBetweenClicks = 1000; //Wait time between clicking monsters in miliseocnds.
UseHealthPots = True; //True or False to use Health Pots if Health gets low
UseManaPots = True; //True Or False to use Mana Potions When Mana is low
UseAutoReply = True; //Use auto reply if someone sends you a message.
ServerNum = 5; //Server to switch to if someone messages you (1-6 at the moment)
reply = 'cant talk right now, sorry'; //The message sent to someone who wispers you)
ToleranceOfMonster = 0;
procedure changeServer;
var
serverNumber, x1, y1: Integer;
begin
serverNumber := 1;
MoveMouse(1183, 32);
wait(500 + random(100));
ClickMouse(1183, 32, mouse_Left);
MoveMouse(1000, 41);
wait(500 + random(100));
ClickMouse(1000, 41, mouse_Left);
MoveMouse(1000, 41);
wait(500 + random(100));
ClickMouse(1000, 41, mouse_Left);
//begin server
case ServerNum of
1:
begin
MoveMouse(229, 235);
ClickMouse(229, 235, mouse_Left);
end
2:
begin
MoveMouse(232, 311);
ClickMouse(232, 311, mouse_Left);
end
3:
begin
MoveMouse(225, 386);
ClickMouse(225, 386, mouse_Left);
end
4:
begin
MoveMouse(221, 476);
ClickMouse(221, 476, mouse_Left);
end
5:
begin
MoveMouse(220, 543);
ClickMouse(220, 543, mouse_Left);
end
6:
begin
MoveMouse(590, 236);
ClickMouse(590, 236, mouse_Left);
end
7:
begin
MoveMouse(611, 400);
ClickMouse(611, 400, mouse_Left);
end
8:
begin
MoveMouse(613, 315);
ClickMouse(613, 315, mouse_Left);
end
end
wait(5000 + random(100))
repeat
begin
wait(500 + random(100));
writeln('waiting for message to go away');
end
until FindColor(x1, y1, 16545769, 121, 551, 594, 668) = false;
end
procedure checkloot;
var
x1, y1: Integer;
begin
if FindColor(x1, y1, 4168184, 1140, 150, 1200, 240) then
begin
writeln('FoundLoot');
MoveMouse(x1, y1);
wait(500 + random(100));
ClickMouse(x1, y1, mouse_Left);
wait(100 + random(100));
end;
end
procedure checkformessages;
var
x1, y1: Integer;
begin
if FindColor(x1, y1, 16545769, 121, 551, 594, 668) then
begin
writeln('Replying to message');
MoveMouse(1018, 38);
wait(500 + random(100));
ClickMouse(1018, 38, mouse_Left);
MoveMouse(928, 37);
wait(500 + random(100));
ClickMouse(928, 37, mouse_Left);
wait(1000 + random(100));
for i := 1 to length(reply) do
begin
SendKeys(reply[i], 50 + Random(75), 30 + Random(30));
Wait(99 + Random(43));
end;
MoveMouse(1124, 641);
wait(500 + random(100));
ClickMouse(1124, 641, mouse_Left);
MoveMouse(1031, 40);
wait(500 + random(100));
ClickMouse(1031, 40, mouse_Left);
MoveMouse(376, 32);
wait(500 + random(100));
ClickMouse(376, 32, mouse_Left);
MoveMouse(1183, 32);
wait(500 + random(100));
ClickMouse(1183, 32, mouse_Left);
changeServer;
end;
end
procedure DrinkPotion;
var
i: Integer;
begin
for i := 0 to 3 do
begin
MoveMouse(61, 621);
ClickMouse(61, 621, mouse_Left);
wait(500 + random(100));
end
end
procedure checkHealth;
var
Health: TPointArray;
begin
FindColorsSpiralTolerance(x, y, Health, 3289807, 1, 1, 381, 44, 0);
writeln('Current Health Pixels: ', IntToStr(length(Health)));
writeln('If Pixels < 5000, we will pot: ');
if (length(Health) < 5000) and (length(Health) > 500) then
DrinkPotion;
end
procedure useAbilityF;
var
randomnum : Integer;
Mana: TPointArray;
begin
FindColorsSpiralTolerance(x, y, Mana, 16563260, 1, 30, 500, 65, 0);
if (UseAbility = true) then
begin
randomnum := random(100);
if (randomnum > 90) then
if (length(Mana) > 500) then
begin
Writeln('Using Ability: ');
MoveMouse(60, 400);
wait(500 + random(100));
ClickMouse(60, 400, mouse_Left);
end
end
end
procedure DrinkManaPotion;
var
i: Integer;
begin
MoveMouse(54, 519);
ClickMouse(54, 519, mouse_Left);
wait(500 + random(100));
end
procedure checkMana;
var
Mana: TPointArray;
begin
FindColorsSpiralTolerance(x, y, Mana, 16563260, 1, 30, 500, 65, 0);
writeln('Current Mana Pixels: ', IntToStr(length(Mana)));
writeln('If Pixels < 400, we will pot: ');
if (length(Mana) < 400) and (length(Mana) > 500) then
DrinkManaPotion;
end
procedure checkForHealthBar;
var
Health: TPointArray;
begin
FindColorsSpiralTolerance(x, y, Health, 3289807, 1, 1, 381, 44, 0);
writeln('Checking if interface is open...');
if (length(Health) < 300) then
begin
writeln('Interface Open, Closing...');
MoveMouse(1183, 32);
wait(500 + random(100));
ClickMouse(1183, 32, mouse_Left);
wait(1000 + random(100));
end
end
procedure lookForMonsters;
var
randomside: Integer;
mousex, mousey: Integer;
begin
GetMousePos(mousex, mousey);
Writeln('Colour is ' + IntToStr(ColorOfMonster));
MoveMouse(RandomRange(150, 1000), RandomRange(139, 600));
wait(100 + random(100));
ClickMouse(RandomRange(150, 1000), RandomRange(139, 600), mouse_Left);
wait(3000 + random(100));
checkForHealthBar;
if (UseAutoReply = true) then
checkformessages;
end
function findDemo(): Boolean;
var
x, y, x1, y1: integer;
Health: TPointArray;
distance: Integer;
begin
if UseHealthPots = true then
checkHealth;
if FindColorsSpiralTolerance(x, y, monsterColor, ColorOfMonster, 494, 226, 725, 457, ToleranceOfMonster) then begin
if FindColorsSpiralTolerance(x1, y1, monsterColor1, SecondMonsterColor, 494, 226, 725, 457, ToleranceOfMonster) then
begin
monsters := TPAtoATPAEx(monsterColor, 60, 60);
monsterPoint := MiddleTPA(monsters[0]);
monsters1 := TPAtoATPAEx(monsterColor1, 60, 60);
monsterPoint1 := MiddleTPA(monsters1[0]);
tx := monsterPoint.X;
ty := monsterPoint.Y;
tx1 := monsterPoint1.X;
ty1 := monsterPoint1.Y;
distance := Round( Hypot(tx - tx1, ty - ty1) );
Writeln('Distance between the two colors found: ' + IntToStr(distance));
if (distance < maxDistance) then begin
MoveMouse(tx, ty);
ClickMouse(tx, ty, mouse_Left);
wait(waitTimeBetweenClicks + random(50));
useAbilityF;
checkloot;
result := true;
end
end;
end
if UseHealthPots = true then
checkHealth;
if (FindColorsSpiralTolerance(x, y, monsterColor, ColorOfMonster, 494, 226, 725, 457, ToleranceOfMonster) = false) then
if FindColorsSpiralTolerance(x, y, monsterColor, ColorOfMonster, 110, 12, 1150, 647, ToleranceOfMonster) then
if FindColorsSpiralTolerance(x1, y1, monsterColor1, SecondMonsterColor, 110, 12, 1150, 647, ToleranceOfMonster) then
begin
monsters := TPAtoATPAEx(monsterColor, 60, 60);
monsterPoint := MiddleTPA(monsters[0]);
monsters1 := TPAtoATPAEx(monsterColor1, 60, 60);
monsterPoint1 := MiddleTPA(monsters1[0]);
tx := monsterPoint.X;
ty := monsterPoint.Y;
tx1 := monsterPoint1.X;
ty1 := monsterPoint1.Y;
distance := Round( Hypot(tx - tx1, ty - ty1) );
Writeln('Distance between the two colors found: ' + IntToStr(distance));
if (distance < maxDistance) then begin
MoveMouse(tx, ty);
ClickMouse(tx, ty, mouse_Left);
wait(waitTimeBetweenClicks + random(50));
checkloot;
result := true;
end
end
if not FindColorsSpiralTolerance(x, y, monsterColor, ColorOfMonster, 110, 12, 1150, 647, ToleranceOfMonster) then
if not FindColorsSpiralTolerance(x1, y1, monsterColor1, SecondMonsterColor, 110, 12, 1150, 647, ToleranceOfMonster) then
result := false;
end
function range(): Boolean;
var
x, y, x1, y1: integer;
Health: TPointArray;
distance: Integer;
begin
if UseHealthPots = true then
checkHealth;
if FindColorsSpiralTolerance(x, y, monsterColor, ColorOfMonster, 385, 230, 800, 580, ToleranceOfMonster) then begin
if FindColorsSpiralTolerance(x1, y1, monsterColor1, SecondMonsterColor, 385, 230, 800, 580, ToleranceOfMonster) then
begin
monsters := TPAtoATPAEx(monsterColor, 60, 60);
monsterPoint := MiddleTPA(monsters[0]);
monsters1 := TPAtoATPAEx(monsterColor1, 60, 60);
monsterPoint1 := MiddleTPA(monsters1[0]);
tx := monsterPoint.X;
ty := monsterPoint.Y;
tx1 := monsterPoint1.X;
ty1 := monsterPoint1.Y;
distance := Round( Hypot(tx - tx1, ty - ty1) );
Writeln('Distance between the two colors found: ' + IntToStr(distance));
if (distance < maxDistance) then begin
MoveMouse(tx, ty);
ClickMouse(tx, ty, mouse_Left);
wait(waitTimeBetweenClicks + random(50));
useAbilityF;
checkloot;
result := true;
end
end;
end
if UseHealthPots = true then
checkHealth;
checkForHealthBar;
if (FindColorsSpiralTolerance(x, y, monsterColor, ColorOfMonster, 494, 226, 725, 457, ToleranceOfMonster) = false) then
if FindColorsSpiralTolerance(x, y, monsterColor, ColorOfMonster, 50, 5, 1150, 647, ToleranceOfMonster) then
if FindColorsSpiralTolerance(x1, y1, monsterColor1, SecondMonsterColor, 50, 5, 1150, 647, ToleranceOfMonster) then
begin
monsters := TPAtoATPAEx(monsterColor, 60, 60);
monsterPoint := MiddleTPA(monsters[0]);
monsters1 := TPAtoATPAEx(monsterColor1, 60, 60);
monsterPoint1 := MiddleTPA(monsters1[0]);
tx := monsterPoint.X;
ty := monsterPoint.Y;
tx1 := monsterPoint1.X;
ty1 := monsterPoint1.Y;
distance := Round( Hypot(tx - tx1, ty - ty1) );
Writeln('Moving to Monster')
if (distance < maxDistance) then
if tx < 1100 then
begin
MoveMouse(tx+70, ty);
ClickMouse(tx+70, ty, mouse_Left);
wait(waitTimeBetweenClicks + random(50));
checkloot;
result := true;
end
if tx > 1100 then
begin
MoveMouse(tx-70, ty);
ClickMouse(tx-70, ty, mouse_Left);
wait(waitTimeBetweenClicks + random(50));
checkloot;
result := true;
end
end
if not FindColorsSpiralTolerance(x, y, monsterColor, ColorOfMonster, 110, 12, 1150, 647, ToleranceOfMonster) then
if not FindColorsSpiralTolerance(x1, y1, monsterColor1, SecondMonsterColor, 110, 12, 1150, 647, ToleranceOfMonster) then
result := false;
end
function mage(): Boolean;
var
x, y, x1, y1: integer;
Health: TPointArray;
distance: Integer;
begin
if UseHealthPots = true then
checkHealth;
if FindColorsSpiralTolerance(x, y, monsterColor, ColorOfMonster, 385, 230, 800, 580, ToleranceOfMonster) then begin
if FindColorsSpiralTolerance(x1, y1, monsterColor1, SecondMonsterColor, 385, 230, 800, 580, ToleranceOfMonster) then
begin
monsters := TPAtoATPAEx(monsterColor, 60, 60);
monsterPoint := MiddleTPA(monsters[0]);
monsters1 := TPAtoATPAEx(monsterColor1, 60, 60);
monsterPoint1 := MiddleTPA(monsters1[0]);
tx := monsterPoint.X;
ty := monsterPoint.Y;
tx1 := monsterPoint1.X;
ty1 := monsterPoint1.Y;
distance := Round( Hypot(tx - tx1, ty - ty1) );
Writeln('Distance between the two colors found: ' + IntToStr(distance));
if (distance < maxDistance) then begin
MoveMouse(tx, ty);
ClickMouse(tx, ty, mouse_Left);
wait(waitTimeBetweenClicks + random(50));
useAbilityF;
checkloot;
result := true;
end
end;
end
if UseHealthPots = true then
checkHealth;
checkForHealthBar;
if (FindColorsSpiralTolerance(x, y, monsterColor, ColorOfMonster, 494, 226, 725, 457, ToleranceOfMonster) = false) then
if FindColorsSpiralTolerance(x, y, monsterColor, ColorOfMonster, 50, 5, 1150, 647, ToleranceOfMonster) then
if FindColorsSpiralTolerance(x1, y1, monsterColor1, SecondMonsterColor, 50, 5, 1150, 647, ToleranceOfMonster) then
begin
monsters := TPAtoATPAEx(monsterColor, 60, 60);
monsterPoint := MiddleTPA(monsters[0]);
monsters1 := TPAtoATPAEx(monsterColor1, 60, 60);
monsterPoint1 := MiddleTPA(monsters1[0]);
tx := monsterPoint.X;
ty := monsterPoint.Y;
tx1 := monsterPoint1.X;
ty1 := monsterPoint1.Y;
distance := Round( Hypot(tx - tx1, ty - ty1) );
Writeln('Moving to Monster')
if (distance < maxDistance) then
if tx < 1100 then
begin
MoveMouse(tx+70, ty);
ClickMouse(tx+70, ty, mouse_Left);
wait(waitTimeBetweenClicks + random(50));
checkloot;
result := true;
end
if tx > 1100 then
begin
MoveMouse(tx-70, ty);
ClickMouse(tx-70, ty, mouse_Left);
wait(waitTimeBetweenClicks + random(50));
checkloot;
result := true;
end
end
if not FindColorsSpiralTolerance(x, y, monsterColor, ColorOfMonster, 110, 12, 1150, 647, ToleranceOfMonster) then
if not FindColorsSpiralTolerance(x1, y1, monsterColor1, SecondMonsterColor, 110, 12, 1150, 647, ToleranceOfMonster) then
result := false;
end
begin
case CombatType of
'warrior':
begin
repeat
begin
repeat
findDemo();
until (findDemo() = false);
checkloot;
checkForHealthBar;
lookForMonsters;
if UseHealthPots = true then
checkHealth;
if UseManaPots = true then
checkMana;
end
until false;
end
'range':
begin
repeat
begin
repeat
range();
until (range() = false);
checkloot;
checkForHealthBar;
lookForMonsters;
if UseHealthPots = true then
checkHealth;
if UseManaPots = true then
checkMana;
end
until false;
end
'mage':
begin
repeat
begin
repeat
mage();
until (mage() = false);
checkloot;
checkForHealthBar;
lookForMonsters;
if UseHealthPots = true then
checkHealth;
if UseManaPots = true then
checkMana;
end
until false;
end
end
end