segunda-feira, 28 de julho de 2008

Scripts

Health Potion

const
minMana = 20; //minimum mana
minHealth = 800; //Life pra tomar o Pote
maxHealth = 1000; //Life pra usar Exura abaixo disso


while not Terminated do
begin
UpdateWorld;
if (Self.Health < minHealth) then
begin
Self.Containers.UseItemWithSelf(239);
Sleep(1000);
end;
else
begin
if (Self.Health <> minMana ) then
begin
Self.Say('Exura'); //VC PODE TROCAR OS VALORES COMO EXURA VITA EXURA GRAN
Sleep(1500);
end;
end;
Sleep(100);
end;

.............................
(obs) altera de acordo com cada potion
para usar potion de vida
id aonde esta em vermelho

------------------------------------------------------------------------------------------------

Mana Potion

const
minMana = 200; //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;

.......................
para usar manas potions
(obs) tem que alterar o id de cada tipo de mana potion
id é aonde esta em vermelho

------------------------------------------------------------------------------------------------



Slime Treiner

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;

obs: antes de executar o script de follow no slime mae

------------------------------------------------------------------------------------------------

Maker Enchanted Spear

Const
SpearID = 3277
Spell = 'Exeta con'
MinMana = 600
MinSoul = 5
WeaponID = 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;

While not terminated do
begin
UpdateWorld;
if Self.Mana >= MinMana then
if Self.Soul >= MinSoul then
begin
Spear := GetItemFromOpenBackpack(SpearID);
if Spear <> nil then
Spear.MoveToBody(Self.RightHand,1);
Sleep(800);
UpdateWorld;
If Self.RightHand.ID = SpearID then
Self.Say(Spell);
UpdateWorld;
Weapon := GetItemFromOpenBackpack(WeaponID);
if Weapon <> nil then
Weapon.MoveToBody(Self.RightHand,0);
end;
sleep(500);
end;
------------------------------------------------------------------------------------------------

Atack Tal Monstro Com tal magia

const
frigo = ['banshee'];
flam = ['ancient scarab'];
tera = ['cyclops'];
vis = ['acolyte of the cult'];
mort = ['black knight'];
useWand = 0 //se estiver com Wand 1 sem wand 0

function GetExoriType(Crea: TCreature): String;
begin
Result := '';

for z := Low(frigo) to High(frigo) do
begin
if AnsiLowerCase(Crea.Name) = AnsiLowerCase(frigo[z]) then
Result := 'exori frigo';
end;

for z := Low(flam) to High(flam) do
begin
if AnsiLowerCase(Crea.Name) = AnsiLowerCase(flam[z]) then
Result := 'exori flam';
end;

for z := Low(tera) to High(tera) do
begin
if AnsiLowerCase(Crea.Name) = AnsiLowerCase(tera[z]) then
Result := 'exori tera';
end;

for z := Low(vis) to High(vis) do
begin
if AnsiLowerCase(Crea.Name) = AnsiLowerCase(vis[z]) then
Result := 'exori vis';
end;

for z := Low(mort) to High(mort) do
begin
if AnsiLowerCase(Crea.Name) = AnsiLowerCase(mort[z]) then
Result := 'exori mort';
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;

begin
sleepTime := 1100;
if useWand = 0 then
sleepTime := 1000;

while not terminated do
begin
updateworld;
if Self.Attacking <> nil then
begin
creature := GetCreatureByID(self.attacking);
if creature <> nil then
begin
exori := GetExoriType(creature);
if exori <> '' then
begin
updateworld;
if (abs(creature.x - self.x) <= 3) and (abs(creature.y - self.y) <= 3) then
begin
if Self.Attacking > 0 then
if creature.visible then
self.say(exori);
end;
end;
end;
end;
sleep(sleepTime);
end;
end;
------------------------------------------------------------------------------------------------

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; //id do ring que desejar
begin
UpdateWorld;
if Self.Attacking <> 0 then
begin
if Self.Ring.ID = 0 then
begin
Ring := GetItemFromOpenBackpack(3097);
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.Container
s.Container[0], 0, 0);
end;
end;
Sleep(100);
end;
end;

(OBS) Alterar os dois ids que estiver em vermelho para que coloke e tire o anel
------------------------------------------------------------------------------------------------

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;
------------------------------------------------------------------------------------------------

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;
------------------------------------------------------------------------------------------------

Exura Sio no amigo ou em vc mesmo

Const MiniCreatureHP =50; //Medido Em Porcentagem.. se o char tiver 1500 de life estando 50 ali ele dara o sio com 750 de life
const ITEM_RUNE_UH = 3160; //caso ele nao solte Exura Sio Ele Soltarar uma Uh
const Name='Nome Do Char'; //Coloke o Nome do char
var
Creature: TCreature;
CreatureName: string;

function IsCreatureVisible(Name: string): 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].Name = Name then
begin
if Creatures.Creature[x].Visible then
begin
Result := True;
Exit;
end;
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(Name);
If Creature<> nil then
If IsCreatureVisible(Name) then
begin
if ((Creature.Health) <(MiniCreatureHP)) and ((Self.Mana)>(70)) then
Self.Say('[red[exura sio "'+Name)
else
if ((Creature.Health) <(MiniCreatureHP)) then Self.Containers.UseItemWithCreature(ITEM_RUNE_UH, Creature);
end;
Sleep(1000);
end;

end;
------------------------------------------------------------------------------------------------

Monk Treiner


Const
StopAt=50;//para de atacar qn tiver com 50% de vida
AttackAt=60;// ataca monk/player com mais de 50% de Life
TrainName=['Monk','FrinedName1','FriendName2'];//vc pode alterar caso nao seja em mundo pvp
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].z=Self.Z 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
For x:=low(TrainName) to high(trainName) do
begin
If self.attacking<>0 then break;
Creature:=GetCreatureByNameHPHIGH(TrainN
ame[x]);
if Creature <> nil then
creature.attacking:=true;
sleep(100); updateworld;
end;
end;
f attacking then
begin
Creature:=GetAttackedCreature;
if Creature <> nil then
if creature.Health < StopAt then creature.attacking:=false;
end;
sleep(1000);
end;
end;
------------------------------------------------------------------------------------------------

Health Potion Sem a função Exura

const

PHealth = 245; //Life pra usar potion

while not Terminated do
begin
UpdateWorld;
if (Self.Health < PHealth) then
begin
Self.Containers.UseItemWithSelf(266);// configure conforme a poção usada
Sleep(1000);
end;
end;
------------------------------------------------------------------------------------------------

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;
------------------------------------------------------------------------------------------------

Cap Alert

alerta qnd tiver com o numero desejado de cap no caso e 10 mas onde esta de vermelho vc modifika pelo quanto de cap q o char tiver para dar o alarme

Const
cap = 10

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

Mata bixo que nao te ataca tipo chiken derr e 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;
------------------------------------------------------------------------------------------------

Alerta qnd tiver poucas Spears

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;
------------------------------------------------------------------------------------------------