Mostrando postagens com marcador Scripts TibiaBot NG. Mostrar todas as postagens
Mostrando postagens com marcador Scripts TibiaBot NG. Mostrar todas as postagens

Trocar arma para matar x monstro

Const 
  //Enter the settings for when to change to DEFENSIVE// 
  MonsterName = ['Snake']
  weapon1_ID = 3066
  //Enter the settings for when to change to OFFENSIVE back// 
  Weapon2_ID = 3327  
   
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; 

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;


while not terminated do
begin 
  Continu := 0;
  UpdateWorld;
  Creature := GetCreatureByID(Self.Attacking); 
  if Creature <> nil then 
  begin
    for i := low(monstername) to high(monstername) do
    begin
      if MonsterName[i] = Creature.Name then
      Continu := 1;
    end;
    if Continu then
    begin
      Self.Defensive;
      Weapon := GetItemFromOpenBackpack(Weapon1_ID); 
      if Self.RightHand.ID <> Weapon1_ID then
      begin
        if Weapon = nil then 
          self.DisplayText('Weapon1 wasnt found in open backpack!'); 
        else
          Weapon.MoveToBody(Self.RightHand,0); 
      end;
    end;
    else   
    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;
  sleep(100);
end;

Alerta ao acabar cap.

Const
cap = 20 \\ Altere aqui a cap para apitar

while not terminated do
begin
UpdateWorld;
if self.capacity <>
PlaySound('C:\Windows\Media\notify.wav');
Sleep(100);
end;

Alerta ao acabar food.

Const
FoodID = 1111 // Coloque aki o ID do food
MusicPath = 'C:\Windows\Media\Notify.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 ao acabar Spear.

const
WeaponId = 3277; // Spear = 3277
WeaponOz = 20; // Spear = 20
AlertAmount = 5;
TimeWait = 3;
SoundNoWeapon = 'C:\Windows\Media\Windows XP Battery Critical.wav';
AlertSound = 'C:\Windows\Media\Windows 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;

Alerta com Poucas Mana Potions.

Const
Message1 = 'Using one of 20 mana potions...' // you can change this message.
Alert = 2 //0 - disable. 1 -enable. 2 - non stop.
Logout = 0 //0 - disable. 1 - no force. 2 - force log.
AlertPath = 'C:/Windows/Media/Notify.wav' //must be wav file.

var
Finish:boolean;
ok:integer;

procedure Event_Notice(Text:string);
begin
if (pos(Message1,Text)) or (pos(Text,Message1)) then
begin
Case Alert of
1:
begin
PlaySound(AlertPath);
finish := true;
end;
2:ok := 1;
end;
Case Logout of
1: Self.Logout(false);
2: Self.Logout(True);
end;
end;
end;

quit := false;
if (not alert) and (not logout) then quit := true;
Finish := false;
while (not terminated) and (not finish) and (not quit) do
begin
UpdateWorld;
ok := 0;
ProcessEvents;
if ok then
repeat
PlaySound(AlertPath);
Sleep(1000);
until terminated;
Sleep(100);
end;

Ataca SD, ou outra runa em tal monstro.

Const
IgnoreList = ['Sam','Hardek','Rat','Cave Rat','Skeleton'] // Add qnts quizer
MaxMonsters = 1 // Quantia de monstros pra jogar a runa
RuneID = 3165 // Bote aqui o ID da SD

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;

while not terminated do
begin
A := 0;
UpdateWorld
For i := 0 to Creatures.Count -1 do
begin
if (i >= Creatures.Count) or (terminated) then break;
if (Creatures.Creature.NPC) and (Creatures.Creature.Z = Self.Z) then
begin
B := 0;
for g := Low(IgnoreList) To High(IgnoreList) do
begin
if AnsiLowerCase(Creatures.Creature.Name) = AnsiLowerCase(IgnoreList[g]) then
begin
B := 1;
break;
end;
sleep(10);
end;
if B = 0 then A := A + 1;
end;
Sleep(10);
end;
if A > MaxMonsters then
begin
UpdateWorld;
if Self.Attacking <> 0 then
Target := GetCreatureByID(Self.Attacking);
if Target <> nil then
Self.Containers.UseItemWithCreature(RuneID,Target);
Sleep(1000);
end;
Sleep(100);
end;

Atacar Bixo que não te ataca Ex: Rabbit, Chicken, Etc...

Const
Monster = 'Chiken' //pode ser alterado para o bixo que vc quizer

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].Z <> Self.Z then Continue;
if Creatures.Creature[x].Name = Name then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;

while not Terminated do
begin
UpdateWorld;
if not Self.Attacking then
begin
Creature := GetCreatureByName(Monster);
if Creature <> nil then Creature.Attacking := True;
end;
Sleep(1000);
end;

Auto Magic Wall no SQM em frente ao seu alvo.

APERTE CTRL PARA ATACAR A MAGIC WALL.

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;

begin
while not Terminated do
begin
UpdateWorld;
if Self.Attacking <> 0 then
begin
Creature := GetCreatureByID(Self.Attacking);
if Creature <> nil then
begin
case Creature.Direction of
0: Self.Containers.UseItemWithGround(3180, Creature.X, Creature.Y - 2, Creature.Z);
1: Self.Containers.UseItemWithGround(3180, Creature.X + 2, Creature.Y, Creature.Z);
2: Self.Containers.UseItemWithGround(3180, Creature.X, Creature.Y + 2, Creature.Z);
3: Self.Containers.UseItemWithGround(3180, Creature.X - 2, Creature.Y, Creature.Z);
end;
end;
end;
Sleep(2000);
end;
end;

Auto Screen-Shot ao upar level.

var
Level: integer;

begin
UpdateWorld;
Level := Self.Level;
while not Terminated do
begin
UpdateWorld;
if Level <> Self.Level then
begin
Level := Self.Level;
ScreenShot('c:\level' + IntToStr(Level) + '.jpg');
end;
Sleep(1000);
end;
end;

Auto SSA e Might Ring.

var
RingID: integer;
AmuletID: integer;
ShieldID: integer;
XbowID: 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
RingID := 0; //ID Number de algum anel que vc queira no caso mana ou migth
AmuletID := 3081; //ID number do stone skin amulet..caso nao queira o uso do ssa coloke 0
while not Terminated do
begin
UpdateWorld;
if RingID <> 0 then
begin
if Self.Ring.ID = 0 then
begin
Ring := GetItemFromOpenBackpack(RingID);
if Ring <> nil then
begin
Ring.MoveToBody(Self.Ring, 0);
end;
end;
end;
UpdateWorld;
if AmuletID <> 0 then
begin
if Self.Amulet.ID = 0 then
begin
Amulet := GetItemFromOpenBackpack(AmuletID);
if Amulet <> nil then
begin
Amulet.MoveToBody(Self.Amulet, 0);
end;
end;
end;
Sleep(100);
end;
end;

Auto Utamo Vita ao acabar

while not terminated do
begin
UpdateWorld;
if not Self.MagicShield then
begin
Self.Say('Utamo Vita');
Sleep(2000);
end;
sleep(100);
end;

Auto Utani Hur

Const
Spell = 'utani hur'
MinMana = 60

while not terminated do
begin
UpdateWorld;
if not self.hasting then
if self.mana >= MinMana then
Self.Say(Spell);
sleep(1000);
end;

Auto-Utamo Vita quando for atacado

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);
var
Creature: TTCreature
begin
if Self.Attacking = ID then Exit;
Creature := GetCreatureByID(ID);
if (not Creature.NPC) and (not Self.MagicShield) then Self.Say('utamo vita');
Sleep(1000);
end;

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

Coloca e retira 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 <>
if Self.Feet.ID = Bsteel then
begin
Boh.MoveToBody(Self.Feet, 0);
end;
end;
Sleep(100);
end;
end;

Coloca o Loot em um determinado SQM.

Const
ItemsIDs = [3031,3147,3286,3367,3364,3354] //aqui o id do item que queira que drope :P
X = ?? // Mude
Y = ?? // Mude
Z = ?? // Mude

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;

while not terminated do
begin
UpdateWorld;
for i := self.containers.count - 1 downto 0 do
begin
for x1 := self.containers.container[i].count - 1 downto 0 do
begin
ok := false;
for y1 := Low(ItemsIDs) to High(ItemsIDs) do
begin
if self.containers.container[i].item[x1].id = ItemsIDs[y1] then
ok := true;
end;
if ok then
begin
self.containers.container[i].item[x1].movetoground(X,Y,Z,0);
Self.DisplayText(self.containers.container[i].item[x1].id);
sleep(500);
end;
end;
end;
sleep(100);
Items := 0;
for i := low(ItemsIDs) to High(ItemsIDS) do
begin
Item := GetItemFromOpenBackpack(ItemsIDs[i]);
if Item <> nil then
Items := Items + 1;
end;
sleep(100);
end;

Colocar ring quando for atacar.

var
RingID: 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
RingID := 3097; //Alterar o id Do Ring
while not Terminated do
begin
UpdateWorld;
if Self.Attacking <> 0 then
begin
if Self.Ring.ID = 0 then
begin
Ring := GetItemFromOpenBackpack(3097); //Alterar o id do RIng
if Ring <> nil then
begin
Ring.MoveToBody(Self.Ring, 0);
end;
end;
end
else
begin
if Self.Ring.ID <> 0 then
begin
Self.Ring.MoveToContainer(Self.Containers.Container[0], 0, 0);
end;
end;
Sleep(100);
end;
end;

Deslogar se pessoas indesejaveis na vip entrarem.

Const
VipNames = ['Pessoa1','Pessoa2','Pessoa3','Pessoa4'] // Nome das pessoas indesejaveis

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;

Escolha os monstros que você queira atacar primeiro.

Const
Name=['MONSTER 1', 'MONSTER 2', 'MONSTER 3', 'MONSTER 4'];
SwitchAt=30;// the % of the current attacked monster
//that if the monster has lass % hp than this, we will NOT change to the stronger 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) <= 1) and (abs(c.Y-self.Y) <= 1) 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
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;

Exana Pox com mais de 5 de Poison.

var
MaxPoison: integer;

procedure Event_Notice(Text: string);
var
PoisonAmount: string;
begin
UpdateWorld;
if Self.Mana <>
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 := 4;
while not Terminated do
begin
ProcessEvents;
Sleep(100);
end;
end;

Exori Hur/San/Con

const
CreatureList = ['Demon']; //Nome do biixo
SpellList = ['Exori Hur']; //Nome da magiia
ManaList = [120]; //Minimo de mana que precisa ter para usar a magia
HealthList = [20]; //Com qnts % vai parar de usar a magia
RangeList = [8]; //Qnts SQM vai tar do bicho para começar a soltar a magia!

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
Creature: TCreature;
Range,X,ID: Integer;

begin
while not Terminated do
begin
UpdateWorld;
if (Self.Attacking) then
begin
Creature:=GetCreatureByID(Self.Attacking);
if (Assigned(Creature)) then
begin
ID:=-1;
for X:=Low(CreatureList) to High(CreatureList) do
if (CreatureList[X] = Creature.Name) then
ID:=X;
if (ID > -1) then
begin
Range := Round(Sqrt(Sqr(Self.X - Creature.X) + Sqr(Self.Y - Creature.Y)));
if (Range <= RangeList[ID]) and (Self.Mana >= ManaList[ID]) and (Creature.Health >= HealthList[ID]) then
Self.Say(SpellList[ID]);
end;
end;
end;
Sleep(1800);
end;
end;