#1 2010-09-22 21:09:13

Masterix

Moderator

Zarejestrowany: 2010-09-22
Posty: 17
Punktów :   

Kilka przydatnych skryptów

Rzuca loot w x,y,z

Kod:

Const
  ItemsIDs = [3374,3286,2920]
  X = 33123
  Y = 32093
  Z = 8

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;
  if not Items then
    break;
  sleep(100);
end;

Anty paraliż

Kod:

const
minMana = 25;

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

Jedzenie gdy manna nie rośnie

Kod:

Const
  NoRegain = 4 // K-6, EK-6, P-4, RP-3, D-3, ED-2, S-3, MS-2


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 EatFood;
Const
  FoodList = [3595,3577,3578,3579,3582,3583,3584,3600,3584,3585,3586,3587,3588,3589,3590,3591, ​3592,3593,3594,3598,3599,3601,3602,3607,3725]
Var
  i: Integer
begin
  for i := Low(FoodList) to High(FoodList) do
  begin
    Food := GetItemFromOpenBackpack(FoodList[i]);
    if Food <> nil then
    begin
      Food.Use;
      break;
    end;
  end;
end;


UpdateWorld;
count := 0;
Mana := self.mana;
while not terminated do
begin
  Updateworld;
  if Mana = Self.Mana then
    count := count + 1;
  else
  begin
    count := 0;
    Mana := Self.Mana
  end;
  if count > NoRegain then
  begin
    EatFood;
    count := 0;
  end;
  sleep(1000);
end;

"Set Friendly"

Kod:

var x : integer;
Looting:boolean;

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 PlayerOnScreen : 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].z=self.z then
if Creatures.Creature[x].Name<>Self.Name then
if not Creatures.Creature[x].NPC then
begin
Result :=true;
Exit;
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 FindClosest : integer;
var i, l, closest_num, closest_range, last_closest_range : integer;
begin
if not attacking then
begin
closest_num := -1;
last_closest_range := 5000;
for i := 0 to Creatures.Count - 1 do
if (Creatures.Creature[i].Z = Self.Z) then
if (Creatures.Creature[i].NPC = true) then
begin
closest_range := Round(Sqrt(Sqr(Self.X - Creatures.Creature[i].X)) + Sqr(Self.Y - Creatures.Creature[i].Y));
if (closest_range < last_closest_range) then
begin
last_closest_range := closest_range;
closest_num := i;
end;
end;
Result := closest_num;
Exit;
end;
end;

var found, Bla,y : integer;
begin
updateworld;
Bla:=Self.Containers.Count;
Looting:=false;
while not terminated do
begin
UpdateWorld;
if Self.Containers.Count>Bla then begin D:=Self.Containers.Count; Looting:=true; end;
if (Looting=true) then
begin
updateworld;
Z:=self.x;
y:=self.y;
Self.DisplayText('Sorry, not possible');
repeat
sleep(200);
updateworld;
until (Z<>Self.x) or (y<>self.y);
Looting:=false;
Self.DisplayText('Sorry, not possible.');
end;
updateworld;
found := FindClosest;
if (found <> -1) then
if (attacking=false) and (PlayerOnScreen=false) and (Looting=false) then
Creatures.Creature[found].Attacking := true;
Sleep(1000);
end;
end;

Alarm gdy nie ma food

Kod:

Const
  FoodID = 1111 //enter here the food you want...
  MusicPath = 'C:\Windows\Media\Notify.wav' // ścieżka do alarmu
                                           // Możesz dowolnie zmienić dźwięk na taki jaki chcesz

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;

Zmiana ss i mighty ringów
Kod:
var
  RingID: integer; // ID Ringa ( np Might Ring )
  AmuletID: integer; // ID Amuletu ( np Stone Skin Amulet )
  
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; //item number of ring to wear or 0 to ignore rings
  AmuletID := 3572; //item number of amulet to wear or 0 to ignore amulet
  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;

Automatyczne strzelanie m-walami przed playera

Kod:

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 logout gdy "x" expa

Kod:

var
  Experience: ILOŚĆ expa; // wpisujemy ilość expa po którym bot wyloguje nas

begin
  UpdateWorld;
  Experience := Self.Experience;
  while not Terminated do
  begin
    UpdateWorld;
    if Experience <> Self.Exeperience then
    begin
      Self.Logout(True);
      Beep;
      Exit;
    end;
    Sleep(100);
  end;
end;

Auto exana pox gdy zostaniemy zatruci

Kod:

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 := 2;
  while not Terminated do
  begin
    ProcessEvents;
    Sleep(100);
  end;
end;

Automatyczne wlogowanie po save serwerze

Kod:

const
  Account = 1234567; // Numer twojego konta
  Password = 'mypassword'; // hasło twojego konta
  Character = 'LordOfWar'; // nazwa postaci na jaką ma wlogować
  World = 'Antica'; // świat na którym jest postać

while not Terminated do
begin
  UpdateWorld;
  if not Self.Connected then
  begin
    Self.Login(Account, Password, Character, World);
    Sleep(15000);
  end;
  Sleep(100);
end;

Robi ss jak wbijesz lvl

Kod:

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;

Logout gdy wbijesz "x" lvl

Kod:

Const
   Lvl = 50

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

Atakuje nie widzialne potwory z runku np. hmm

Kod:

Const
  RuneID = 0 // ID Runy z jakiej ma atakować
  Delay = 1000 // odstęp czasowy w jakim ma atakować

while not terminated do
begin
  UpdateWorld;
  for i := 0 to creatures.count - 1 do
  begin
    if Creatures.Creature[i].NPC then
    if Creatures.Creature[i].Outfit = 0 then
    begin
      Self.Containers.UseItemWithCreature(
RuneID,Creatures.Creature[i]);
      sleep(1500);
    end;
  end;
  sleep(100);
end;

Alarm gdy bot przestanie chodzić

Kod:

var
  x, y, z, t: integer;

begin
  UpdateWorld;
  x := Self.X;
  y := Self.Y;
  z := Self.Z;
  t := 0;
  while not Terminated do
  begin
    Sleep(1000);
    UpdateWorld;
    if ((x = Self.X) and (y = Self.Y) and (z = Self.Z)) then
    begin
      Inc(t);
      if t > 60 then
      begin
        PlaySound('C:/Windows/Media/ringin.wav'); // możemy zmienić na dowolny dźwięk
        t := 10000;
      end;
    end
    else
    begin
      x := Self.X;
      y := Self.Y;
      z := Self.Z;
      t := 0;
    end;
  end;
end;

Alarm gdy "x" spear

Kod:

Const
  SpearMin = 3; // ilość spear gdy ma wyć alarm

While not terminated do begin
  updateworld;
  Sound:=False;
  If Self.RightHand.Id <> nil then
    If Self.RightHand.Amount <=SpearMin then
      Sound:=True;
  If self.RightHand.Id = nil then
    Sound:=True;
  IF Sound Then
    PlaySound('C:\Windows\Media\Notify.wav');
  Sleep(1000);
end;

Offline

 

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.krecanasrury.pun.pl www.pedagogika-pop.pun.pl www.magiczny-pies.pun.pl www.fs2.pun.pl www.nowezycie.pun.pl