opatio
  Scripts
 

50% de HP para de atacar

Const  
SwitchAt=50;//Mudar para o outro mok qnd ele estiver com 50% de hp  
AttackAt=90;// Somente ataquar um monk q estiver com 90% de hp
var  
creature:tcreature;  

function GetCreatureByNameHPHIGH(Name: string): TCreature;  
var  
  x: integer;  
begin  
  Result := nil;  
  for x := 0 to Creatures.Count - 1 do  
  begin  
 if x >= Creatures.Count then Break;  
 if Creatures.Creature[x].Name = Name then  
 if Creatures.Creature[x].Health>AttackAt then  
 begin  
   Result := Creatures.Creature[x];  
   Exit;  
 end;  
  end;  
end;  
function Attacking: boolean;  
var  
  x: integer;  
begin  
  Result := False;  
  for x := 0 to Creatures.Count - 1 do  
  begin  
 if x >= Creatures.Count then Break;  
 if Creatures.Creature[x].Attacking then  
 begin  
   Result := True;  
   Exit;  
 end;  
  end;  
end;  
function GetAttackedCreature:TCreature;  
var  
  x: integer;  
begin  
  Result := nil;  
  for x := 0 to Creatures.Count - 1 do  
  begin  
 if x >= Creatures.Count then Break;  
 if Creatures.Creature[x].Attacking=true then  
 begin  
   Result := Creatures.Creature[x];  
   Exit;  
 end;  
  end;  
end;  


begin  

while not Terminated do  
  begin  
  UpdateWorld;  
  if not attacking then  
  begin  
  Creature:=GetCreatureByNameHPHIGH('Monk');  
  if  Creature <> nil then  
  creature.attacking:=true;  
  end;  
  if attacking then  
  begin  
  Creature:=GetAttackedCreature;  
  if  Creature <> nil then  
  if creature.Health < SwitchAt then creature.attacking:=false;  
  end;  
  sleep(1000);  
  end;  
end;


Alarme de level

var
  Level: integer;
begin
  UpdateWorld;
  Level := Self.Level;
  while not Terminated do
  begin
 UpdateWorld;
 if Level <> Self.Level then
 begin
    PlaySound('C:WINDOWSMediaNotify.wav');
    Level := Self.Level;//delete this line if you want continusly alarm
 end;
 Sleep(1000);
  end;
end;


Alerta de X monstro na tela

Const
  MonsterName = 'Demodras'

while not terminated do
begin
  updateworld;
  for i:= 0 to creatures.count -1 do
  begin
 if Creatures.Creature[i].Name = MonsterName
 then playsound('C:WindowsMediaNotify.wav');
 sleep(100);
  end;
  sleep(100);
end;


Alerta Food

Const
FoodID = 1111 // Coloke aki o Id da food
MusicPath = 'C:WindowsMediaNotify.wav' // This is the main alert of windows.

while not terminated do
begin
UpdateWorld;
a:=0;
For x:= 0 to Self.Containers.Count - 1 do
begin
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if Self.Containers.Container[x].Item[y].ID = FoodID
then a := 1;
Sleep(100);
end;
sleep(100);
end;
sleep(100);
if a = 0 then PlaySound(MusicPath);
end;


Alerta player on

Const
  VipName = 'Mateusz Dragon Wielki' // Coloque o nome do player
  SoundPath = 'C:/Windows/Media/Notify.wav' // You can change but ONLY WAV files.

procedure Event_VIPLogOn(ID:integer);
begin
  UpdateWorld;
  for i := 0 to VipList.Count -1 do
  begin
 If (VipList.VIP[i].ID = ID) and (VipList.Vip[i].Name = VipName) then
 PlaySound(SoundPath);
  end;  
end;

While not terminated do
begin
  UpdateWorld;
  ProcessEvents;
  Sleep(100);
end;


Alerta spear

const
WeaponId = 3277; // Id da Spear = 3277
WeaponOz = 20; // Peso Spear = 20
AlertAmount = 5;    // Alertar qnd tiver com 5 spears
TimeWait = 3;
SoundNoWeapon = 'C:WindowsMediaWindows XP Battery Critical.wav';  // Escolha um arquivo .wav para faze o barulho
AlertSound = 'C:WindowsMediaWindows XP Battery Critical.wav';

procedure Notify(Sound : String);
begin
if (Pos('.wav', AlertSound) <> 0) then PlaySound(AlertSound);
if (Pos('.wav', Sound) <> 0) then PlaySound(Sound);
end;

procedure CheckForWeapon;
var QtyMove : integer;
var QtyItems : integer;
var HasWeapons : boolean;
begin
QtyMove := 0;
HasWeapons := true;

if Self.LeftHand.Amount <= AlertAmount then
begin
sleep(TimeWait * 1000);

if Self.LeftHand.Amount <= AlertAmount then
begin
HasWeapons := false;

for x := 0 to Self.Containers.Count - 1 do
begin
if HasWeapons then Break;

if Self.Containers.Container[x].Count - 1 then
begin

for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if Self.Containers.Container[x].Item[y].ID = WeaponId then
begin
QtyItems := Abs(Self.Capacity / WeaponOz);

if QtyItems >= 1 then
begin
if Self.Containers.Container[x].Item[y].Amount >= QtyItems then QtyMove := QtyItems;
else QtyMove := Self.Containers.Container[x].Item[y].Amount;

QtyMove := QtyMove - 1;

if QtyMove then
begin
Self.Containers.Container[x].Item[y].MoveToBody(Self.LeftHand, QtyMove);
HasWeapons := true;
Break;
end;
end;
end;
end;
end;
end;
end;
end;

if not HasWeapons then Notify(SoundNoWeapon);
end;

begin
while not Terminated do
begin
UpdateWorld;
CheckForWeapon;
sleep(1000);
end;
end;


Anti pk

Const
  MoveWhere = 'north' // 'north' = Norte ou 'south' = Sul?
 
procedure Event_Attacked(ID:integer);
begin
  UpdateWorld;
  for i := 0 to Creatures.Count -1 do
  begin
 if Creatures.Creature[i].ID = ID then
 if Creatures.Creature[i].NPC = false then
 begin
   case MoveWhere of
  'north': Self.MoveUp;
  'south': Self.MoveDown;
   end;
   Leave := true;
 end;
 sleep(100);
  end;
end;

while not terminated do
begin
  updateWorld;
  if (MoveWhere <> 'north') and (MoveWhere <> 'south') then
  begin
 Self.DisplayText('You MUST enter north or south! Script will close now, please try again.');
 break;
  end;
  Leave := false;
  UpdateWorld;
  ProcessEvents;
  if Leave then break;
  sleep(500);
end;


Atacar sd no pk


const
  Xhp = 30 // Qnt player tiver com esse % de hp atira runa
  delay = 2 // Qnt de delay para atirar de novo?
  RuneID = 3258 // Coloque o id da sd aqui
  MinHP = 200 // Se vc tiver esse ou menos hp para de atacar sd
  
function GetAttackingCreature: TCreature; 
var 
  x: integer; 
begin 
  Result := nil; 
  for x := 0 to Creatures.Count - 1 do 
  begin 
 if x >= Creatures.Count then Break; 
 if Creatures.Creature[x].Attacking = true then 
 begin 
   Result := Creatures.Creature[x]; 
   Exit; 
 end; 
  end; 
end; 

procedure Attack(Name:string); 
var 
   Player:TCreature; 
   x:integer; 
begin 
  updateworld; 
  Monster := GetAttackingCreature; 
  if monster <> nil then  
  if Self.Health>MinHp then 
  begin 
 updateworld;
 if self.Health > MinHP then
 Self.Containers.UseItemWithCreature(RuneID, Monster); 
 updateworld; 
  end 
end; 

while not terminated do
begin
  updateworld;
  Creature := GetAttackingCreature;
  if creature <> nil then
  if creature.health < XHP 
  then 
  repeat
 attack(Creature.Name);
 updateworld;
 sleep(delay * 1000);
  until (Creature.health = 0) or (terminated); 
  Sleep(500);
end;


Atacar Primeiro

Const
Name=['Merlkin']; //pode ser alterado conforme o bixo a atacar primeiro
SwitchAt=10;// the % of the current attacked monster

function GetPlace(st:string):integer;
var
x:integer;
begin
Result:=1000;
for x:=Low(Name) To High(Name) do
begin
if Name[x]=st then
Result:=x;
end;
end;

function GetCreatureByID(ID: integer): TCreature;
var
x: integer;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].ID = ID then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;

function IsCreatureBesideYou(c: TCreature): boolean;
begin
UpdateWorld;
Result := False;
if (abs(c.X-self.X) <= 6) and (abs(c.Y-self.Y) <= 6) then begin
if c.Z = self.Z then begin
Result := True;
end;
end;
end;

var
x:integer;
b:boolean;
begin
while not terminated do
begin
b:=false;
updateworld;
If (Self.Attacking<>0) then
begin
Creature:=GetCreatureByID(Self.Attacking);
if Creature<>nil then
if SwitchAt<Creature.Health then
begin
for x := 0 to Creatures.Count - 1 do
begin
updateworld;
if b then break;
if x >= Creatures.Count then Break;
if Creatures.Creature[x].NPC then
if Creatures.Creature[x].z=self.z then
if Creatures.Creature[x].Name<>self.name then
if Creatures.Creature[x].Attacking = false then
if IsCreatureBesideYou(Creatures.Creature[x]) then
if GetPlace(Creature.Name)>GetPlace(Creatures.Creature[x].Name) then
begin
sleep(100);
updateworld;
Creatures.Creature[x].attacking:=true;
B:=true;
end;
end;
end;
end;
Sleep(100);
end;
end;


Atacar Diagonal

function GetCreatureByID(ID: integer): TCreature;
var
x: integer;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].ID = ID then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;


function GetTileFromXYZ(X, Y, Z: integer): TTile;
begin
Result := nil;
if abs((Self.X - 7) - X) > 14 then Exit;
if abs((Self.Y - 5) - Y) > 11 then Exit;
if Self.Z <> Z then Exit;
Result := Screen.Tile[abs((Self.X - 7) - X), abs((Self.Y - 5) - Y)];
end;


function TileIsWalkable(X, Y, Z: integer): boolean;
const Ramps = [1950, 1952, 1954, 1956, 385, 1947, 434, 414, 604]
var Tile: TTile;
begin
Result := True;
Tile := GetTileFromXYZ(X, Y, Z);
If (Tile <> nil) and (Tile.Count <> 0) then
for i := 0 to Tile.Count - 1 do
begin
if Tile.Item[i].Properties.Hole then Result := False;
else if Tile.Item[i].Properties.Stairs then Result := False;
else if not Tile.Item[i].Properties.Walkable then Result := False;
else for j := Low(Ramps) to High(Ramps) do if Tile.Item[i].ID = Ramps[j] then Result := False;
end;
end;

 

while not Terminated do
begin
UpdateWorld;
if Self.Attacking then
begin
Monster := GetCreatureByID(Self.Attacking);
if Monster <> nil then
Case Monster.Direction of
0:begin
if (Self.X = Monster.X) and (Self.Y = Monster.Y-1) and (Self.Z = Monster.Z) then
begin
if TileIsWalkable(Monster.X-1, Monster.Y-1, Monster.Z) then Self.MoveTo(Monster.X-1, Monster.Y-1, Monster.Z);
else
if TileIsWalkable(Monster.X+1, Monster.Y-1, Monster.Z) then Self.MoveTo(Monster.X+1, Monster.Y-1, Monster.Z);
end;
end;
1:begin
if (Self.X = Monster.X+1) and (Self.Y = Monster.Y) and (Self.Z = Monster.Z) then
begin
if TileIsWalkable(Monster.X+1, Monster.Y-1, Monster.Z) then Self.MoveTo(Monster.X+1, Monster.Y-1, Monster.Z);
else
if TileIsWalkable(Monster.X+1, Monster.Y+1, Monster.Z) then Self.MoveTo(Monster.X+1, Monster.Y+1, Monster.Z);
end;
end;
2:begin
if (Self.X = Monster.X) and (Self.Y = Monster.Y+1) and (Self.Z = Monster.Z) then
begin
if TileIsWalkable(Monster.X-1, Monster.Y+1, Monster.Z) then Self.MoveTo(Monster.X-1, Monster.Y+1, Monster.Z);
else
if TileIsWalkable(Monster.X+1, Monster.Y+1, Monster.Z) then Self.MoveTo(Monster.X+1, Monster.Y+1, Monster.Z);
end;
end;
3:begin
if (Self.X = Monster.X-1) and (Self.Y = Monster.Y) and (Self.Z = Monster.Z) then
begin
if TileIsWalkable(Monster.X-1, Monster.Y-1, Monster.Z) then Self.MoveTo(Monster.X-1, Monster.Y-1, Monster.Z);
else
if TileIsWalkable(Monster.X-1, Monster.Y+1, Monster.Z) then Self.MoveTo(Monster.X-1, Monster.Y+1, Monster.Z);
end;
end;
end;
end;
Sleep(250);
end;


Atacar em distancia

const
RampsID = [1950, 1952, 1954, 1956, 385, 1947, 434, 414, 604, 7020]
Wanted='Troll'
Wanted2='Troll Champions';
AttackAt = 16;

function GetCreatureByID(ID: integer): TCreature;
var
x: integer;
Finished: boolean;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].ID = ID then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;

function GetTileFromXYZ(X, Y, Z: integer): TTile;
begin
Result := nil;
if abs((Self.X - 7) - X) > 14 then Exit;
if abs((Self.Y - 5) - Y) > 11 then Exit;
if Self.Z <> Z then Exit;
Result := Screen.Tile[abs((Self.X - 7) - X), abs((Self.Y - 5) - Y)];
end;

function TileIsWalkable(X, Y, Z: integer): boolean;
var Tile: TTile;
begin
Result := True;
Tile := GetTileFromXYZ(X, Y, Z);
If (Tile <> nil) and (Tile.Count <> 0) then
for Z := 0 to Tile.Count - 1 do
begin
if Tile.Item[Z].Properties.Hole then Result := False;
else if Tile.Item[Z].Properties.Stairs then Result := False;
else if not Tile.Item[Z].Properties.Walkable then Result := False;
else
begin
for x := low(RampsID) to high(RampsID) do
begin
if Tile.Item[Z].ID = RampsID[x] then Result := False;
end;
end;
end;
end;

Function MoveFromRange: boolean;
begin
Result := True;
Creature := GetCreatureByID(Self.Attacking);
if Creature <> nil then
//northwest
if ((Creature.X-self.X = 2) and (Creature.Y-self.Y = 2)) or
((Creature.X-self.X = 2) and (Creature.Y-self.Y = 3)) or
((Creature.X-self.X = 3) and (Creature.Y-self.Y = 2)) or
((Creature.X-self.X = 3) and (Creature.Y-self.Y = 3)) or
//southwest
((Creature.X-self.X = 2) and (Creature.Y-self.Y = -2)) or
((Creature.X-self.X = 2) and (Creature.Y-self.Y = -3)) or
((Creature.X-self.X = 3) and (Creature.Y-self.Y = -2)) or
((Creature.X-self.X = 3) and (Creature.Y-self.Y = -3)) or
//northeast
((Creature.X-self.X = -2) and (Creature.Y-self.Y = 2)) or
((Creature.X-self.X = -2) and (Creature.Y-self.Y = 3)) or
((Creature.X-self.X = -3) and (Creature.Y-self.Y = 2)) or
((Creature.X-self.X = -3) and (Creature.Y-self.Y = 3)) or
//southeast
((Creature.X-self.X = -2) and (Creature.Y-self.Y = -2)) or
((Creature.X-self.X = -2) and (Creature.Y-self.Y = -3)) or
((Creature.X-self.X = -3) and (Creature.Y-self.Y = -2)) or
((Creature.X-self.X = -3) and (Creature.Y-self.Y = -3)) then
Result := False;
end;

begin
while not Terminated do
begin
UpdateWorld;
if Self.Attacking <> 0 then
begin
Creature := GetCreatureByID(Self.Attacking);
if Terminated=True then exit;
if (Creature <> nil) and (MoveFromRange) then
if (Creature.Health<=AttackAt) then
if (Creature.Name=Wanted) or (Creature.Name=Wanted2) then
//// Add more monsters here in the same format if you want to run from them
//// make sure to add them also to the constant list at the top
begin
//Northwest of Creature
if (Creature.X > Self.X) and (Creature.Y > Self.Y) then
begin
Tile:=GetTileFromXYZ(Self.X, Creature.Y + 1, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Self.X, Creature.Y + 1, Creature.Z)) then
begin
Self.MoveTo(Self.X, Creature.Y + 1, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 1, Self.Y, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 1, Self.Y, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 1, Self.Y, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 2, Creature.Y - 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 2, Creature.Y - 2, Creature.Z)=true) then
begin
Self.MoveTo(Creature.X - 2, Creature.Y - 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 2, Creature.Y - 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 2, Creature.Y - 3, Creature.Z)=true) then
begin
Self.MoveTo(Creature.X - 2, Creature.Y - 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 3, Creature.Y - 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 3, Creature.Y - 2, Creature.Z)=true) then
begin
Self.MoveTo(Creature.X - 3, Creature.Y - 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 3, Creature.Y - 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 3, Creature.Y - 3, Creature.Z)=true) then
begin
Self.MoveTo(Creature.X - 3, Creature.Y - 3, Creature.Z);
end;
end;
//Southwest of Creature
if (Creature.X > Self.X) and (Creature.Y < Self.Y) then
begin
Tile:=GetTileFromXYZ(Self.X, Creature.Y - 1, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Self.X, Creature.Y - 1, Creature.Z)) then
begin
Self.MoveTo(Self.X, Creature.Y - 1, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 1, Self.Y, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 1, Self.Y, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 1, Self.Y, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 2, Creature.Y + 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 2, Creature.Y + 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 2, Creature.Y + 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 2, Creature.Y + 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 2, Creature.Y + 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 2, Creature.Y + 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 3, Creature.Y + 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 3, Creature.Y + 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 3, Creature.Y + 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 3, Creature.Y + 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 3, Creature.Y + 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 3, Creature.Y + 3, Creature.Z);
end;
end;
//Northeast of Creature
if (Creature.X < Self.X) and (Creature.Y > Self.Y) then
begin
Tile:=GetTileFromXYZ(Self.X, Creature.Y + 1, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Self.X, Creature.Y + 1, Creature.Z)) then
begin
Self.MoveTo(Self.X, Creature.Y + 1, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 1, Self.Y, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 1, Self.Y, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 1, Self.Y, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 1, Self.Y, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 1, Self.Y, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 1, Self.Y, Creature.Z);
end;
Tile:=GetTileFromXYZ(Self.X, Creature.Y + 1, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Self.X, Creature.Y + 1, Creature.Z)) then
begin
Self.MoveTo(Self.X, Creature.Y + 1, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 2, Creature.Y - 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 2, Creature.Y - 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 2, Creature.Y - 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 2, Creature.Y - 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 2, Creature.Y - 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 2, Creature.Y - 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 3, Creature.Y - 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 3, Creature.Y - 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 3, Creature.Y - 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 3, Creature.Y - 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 3, Creature.Y - 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 3, Creature.Y - 3, Creature.Z);
end;
end;
//Southeast of Creature
if (Creature.X < Self.X) and (Creature.Y < Self.Y) then
begin
Tile:=GetTileFromXYZ(Self.X, Creature.Y - 1, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Self.X, Creature.Y - 1, Creature.Z)) then
begin
Self.MoveTo(Self.X, Creature.Y - 1, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 1, Self.Y, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 1, Self.Y, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 1, Self.Y, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 2, Creature.Y + 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 2, Creature.Y + 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 2, Creature.Y + 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 2, Creature.Y + 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 2, Creature.Y + 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 2, Creature.Y + 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 3, Creature.Y + 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 3, Creature.Y + 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 3, Creature.Y + 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 3, Creature.Y + 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 3, Creature.Y + 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 3, Creature.Y + 3, Creature.Z);
end;
end;
//North of Creature
if (Creature.X = Self.X) and (Creature.Y > Self.Y) then
begin
Tile:=GetTileFromXYZ(Creature.X - 1, Self.Y, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 1, Self.Y, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 1, Self.Y, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 1, Self.Y, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 1, Self.Y, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 1, Self.Y, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 2, Creature.Y - 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 2, Creature.Y - 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 2, Creature.Y - 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 2, Creature.Y - 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 2, Creature.Y - 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 2, Creature.Y - 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 2, Creature.Y - 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 2, Creature.Y - 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 2, Creature.Y - 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 3, Creature.Y - 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 3, Creature.Y - 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 3, Creature.Y - 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 3, Creature.Y - 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 3, Creature.Y - 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 3, Creature.Y - 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 2, Creature.Y - 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 2, Creature.Y - 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 2, Creature.Y - 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 3, Creature.Y - 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 3, Creature.Y - 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 3, Creature.Y - 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 3, Creature.Y - 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 3, Creature.Y - 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 3, Creature.Y - 3, Creature.Z);
end;
end;
//East of Creature
if (Creature.X < Self.X) and (Creature.Y = Self.Y) then
begin
Tile:=GetTileFromXYZ(Self.X, Creature.Y -1, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Self.X, Creature.Y -1, Creature.Z)) then
begin
Self.MoveTo(Self.X, Creature.Y -1, Creature.Z);
end;
Tile:=GetTileFromXYZ(Self.X, Creature.Y + 1, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Self.X, Creature.Y + 1, Creature.Z)) then
begin
Self.MoveTo(Self.X, Creature.Y + 1, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 2, Creature.Y - 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 2, Creature.Y - 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 2, Creature.Y - 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 2, Creature.Y + 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 2, Creature.Y + 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 2, Creature.Y + 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 2, Creature.Y - 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 2, Creature.Y - 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 2, Creature.Y - 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 3, Creature.Y - 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 3, Creature.Y - 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 3, Creature.Y - 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 3, Creature.Y - 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 3, Creature.Y - 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 3, Creature.Y - 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 2, Creature.Y + 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 2, Creature.Y + 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 2, Creature.Y + 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 3, Creature.Y + 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 3, Creature.Y + 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 3, Creature.Y + 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 3, Creature.Y + 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 3, Creature.Y + 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 3, Creature.Y + 3, Creature.Z);
end;
end;
//South of Creature
if (Creature.X = Self.X) and (Creature.Y < Self.Y) then
begin
Tile:=GetTileFromXYZ(Creature.X - 1, Self.Y, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 1, Self.Y, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 1, Self.Y, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 1, Self.Y, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 1, Self.Y, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 1, Self.Y, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 2, Creature.Y + 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 2, Creature.Y + 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 2, Creature.Y + 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 2, Creature.Y + 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 2, Creature.Y + 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 2, Creature.Y + 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 2, Creature.Y + 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 2, Creature.Y + 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 2, Creature.Y + 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 3, Creature.Y + 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 3, Creature.Y + 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 3, Creature.Y + 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X + 3, Creature.Y + 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X + 3, Creature.Y + 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X + 3, Creature.Y + 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 2, Creature.Y + 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 2, Creature.Y + 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 2, Creature.Y + 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 3, Creature.Y + 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 3, Creature.Y + 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 3, Creature.Y + 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 3, Creature.Y + 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 3, Creature.Y + 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 3, Creature.Y + 3, Creature.Z);
end;
end;
//West of Creature
if (Creature.X > Self.X) and (Creature.Y = Self.Y) then
begin
Tile:=GetTileFromXYZ(Self.X, Creature.Y - 1, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Self.X, Creature.Y - 1, Creature.Z)) then
begin
Self.MoveTo(Self.X, Creature.Y - 1, Creature.Z);
end;
Tile:=GetTileFromXYZ(Self.X, Creature.Y + 1, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Self.X, Creature.Y + 1, Creature.Z)) then
begin
Self.MoveTo(Self.X, Creature.Y + 1, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 2, Creature.Y - 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 2, Creature.Y - 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 2, Creature.Y - 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 2, Creature.Y + 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 2, Creature.Y + 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 2, Creature.Y + 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 2, Creature.Y + 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 2, Creature.Y + 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 2, Creature.Y + 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 3, Creature.Y + 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 3, Creature.Y + 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 3, Creature.Y + 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 3, Creature.Y + 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 3, Creature.Y + 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 3, Creature.Y + 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 2, Creature.Y - 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 2, Creature.Y - 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 2, Creature.Y - 3, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 3, Creature.Y - 2, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 3, Creature.Y - 2, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 3, Creature.Y - 2, Creature.Z);
end;
Tile:=GetTileFromXYZ(Creature.X - 3, Creature.Y - 3, Creature.Z);
if (Tile<>nil) and (TileIsWalkable(Creature.X - 3, Creature.Y - 3, Creature.Z)) then
begin
Self.MoveTo(Creature.X - 3, Creature.Y - 3, Creature.Z);
end;
end;
end;
//Diagonal if higher than Attackat health and 1sqm away
Creature := GetCreatureByID(Self.Attacking);
if Terminated=True then exit;
if (Creature <> nil) and (MoveFromRange) then
if (Creature.Health>AttackAt) then
if (Creature.Name=Wanted) or (Creature.Name=Wanted2) then
if (abs(Creature.X-self.X) <= 1) and (abs(Creature.Y-self.Y) <= 1) then
begin
if (Self.X<>Creature.X) and (Self.Y=Creature.Y) then
begin
Tile:=GetTileFromXYZ(Self.x,Self.y-1,self.z);
if Tile<>nil then
if TileIsWalkable(Self.x,Self.y-1,self.z) then
begin
Self.MoveUp;
Moved:=true;
end;
If (Moved=False) then
begin
Tile:=GetTileFromXYZ(Self.x,Self.y+1,self.z);
if Tile<>nil then
if TileIsWalkable(Self.x,Self.y+1,self.z) then
Self.MoveDown;
end;
end;
Moved:=false;
if (Self.X=Creature.X) and (Self.Y<>Creature.Y) then
begin
Tile:=GetTileFromXYZ(Self.x-1,Self.y,self.z);
if Tile<>nil then
if TileIsWalkable(Self.x-1,Self.y,self.z) then
begin
Self.MoveLeft;
Moved:=true;
end;
If (Moved=False) then
begin
Tile:=GetTileFromXYZ(Self.x+1,Self.y,self.z);
if Tile<>nil then
if TileIsWalkable(Self.x+1,Self.y,self.z) then
Self.MoveRight;
end;
end;
end;
end;
sleep(500);
end;
end;


Atacar HMM em um X bixo

Const
Hmm=3333; // Coloke o Id da HMM
MiniHealth=400;//valor minimo de Vida.. caso vc tenha menos que 400 usará uh sosinho
var
Creature:TCreature;
LOCKID:integer;

function GetCreatureByID(ID: integer): TCreature;
var
x: integer;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].ID = ID then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;


function GetCreatureByName(Name: String): TCreature;
var
x: integer;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].Name = Name then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;

 

begin
while not Terminated do
begin
updateworld;
Creature:=GetCreatureByName('Stalker');
if Creature<>nil then
begin
LOCKID:=Creature.ID;
While Creature <> nil do
begin
If self.Health>MiniHealth then
Self.Containers.UseItemWithCreature(Hmm, Creature);
Sleep(2000);
updateworld;
Creature:=GetCreatureByID(LOCKID);
end;
end;
Sleep(1000);
end;
end;


Auto log out

const
WeaponID = 3282 // 3282 = Morning Star
SpearID = 3277 // 3277 = Spear, 1781 = Small Stone
SpearOz = 20 // Spear = 20, Small Stone = 3
SpearAmount = 1 // How many must have before switching back to spear

Procedure PickUpSpears(Spears: TItem);
begin
if (Self.Capacity <= (Spears.Amount * SpearOz)) then
begin
if (Self.Capacity/SpearOz) > 1 then
Spears.MoveToContainer(Self.Containers.Container[0], 0, Int(Self.Capacity/SpearOz));
end else Spears.MoveToContainer(Self.Containers.Container[0], 0, 0);
Sleep(500);
end;

Function GetItemFromOpenBackpack(ID, Index: integer): TItem;
var
x: integer;
y: integer;
begin
Result := nil;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
if x = Index then Continue;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then
begin
Result := Self.Containers.Container[x].Item[y];
Exit;
end;
end;
end;
end;


function CountItemAmountFromOpenBackpack(ID: integer): integer;
var
x: integer;
y: integer;
begin
Result := 0;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then begin
Result := Result + Self.Containers.Container[x].Item[y].Amount;
end;
end;
end;
end;


while not terminated do
begin
UpdateWorld;
Weapon := GetItemFromOpenBackpack(WeaponID, Self.Containers.Count);
if Weapon <> nil then Weapon.MoveToBody(Self.Arrow, 0);
Spear := GetItemFromOpenBackpack(SpearID, 0);
if Spear <> nil then Spear.MoveToContainer(Self.Containers.Container[0], 0, 0);
if (Self.RightHand.ID = SpearID) then
begin
if (Self.RightHand.Amount < 90) then
begin
Spear := GetItemFromOpenBackpack(SpearID, Self.Containers.Count);
if Spear <> nil then Spear.MoveToBody(Self.RightHand, 0);
end;
end else begin
SpearCount := CountItemAmountFromOpenBackpack(SpearID);
if SpearCount >= SpearAmount then
begin
Self.RightHand.MoveToBody(Self.Arrow, 0);
Sleep(500);
Spear := GetItemFromOpenBackpack(SpearID, Self.Containers.Count);
if Spear <> nil then Spear.MoveToBody(Self.RightHand, 0);
end else if Self.RightHand.ID = 0 then Self.Arrow.MoveToBody(Self.RightHand, 0);
end;
Sleep(500);
end;


Cap alerta

Const
cap = 10

while not terminated do
begin
UpdateWorld;
if self.capacity < cap then
PlaySound('C:WindowsMedianotify.wav');
Sleep(100);
end;


Colocar e tirar soft boots

Const
Soft=6529; //6529 ID Softboots na BP
Softbody=3549;//3549 ID soft in use
Bsteel=3079; // obs 3554 é id da stell boots pode alterar pelo da boh
ManaMin=300;// mana para colokar a soft
ManaMax=500;//mana para retirar a soft

var
FeetID: integer;

function GetItemFromOpenBackpack(ID: integer): TItem;
var
y: integer;
begin
Result := nil;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then
begin
Result := Self.Containers.Container[x].Item[y];
Exit;
end;
end;
end;
end;

begin
FeetID := Bsteel;
while not Terminated do
begin
UpdateWorld;
if Self.Mana > ManaMax then
begin
if Self.Feet.ID = Softbody then
begin
Feet := GetItemFromOpenBackpack(Bsteel);
if Feet <> nil then
begin
Feet.MoveToBody(Self.Feet, 0);
end;
end;
end
else
begin
Boh := GetItemFromOpenBackpack(Soft);
if Self.Mana < ManaMin then
if Self.Feet.ID = Bsteel then
begin
Boh.MoveToBody(Self.Feet, 0);
end;
end;
Sleep(100);
end;
end;


Fazer enchanted spear

const
SpearID = 3277 ;//make sure its the right id of regular spear.
ManaNeed= 650;
SpellName='Exeta Con';
procedure CastSpell(Spell: string);
begin
UpdateWorld;
for x := 0 to Self.Containers.Count - 1 do
begin
for y := 0 to Self.Containers.Container[x].Count-1 do
begin
if Self.Containers.Container[x].Item[y].ID = SpearID then
begin
repeat
Self.Containers.Container[x].Item[y].MoveToBody(Self.RightHand, 1);
Sleep(1000);
UpdateWorld;
until Self.RightHand.ID = SpearID;
Self.Say(Spell);
repeat
Sleep(1000);
UpdateWorld;
until Self.RightHand.ID <> SpearID;
Self.RightHand.MoveToContainer(Self.Containers.Container[x], y, 0);
Exit;
end;
end;
end;
end;
procedure StackItems;
var
T: array of integer;
x, y, z: integer;
Temp: integer;
begin
T := VarArrayCreate([0, 19] , 3);
Temp := -1;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for z := 0 to Self.Containers.Container[x].Count - 1 do
begin
T[z] := Self.Containers.Container[x].Item[z].ID;
end;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].Properties.Pilable then
begin
if Self.Containers.Container[x].Item[y].Amount < 100 then
begin
for z := y + 1 to Self.Containers.Container[x].Count - 1 do
begin
if T[z] = Self.Containers.Container[x].Item[y].ID then
begin
if Self.Containers.Container[x].Item[z].Amount < 100 then
begin
Self.Containers.Container[x].Item[y].movetocontainer(Self.Containers.Container[x], z, 0);
end;
end;
end;
end;
end;
end;
end;
end;

begin
while not terminated do
begin
updateworld;
StackItems;
If (self.Mana>=ManaNeed) then
begin
repeat
Self.RightHand.MoveToBody(Self.Arrow,0);
sleep(1000);
updateworld;
until(Self.RightHand.ID=0);
CastSpell(SpellName);
sleep(1000);
updateworld;
Self.Arrow.MoveToBody(Self.RightHand,0);
end;
sleep(1000);
end;
end;


Quando tiver poison soltar exana pox

var
MaxPoison: integer;

procedure Event_Notice(Text: string);
var
PoisonAmount: string;
begin
UpdateWorld;
if Self.Mana < 30 then Exit;
if not Self.Poisoned then Exit;
if Pos('You lose ', Text) = 0 then Exit;
if Pos(' hitpoints.', Text) = 0 then Exit;
PoisonAmount := Text;
Delete(PoisonAmount, 1, 9);
PoisonAmount := Copy(PoisonAmount, 1, Pos(' ', PoisonAmount) - 1);
if IntToStr(PoisonAmount) > MaxPoison then Self.Say('exana pox');
end;

begin
MaxPoison := 5;
while not Terminated do
begin
ProcessEvents;
Sleep(100);
end;
end;


Exori san

const
Delay = 2000; //exaut para cada exori con 2 sec
MinimumManaToCast = 500; // mana que precisa para soltar exori con
MinimumMonsterHealth = 0; // Contado em Porcentagem se o monstro tiver 1k de lifer com 60 soltara exori com com 600 de life..
SpellRange = 5; // soltara 3 exori con

function GetCreatureByID(ID: integer): TCreature;
var
x: integer;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
if Creatures.Creature[x].ID = ID then
Result := Creatures.Creature[x];
end;

var
Attacking : TCreature;
Range: Integer;
begin
while not Terminated do
begin
UpdateWorld;

Attacking:=GetCreatureByID(Self.Attacking);
if (Assigned(Attacking)) then
begin
Range := Round(Sqrt(Sqr(Self.X - Attacking.X) + Sqr(Self.Y - Attacking.Y)));
if (Range <= SpellRange) and (Attacking.Health >= MinimumMonsterHealth) and (Self.Mana >= MinimumManaToCast) then
Self.Say('exori san');
end;

Sleep(Delay);
end;
end;


Exura quando paralyzado

const
minMana = 20; //Mana que precisa para soltar exura

while not Terminated do
begin
UpdateWorld;
if Self.Mana > minMana then
begin
if Self.Slowed then
Self.Say('exura');
Sleep(300);
end;
end;


Health potion + exura

const
minMana = 20; //minimum mana
minHealth = 100; //Life pra tomar o Pote
maxHealth = 200; //Life pra usar Exura abaixo disso
potionid = 266; //id da potion
spellnome = 'Ex  urA' //nome da magia

while not Terminated do
begin
UpdateWorld;
if (Self.Health < minHealth) then
begin
Self.Containers.UseItemWithSelf(potionid);
Sleep(1000);
end;
else
begin
if (Self.Health < maxHealth) and (Self.Mana > minMana ) then
begin
Self.Say(spellnome);
Sleep(1500);
end;
end;
Sleep(100);
end;


Usar mana potion

const
minMana = 20; //Mana pra usar Mf pequena

while not Terminated do
begin
UpdateWorld;
if (Self.Mana < minMana) then
begin
Self.Containers.UseItemWithSelf(268)
Sleep(1000);
end;
Sleep(100);
end;


Quando pegar 3% pro level 9 o char desloga

Const
   Exp = 6300

while not terminated do
begin
  UpdateWorld;
  if Self.Experience >= Exp
  then Self.Logout(True);
  Sleep(1000);
end;


Ignorar Fogo

Const
Wanted='Dragon Lord';// Monster to Follow
AttackAt=30; // Start follow if % life of monster < 30
var
x: Integer;

function IsCreatureBesideYou(c: TCreature): boolean;
begin
UpdateWorld;
if (abs(c.X-self.X) <= 5) and (abs(c.Y-self.Y) <= 5) then begin
if c.Z = self.Z then
begin
Result := True;
Exit;
end;
end;
Result := False;
end;


function GetTileFromXYZ(X, Y, Z: integer): TTile;
begin
Result := nil;
if abs((Self.X - 7) - X) > 14 then Exit;
if abs((Self.Y - 5) - Y) > 11 then Exit;
if Self.Z <> Z then Exit;
Result := Screen.Tile[abs((Self.X - 7) - X), abs((Self.Y - 5) - Y)];
end;
function IsTileWalkable(Tile: TTile): boolean;
begin
Result := True;
for Z := 0 to Tile.Count - 1 do
begin
if Tile.Item[Z].Properties.Hole then
begin
Result := False;
end
else if Tile.Item[Z].Properties.Stairs then
begin
Result := False;
end
else if not Tile.Item[Z].Properties.Walkable then
begin
OutputDebugString('Not Walk: ' + IntToStr(Tile.Item[Z].ID));
Result := False;
end;
end;
end;
function GetCreatureBesideYou: TCreature;
begin
UpdateWorld;
Result := Nil;
for x := 0 to Creatures.Count - 1 do
begin
UpdateWorld;
if (Creatures.Creature[x].Name=Wanted) then
if IsCreatureBesideYou(Creatures.Creature[x]) then
begin
if Creatures.Creature[x].ID <> Self.ID then
begin
UpdateWorld;
Result := Creatures.Creature[x];
Exit;
end;
end;
end;
end;

var
Moved:boolean;

begin
G:=false;
T:=false;
while not terminated do
begin
updateworld;
Creature:=GetCreatureBesideYou;
if Creature<>nil then
if Creatures.Creature[x].Health<=AttackAt then
begin
if (Self.Y>Creature.Y) then
begin
Tile:=GetTileFromXYZ(Self.x,Self.y-1,self.z);
if Tile<>nil then
if IsTileWalkable(Tile) then
begin
Self.MoveUp;
Moved:=true;
end;
end;
Moved:=false;
if (Self.Y<Creature.Y) then
begin
Tile:=GetTileFromXYZ(Self.x,Self.y+1,self.z);
if Tile<>nil then
if IsTileWalkable(Tile) then
begin
Self.MoveDown;
Moved:=true;
end;
end;
Moved:=false;
if (Self.X>Creature.X) then
begin
Tile:=GetTileFromXYZ(Self.x-1,Self.y,self.z);
if Tile<>nil then
if IsTileWalkable(Tile) then
begin
Self.MoveLeft;
Moved:=true;
end;
end;
Moved:=false;
if (Self.X<Creature.X) then
begin
Tile:=GetTileFromXYZ(Self.x+1,Self.y,self.z);
if Tile<>nil then
if IsTileWalkable(Tile) then
begin
Self.MoveRight;
Moved:=true;
end;
end;
end;
sleep(400);
end;
end;


Mudar de arma


Const
  //Coloque as configuração para mudar para o modo defensivo//
  MonsterName = 'Dwarf Guard'
  weapon1_ID = 3295
  //Coloque as configuração para voltar para o modo ofensivo//
  Weapon2_ID = 3291
 
function GetItemFromOpenBackpack(ID: integer): TItem;
var
  y: integer;
begin
  Result := nil;
  for x := 0 to Self.Containers.Count - 1 do
  begin
 if x >= Self.Containers.Count then Break;
 for y := 0 to Self.Containers.Container[x].Count - 1 do
 begin
   if y >= Self.Containers.Container[x].Count then Break;
   if Self.Containers.Container[x].Item[y].ID = ID then
   begin
  Result := Self.Containers.Container[x].Item[y];
  Exit;
   end;
 end;
  end;
end;

function GetCreatureByID(ID: integer): TCreature;
var
  x: integer;
begin
  Result := nil;
  for x := 0 to Creatures.Count - 1 do
  begin
 if x >= Creatures.Count then Break;
 if Creatures.Creature[x].ID = ID then
 begin
   Result := Creatures.Creature[x];
   Exit;
 end;
  end;
end;

procedure Event_Attacked(ID:integer);
begin
  Creature := GetCreatureByID(ID);
  if Creature <> nil then
  begin
  A := 0;
 if Creature.Name = MonsterName then
 begin
   Self.Defensive;
   Weapon := GetItemFromOpenBackpack(Weapon1_ID);
   if Self.RightHand.ID <> Weapon1_ID then
   if Weapon = nil then
   self.DisplayText('Weapon1 wasnt found in open backpack!');
   else Weapon.MoveToBody(Self.RightHand,0);
   A := 1;
 end;
 if not self.attacking then
 if A = 0 then
 begin
   Self.Offensive;
   if Self.RightHand.ID <> Weapon2_ID then
   begin
  Weapon := GetItemFromOpenBackpack(Weapon2_ID);
  if Weapon <> nil then
  Weapon.MoveToBody(Self.RightHand,0);
  else Self.DisplayText('Weapon2 wasnt found in opened backpack!');
   end;
 end;
  end;
end;

while not terminated do
begin
  UpdateWorld;
  ProcessEvents;
  sleep(100);
end;


Usar obsidian knife

const
obsidian_knife = 5908; //id da obsidian ou woden stak
skin_body = [4011, 4047, 4052, 4057]; //id dor corpos

function searchIntArray(id:integer): boolean;
var
i: integer;
begin
result := false;
for i := low(skin_body) to high(skin_body) do begin
if skin_body = id then result := true;
end;
end;

function GetItemFromOpenBackpack(ID: integer): TItem;
var
y: integer;
begin
Result := nil;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then
begin
Result := Self.Containers.Container[x].Item[y];
Exit;
end;
end;
end;
end;

function SkinBodies(id:integer): Boolean;
var
x, y: integer;
knife: TItem;
t: integer;
begin
UpdateWorld;
knife := GetItemFromOpenBackpack(obsidian_knife);
if knife = nil then
begin
Self.DisplayText('An Obsidian Knife could not be found, please open a container with it.');
exit;
end;
t := -1;
for x := -1 to 1 do begin
for y := -1 to 1 do begin
// if Screen.Tile[7+x, 5+y].Count >= 3 then begin
// t := -2
// end else t := -1;
if searchIntArray(Screen.Tile[7+x, 5+y].Item[Screen.Tile[7+x, 5+y].Count+t].ID) = true then begin
UpdateWorld;
knife := GetItemFromOpenBackpack(obsidian_knife);
if knife <> nil then begin
knife.UseWithGround(Self.X+X, Self.Y+Y, Self.Z);
Self.DisplayText('Attempted to skin a creature with the ID ' + IntToStr(Screen.Tile[7+x, 5+y].Item[Screen.Tile[7+x, 5+y].Count-1].ID) + '.');
Sleep(100);
UpdateWorld;
end;
end;
end;
end;
end;

begin
while not terminated do begin
UpdateWorld;
SkinBodies(skin_body);
Sleep(100);
end;
end;


Paladin bot

var
ShieldID: integer;
XbowID: integer;

function GetItemFromOpenBackpack(ID: integer): TItem;
var
x: integer;
y: integer;
begin
Result := nil;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then
begin
Result := Self.Containers.Container[x].Item[y];
Exit;
end;
end;
end;
end;

procedure Event_KeyDown(Key: integer);
var
Shield: TItem;
Xbow: TItem;
begin
UpdateWorld;
if Key = 9 then
begin
if Self.RightHand.ID = XbowID then
begin
Shield := GetItemFromOpenBackpack(ShieldID);
if Shield <> nil then Shield.MoveToBody(Self.RightHand, 0);
end
else if Self.RightHand.ID = ShieldID then
begin
Xbow := GetItemFromOpenBackpack(XbowID);
if Xbow <> nil then Xbow.MoveToBody(Self.RightHand, 0);
end
end;
end;

begin
ShieldID := 3420; //item id for your shield (right hand)
XBowID := 3349; //item id for your crossbow or bow
while not Terminated do
begin
ProcessEvents;
Sleep(100);
end;
end;


Pm de player on screen

const
IDs=[3357,3360, ID's ak e apague issu];
BPNumber = 1

Procedure Pickup(ID:integer);
var
x, y, z, i: integer;
Tile: TTile;
begin
UpdateWorld;
for x := -1 to 1 do
begin
for y := -1 to 1 do
begin
Tile := Screen.Tile[x + 7, y + 5];
begin
if Tile.Count > 0 then
if Tile.Item[Tile.Count - 1].ID = ID then
Tile.Item[Tile.Count - 1].MoveToContainer(Self.Containers.Container[BPNumber - 1], 0, 0);
end;
end;
end;
end;

while not terminated do
begin
for i := Low(IDs) to High(IDs) do
begin
Pickup(IDs[i]);
sleep(1);
end;
end;


Puxar small stone

const
  WeaponID = 3271
  SpearID = 1781
  SpearOz = 3.60
  SpearAmount = 5
  Fluid = [99, 2886, 2887, 2887, 2888, 2889, 2890, 2891]


Procedure PickUpSpears(Spears: TItem);
begin
  if (Self.Capacity <= (Spears.Amount * SpearOz)) then
  begin
    if (Self.Capacity/SpearOz) > 1 then
      Spears.MoveToContainer(Self.Containers.Container[0], 0, Int(Self.Capacity/SpearOz));
  end else Spears.MoveToContainer(Self.Containers.Container[0], 0, 0);
  Sleep(500);
end;

Procedure FindSpears;
var
  x, y, z, i, f: integer;
  Tile: TTile;
begin
  for x := -1 to 1 do
  begin
    for y := -1 to 1 do
    begin
      Tile := Screen.Tile[x + 7, y + 5];
      begin
        for i := 0 to Tile.Count-1 do
        begin
          if i >= Tile.Count then Break;
          if Tile.Item[i].ID = SpearID then
          begin
            if i = 1 then PickUpSpears(Tile.Item[i]);
            else for f := Low(Fluid) to High(Fluid) do if Tile.Item[i-1].ID = Fluid[f] then PickUpSpears(Tile.Item[i]);
            else Tile.Item[i-1].MoveToGround(Self.X+Random(-2,3), Self.Y+Random(-2,3), Self.Z, 0);
          end;
        end;
      end;
    end;
  end;
end;


Function GetItemFromOpenBackpack(ID, Index: integer): TItem;
var
  x: integer;
  y: integer;
begin
  Result := nil;
  for x := 0 to Self.Containers.Count - 1 do
  begin
    if x >= Self.Containers.Count then Break;
    if x = Index then Continue;
    for y := 0 to Self.Containers.Container[x].Count - 1 do
    begin
      if y >= Self.Containers.Container[x].Count then Break;
      if Self.Containers.Container[x].Item[y].ID = ID then
      begin
        Result := Self.Containers.Container[x].Item[y];
        Exit;
      end;
    end;
  end;
end;


function CountItemAmountFromOpenBackpack(ID: integer): integer;
var
  x: integer;
  y: integer;
begin
  Result := 0;
  for x := 0 to Self.Containers.Count - 1 do
  begin
    if x >= Self.Containers.Count then Break;
    for y := 0 to Self.Containers.Container[x].Count - 1 do begin
      if y >= Self.Containers.Container[x].Count then Break;
      if Self.Containers.Container[x].Item[y].ID = ID then begin
        Result := Result + Self.Containers.Container[x].Item[y].Amount;
      end;
    end;
  end;
end;


while not terminated do
begin
  UpdateWorld;
  FindSpears;
 
  Weapon := GetItemFromOpenBackpack(WeaponID, Self.Containers.Count);
  if Weapon <> nil then Weapon.MoveToBody(Self.Arrow, 0);
  Spear := GetItemFromOpenBackpack(SpearID, 0);
  if Spear <> nil then Spear.MoveToContainer(Self.Containers.Container[0], 0, 0);
   
  if (Self.RightHand.ID = SpearID) then
  begin
    if (Self.RightHand.Amount < 90) then
    begin
      Spear := GetItemFromOpenBackpack(SpearID, Self.Containers.Count);
      if Spear <> nil then Spear.MoveToBody(Self.RightHand, 0);
    end;
  end else begin
    SpearCount := CountItemAmountFromOpenBackpack(SpearID);
    if SpearCount >= SpearAmount then
    begin
      Self.RightHand.MoveToBody(Self.Arrow, 0);
      Sleep(500);
      Spear := GetItemFromOpenBackpack(SpearID, Self.Containers.Count);
      if Spear <> nil then Spear.MoveToBody(Self.RightHand, 0);
    end else if Self.RightHand.ID = 0 then Self.Arrow.MoveToBody(Self.RightHand, 0);
  end;

  Sleep(500);
end;


Recarregar spear

const
WeaponID = 3282 // 3282 = Morning Star
SpearID = 3277 // 3277 = Spear, 1781 = Small Stone
SpearOz = 20 // Spear = 20, Small Stone = 3
SpearAmount = 1 // How many must have before switching back to spear

Procedure PickUpSpears(Spears: TItem);
begin
if (Self.Capacity <= (Spears.Amount * SpearOz)) then
begin
if (Self.Capacity/SpearOz) > 1 then
Spears.MoveToContainer(Self.Containers.Container[0], 0, Int(Self.Capacity/SpearOz));
end else Spears.MoveToContainer(Self.Containers.Container[0], 0, 0);
Sleep(500);
end;

Function GetItemFromOpenBackpack(ID, Index: integer): TItem;
var
x: integer;
y: integer;
begin
Result := nil;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
if x = Index then Continue;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then
begin
Result := Self.Containers.Container[x].Item[y];
Exit;
end;
end;
end;
end;


function CountItemAmountFromOpenBackpack(ID: integer): integer;
var
x: integer;
y: integer;
begin
Result := 0;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then begin
Result := Result + Self.Containers.Container[x].Item[y].Amount;
end;
end;
end;
end;


while not terminated do
begin
UpdateWorld;
Weapon := GetItemFromOpenBackpack(WeaponID, Self.Containers.Count);
if Weapon <> nil then Weapon.MoveToBody(Self.Arrow, 0);
Spear := GetItemFromOpenBackpack(SpearID, 0);
if Spear <> nil then Spear.MoveToContainer(Self.Containers.Container[0], 0, 0);
if (Self.RightHand.ID = SpearID) then
begin
if (Self.RightHand.Amount < 90) then
begin
Spear := GetItemFromOpenBackpack(SpearID, Self.Containers.Count);
if Spear <> nil then Spear.MoveToBody(Self.RightHand, 0);
end;
end else begin
SpearCount := CountItemAmountFromOpenBackpack(SpearID);
if SpearCount >= SpearAmount then
begin
Self.RightHand.MoveToBody(Self.Arrow, 0);
Sleep(500);
Spear := GetItemFromOpenBackpack(SpearID, Self.Containers.Count);
if Spear <> nil then Spear.MoveToBody(Self.RightHand, 0);
end else if Self.RightHand.ID = 0 then Self.Arrow.MoveToBody(Self.RightHand, 0);
end;
Sleep(500);
end;


Recconecta e abre bp

const
Account = 1234567; // Sua conta
Password = 'xxxxxxxx'; // Sua senha
Character = 'xxxxxxxx'; // Nome do Char
World = 'Antica'; // Mundo Que vc Joga
ServerIP = ''; // Deixa em branco
procedure Login
var x: integer;
begin
repeat
Self.Login(Account, Password, Character, World, ServerIP);
Sleep(7000);
for x := 0 to 200 do
begin
if Self.Connected then Break;
Sleep(100);
end;
until Self.Connected;
end;
var x: integer;
while not Terminated do
begin
UpdateWorld;
if not Self.Connected then
begin
Login;
Sleep(2000);
UpdateWorld;
Self.Backpack.Open;
Sleep(2000)
UpdateWorld;
for x := 0 to Self.Containers.Container[0].Count do
begin
if x >= Self.Containers.Container[0].Count then Break;
if Self.Containers.Container[0].Item[x].Properties.Container then
begin
Self.Containers.Container[0].Item[x].OpenInNewWindow;
Sleep(2000);
end;
end;
end;
Sleep(1000);
end;


Treinar com slime (obs: deixe de follow na slime principal)

function Attacking: boolean;
begin
UpdateWorld;
for x := 0 to Creatures.Count - 1 do
begin
UpdateWorld;
if Creatures.Creature[x].Attacking then
begin
Result := True;
Exit;
end;
end;
Result := False;
Exit;
end;

function GetFollowedCreatureID: integer;
begin
UpdateWorld;
for x := 0 to Creatures.Count - 1 do
begin
UpdateWorld;
if Creatures.Creature[x].Following then
begin
Result := Creatures.Creature[x].ID;
Exit;
end;
end;
end;

var
MotherSlime, X1, Y1: integer;
begin
MotherSlime := GetFollowedCreatureID;
while not Terminated do
begin
UpdateWorld;
if not Attacking then

begin
UpdateWorld;
for x := 0 to Creatures.Count - 1 do
begin
UpdateWorld;
if Creatures.Creature[x].ID <> MotherSlime then
begin
if (Creatures.Creature[x].Name <> Self.Name) and Creatures.Creature[x].NPC then
begin
UpdateWorld;
X1 := Creatures.Creature[x].X;
Y1 := Creatures.Creature[x].Y;
if (X1 - Self.X = 1) or (X1 - Self.X = 0) or (X1 - Self.X = -1) then
begin
UpdateWorld;
if (Y1 - Self.Y = 1) or (Y1 - Self.Y = 0) or (Y1 - Self.Y = -1) then
begin
Creatures.Creature[x].Attacking := true;
Break;
end;
end;
end;
end;
end;
end;
Sleep(1000);
end;
end;


Logar quando algum player entrar

Const
  VipNames = ['Fald Kiranu','Eternal Oblivion','Seromontis','Tripida']
procedure Event_VIPLogOn(ID:integer);
begin
  UpdateWorld;
  for i := 0 to VipList.Count -1 do
  begin
 If VipList.VIP[i].ID = ID then
 begin
   for x := Low(VipNames) to High(VipNames) do
   begin
  if VipNames[x] = VipList.VIP[i].Name then
  begin
    Self.Logout(True);
    exit;
  end
   end;
 end;
  end; 
end;

While not terminated do
begin
  UpdateWorld;
  ProcessEvents;
  Sleep(100);
end;









 

 
  Today, there have been 3 visitors (4 hits) on this page!  
 
This website was created for free with Own-Free-Website.com. Would you also like to have your own website?
Sign up for free