quinta-feira, 31 de julho de 2008

ScreenShot on advance

var
Level: integer;
MLevel: integer;
Axe: integer
Fishing: integer
Shielding: integer
begin
UpdateWorld;
Level := Self.Level;
MLevel := Self.Skills.Magic;
Axe := Self.Skills.Axe;
Fishing := Self.Skills.Fishing;
Shielding := Self.Skills.Shielding;
while not Terminated do
begin
UpdateWorld;
if Level <> Self.Level then
begin
Level := Self.Level;
ScreenShot('c:\level' + IntToStr(Level) + '.jpg');
Level := Self.Level;
end;
if MLevel <> Self.Skills.Magic then
begin
MLevel := Self.Skills.Magic;
ScreenShot('c:\Mlevel' + IntToStr(MLevel) + '.jpg');
MLevel := Self.Skills.Magic;
end;
if Axe <> Self.Skills.Axe then
begin
Axe := Self.Skills.Axe;
ScreenShot('c:\Axe' + IntToStr(Axe) + '.jpg');
Axe := Self.Skills.Axe;
end;
if Fishing <> Self.Skills.Fishing then
begin
Fishing := Self.Skills.Fishing;
ScreenShot('c:\Fishing' + IntToStr(Fishing) + '.jpg');
Fishing := Self.Skills.Fishing;
end;
if Shielding <> Self.Skills.Shielding then
begin
Shielding := Self.Skills.Shielding;
ScreenShot('c:\Shielding' + IntToStr(Shielding) + '.jpg');
Shielding := Self.Skills.Shielding;
end;
Sleep(1000);
end;
end;

Sendinfomsg

var
seconds, min, hours, count:integer;
mini, exp, AvargeExp, total:integer;
procedure Event_Message(Channel: integer; Name, Text: String);
begin
updateworld;
if Text='levelstatus' then
begin
updateworld;
self.PrivateMessage(Name, 'Hunting for '+inttostr(Hours)+':'+inttostr(mini)+':'+inttostr(seconds));
sleep(2000);
self.PrivateMessage(Name, 'Level: '+IntToStr(self.level));
sleep(2000);
self.PrivateMessage(Name, 'Experience: '+IntToStr(self.Experience));
sleep(2000);
self.PrivateMessage(Name, 'Magic Level: '+IntToStr(self.Skills.Magic.level));
sleep(2000);
self.PrivateMessage(Name, 'Exp/Hour: ' +IntToStr(AvargeExp));
sleep(2000);
self.PrivateMessage(Name, 'Gained so far: ' +intTostr(total));
end;
end;

begin
updateworld;
AvargeExp:=0;
exp:=self.Experience;
count:=0;
seconds:=0;
min:=0;
hours:=0;
while not terminated do
begin
sleep(1000);
updateworld;
count:=count+1;
Seconds:=count mod 60;
if count>=60 then
min:=count div 60;
mini:=min mod 60;
if min>=60 then
Hours:=min div 60;
total:=(self.Experience-exp);
AvargeExp:=(self.Experience-exp)/count*60*60;
self.displayText('Running for '+inttostr(Hours)+':'+inttostr(mini)+':'+inttostr(seconds)+' EXP avarge '+inttostr(AvargeExp)+' Gaind so far:'+inttostr(total));
ProcessEvents;
end;
end;

Wear Stone Skin Amulet when key pressed

var
AmuletID: 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;

procedure Event_KeyDown(Key: integer);
var
Amulet: TItem;
begin
UpdateWorld;
if Key = 9 then //Change number to hotkey of your likeing currently TAB
begin
if Self.Amulet.ID <> AmuletId then
begin
Amulet := GetItemFromOpenBackpack(AmuletID);
if Amulet <> nil then Amulet.MoveToBody(Self.Amulet, 0);
end
end;
end;

begin
AmuletID := 3081; //item id for your Amulet
while not Terminated do
begin
ProcessEvents;
Sleep(100);
end;
end;

Pot Destroyer by LordOfWar

//Your weapon must be in your left hand
const
ITEM_ID = 3465;

var
Checked: array of integer;
ScanX: integer;
ScanY: integer;
ScanItem: TItem;

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
Result := False;
end;
end;
end;

function FindPath(FromX, FromY, FromZ, ToX, ToY, ToZ: integer; CheckLastTile: boolean): boolean;
var
Xloop, Yloop: integer;
begin
Result := False;
if FromZ <> ToZ then Exit;
Checked[abs(FromX - (Self.X - 7)), abs(FromY - (Self.Y - 5))] := True;
for Xloop := 0 to 2 do
begin
for Yloop := 0 to 2 do
begin
if (((FromX - 1) + Xloop) <> Self.X + 7) then Continue;
if (((FromY - 1) + Yloop) <> Self.Y + 5) then Continue;
if (((FromX - 1) + Xloop) = ToX) and (((FromY - 1) + Yloop) = ToY) then
begin
if IsTileWalkable(GetTileFromXYZ((FromX - 1) + Xloop, (FromY - 1) + Yloop, FromZ)) or (not CheckLastTile) then
begin
Result := True;
Exit;
end;
end;
if ((Xloop = 1) and (Yloop = 1)) then Continue;
if Checked[abs(((FromX - 1) + Xloop) - (Self.X - 7)), abs(((FromY - 1) + Yloop) - (Self.Y - 5))] then Continue;
if IsTileWalkable(GetTileFromXYZ((FromX - 1) + Xloop, (FromY - 1) + Yloop, FromZ)) then
begin
if FindPath((FromX - 1) + Xloop, (FromY - 1) + Yloop, FromZ, ToX, ToY, ToZ, CheckLastTile) then
begin
Result := True;
Exit;
end;
end;
end;
end;
end;

function IsReachable(X, Y, Z: integer);
begin
Checked := VarArrayCreate([0, 14, 0, 10], 11);
for InitX := 0 to 14 do
begin
for InitY := 0 to 1 do
begin
Checked[InitX, InitY] := False;
end;
end;
Result := FindPath(Self.X, Self.Y, Self.Z, X, Y, Z, False);
end;

function IsItemOnTile(ID: integer; Tile: TTile): boolean;
var
Z: integer;
begin
Result := False;
for Z := 0 to Tile.Count - 1 do
begin
if Z >= Tile.Count then Break;
if Tile.Item[Z].ID = ID then
begin
Result := True;
Break;
end;
end;
end;

while not Terminated do
begin
UpdateWorld;
for ScanX := 0 to 14 do
begin
for ScanY := 0 to 10 do
begin
if IsItemOnTile(ITEM_ID, Screen.Tile[ScanX, ScanY]) then
begin
if IsReachable(Self.X + (ScanX - 7), Self.Y + (ScanY - 5), Self.Z) then Self.LeftHand.UseWithGround(Self.X + (ScanX - 7), Self.Y + (ScanY - 5), Self.Z);
end;
Sleep(1);
end;
Sleep(1);
end;
Sleep(250);
end;

Follower by Darkmystery

////////CONFIG:///////////
Leader = 'Eternal Oblivion'; // The person who can say the 'follow'/'stop' word.
FollowWord = 'follow'; // Word to follow, example: follow Darkmystery.
StopFollowWord = 'stop';// Word that stops the following.
SQMDistance = 4; // The distance that the char will be behind you. (1 = right behind you)
FollowMode = 2; // 1 = Walking Behind something, 2 = Walking in front of something.
//////////////////////////

var
X1: Integer;
Y1: Integer;
CreatureToFollow: string;
OK: Boolean;
Tile: TTile;
procedure Event_Message(Channel: integer; Name, Text: String);
var
Followname :string;
begin
if Name = Leader then begin
if Text = StopFollowWord then begin
OK := False
exit;
end;
updateworld;
FollowName := Text;
if Pos(FollowWord, FollowName)<>0 then
begin
OK := False;
Delete(FollowName, 1, length(FollowWord)+1);
CreatureToFollow := FollowName;
OK := True;
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 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 GetCreature: byte;
var
x, Adjustment: integer;
begin
updateworld;
result := 0;
for x := 0 to Creatures.Count - 1 do
begin
if(Creatures.Creature[x].Name <> Self.Name) then begin
if(Creatures.Creature[x].Name = CreatureToFollow) then begin
X1 := Creatures.Creature[x].X
Y1 := Creatures.Creature[x].Y

if FollowMode = 1 then Adjustment := SQMDistance
if FollowMode = 2 then begin
Adjustment := SQMDistance * 2
Adjustment := SQMDistance - Adjustment
end;

case Creatures.Creature[x].Direction of
0 : Y1 := Y1 + Adjustment
1 : X1 := X1 - Adjustment
2 : Y1 := Y1 - Adjustment
3 : X1 := X1 + Adjustment
end;

result := 1;
exit;
end;
end;
end;
end;

begin
while not Terminated do
begin
processevents;

if OK then begin
if GetCreature = 1 then begin
Tile := GetTileFromXYZ(X1, Y1, Self.Z)
if IsTileWalkable(Tile) then
Self.MoveTo(X1, Y1, Self.Z);
end;
end;

sleep(500);
end;
end;

Logout if player on screen and login some minutes later

Const
Minutes = 5
Seconds = 30
Char_Name = 'Mateusz Dragon Wielki'
World = 'Harmonia'
Password = 'tibia'
Acc_Number = 111111

while not terminated do
begin
UpdateWorld;
for i := 0 to Creatures.Count -1 do
begin
if i >= Creatures.Count then break;
if not Creatures.Creature[i].NPC then
if Creatures.Creature[i].Name <> Self.Name then
if Creatures.Creature[i].Z = Self.Z then
begin
Sleep(1000);
Self.Logout(false);
Sleep(Minutes*60000 + Seconds*1000);
UpdateWorld;
Self.Login(Acc_Number,Password,Char_Name,World);
end;
sleep(10);
end;
Sleep(100);
end;

Logout When X Mana

Const
Xmana = 0

while not terminated do
begin
UpdateWorld;
if Self.Mana <=Xmana
then Self.Logout(True);
sleep(500);
end;

Logout your char and login the hunted char when the hunter log off

Const
HunterName = 'Hunters Namer Here' // when this one logout from vip you logout and enter your char
AccountNumber = 1234567 // enter here the account number of the rune maker
Password = 'Your Password' //enter here the password
Character = 'Your Hunted Char' // enter here the name of the hunted who should login
World = 'Your World Name Here' //enter here the world...

procedure Event_VIPLogOff(ID :integer);
begin
UpdateWorld;
For i:= 0 to VipList.Count -1 do
begin
if (VipList.Vip[i].ID = ID) and (VipList.Vip[i].Name = HunterName) then
begin
Self.Logout(false);
Sleep(5000);
Self.Login(AccountNumber,Password,Character,World);
end;
Sleep(100);
end;
end;

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

logout if vip login or logoff

Const
VipNames = ['Mateusz Dragon Wielki','Eternal Oblivion','Seromontis','Tripida'] // Enter the player name who will login in your vip and you log out.

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;

Logout When Soul Points are full

Const
SoulLog = 100 // At what soul character loggs off?
While not terminated do
begin
UpdateWorld;
if Self.Soul = SoulLog
then Self.Logout(true);
Sleep(100);
end;

Logout if player on floor under + Safe List

Const
PlayerSafe = ['Player1','Player2','Player3'] // add players as many as you want.

while not terminated do
begin
UpdateWorld;
For G:= 0 to Creatures.Count -1 do
begin
for i:= Low(PlayerSafe) to High(PlayerSafe) do
begin
If Creatures.Creature[G].Z = Self.Z + 1 then
If Creatures.Creature[G].Name = PlayerSafe[i] then
Self.Logout(true);
Sleep(100);
end;
sleep(100);
end;
sleep(100);
end;

Alertwhenlowonspears

const
spear_amount = 5 //number of spears to alert at
pause_time = 10 // number of seconds pause between alerts
alert_file = 'c:\windows\media\notify.wav' // must be a wav file

begin
while not terminated do begin
UpdateWorld;
if Self.RightHand.Amount <= spear_amount then
begin
PlaySound (alert_file);
sleep(pause_time*1000);
end;
sleep(100);
end;
end;

Alert When No Bag or Backpack on Screen

Const
BagID = 1
AlertFrom = 'C:/Windows/Media/Notify.wav' //must be wav file.

Function IsItemOnScreen(ID:integer):boolean;
begin
Result := false;
for x := 0 to 14 do
begin
if x > 14 then break;
for y := 0 to 10 do
begin
if y > 10 then break;
for i := 0 to Screen.Tile[x,y].count - 1 do
begin
if i >= Screen.Tile[X,Y].Coutn then break;
if Screen.Tile[x,y].Item[i].ID = ID then
begin
Result := true;
exit;
end;
end;
end;
end;
end;

while not terminated do
begin
UpdateWorld;
if not IsItemOnScreen(BagID) then
PlaySound(AlertFrom);
sleep(400);
end;

Alertwhenvipon

Const
VipName = 'Enter Name Here' // Enter the player name who will login in your vip and you log out.
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;

Alert When X moster on screen

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:\Windows\Media\Notify.wav');
sleep(100);
end;
sleep(100);
end;

Alert When X Cap Left

Const
Cap = 0 // If cap equals or below this then bot alerts.
AlertFrom = 'C:/Windows/Media/Notify.wav' // ONLY WAV FILES!
Logout = 0 // 0: no logout. 1: logout. 2:force logout.
While not terminated do
begin
UpdateWorld;
if self.connected then
If Self.Capacity <= Cap then
begin
PlaySound(AlertFrom);
if Logout = 1 then Self.Logout(False);
if Logout = 2 Then Self.Logout(True);
end;
sleep(1000);
end;

Alert When X Mana Fluid or Uh's Left

Const
UH_ID = 3160 // Enter the UH ID.
MF_ID = 2874 // Enter here manafluid ID.
UH_Alert = 5 // when UH_Alert UH's left then it alets...
MF_Alert = 10 // when this number of MF left then it alerts....

While not terminated do
begin
UpdateWorld;
A:=0;
B:=0;
for i:= 0 to Self.Containers.Count -1 do
begin
for G:= 0 to Self.Containers.Container[i].Count -1 do
begin
if Self.Containers.Container[i].Item[G].ID = UH_ID
then A:= A +1;
if Self.Containers.Container[i].Item[G].ID = MF_ID then
if Self.Containers.Container[i].Item[G].amount = 10
then B:= B + 1;
Sleep(100);
end;
Sleep(100);
end;
if (A <= UH_Alert) or ( B <= MF_Alert ) then
PlaySound('C:\Windows\Media\Notify.wav');
sleep(100);
end;

Alert When GM Messages

Const
Path = 'C:/Windows/Media/Notify.wav' // Must be wav file!
procedure event_message(Channel:integer; Name,Text:String);
begin
UpdateWorld;
Name1 := Name;
if (Name1[2] = 'M') and ((Name1[0] = 'G') or (Name1[0]='C')) then
begin
PlaySound(Path);
end;
end;

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

Slime Trainer

const
StrongWeaponID = 1111; //The weapon that will be used to kill the mother slime
WeakWeaponID = 1111; //The weapon that will be used to train
MinCreatures = 3; //The minimum amount of creatures attacking you to kill the mother slime to avoid shieldbreaking
MaxTime = [5,0,0]; //The maximum training time (hours, minutes, seconds)
MinHP = 200; // The HP you need to have to kill the mother slime

function GetItemFromOpenBackpack(ID: Integer): TItem;
begin
UpdateWorld;
Result := nil;
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 = ID then
Result := Self.Containers.Container[x].Item[y];
end;
end;
end;

function GetNumberOfAttackingCreatures: Integer;
begin
UpdateWorld;
Result := 0;
for x := 0 to Creatures.Count - 1 do
begin
if (Abs(Creatures.Creature[x].X - Self.X) <= 1) and
(Abs(Creatures.Creature[x].Y - Self.Y) <= 1) and
(Creatures.Creature[x].Z = Self.Z) and
Creatures.Creature[x].NPC then
Result := Result + 1;
end;
end;

function AttackCreatureByID(ID: Integer);
begin
UpdateWorld;
for x := 0 to Creatures.Count - 1 do
begin
if Creatures.Creature[x].ID = ID then
Creatures.Creature[x].Attacking := True;
end;
end;

var
MotherSlime, X1, Y1: Integer;
Finished: Boolean;
StartTime: Float;
MaxSeconds: Integer;
Item: TItem;
begin
UpdateWorld;
MotherSlime := Self.Following;
Finished := False;
StartTime := Time;
MaxSeconds := (MaxTime[0] * 3600) + (MaxTime[1] * 60) + MaxTime[2];
if MotherSlime = 0 then
begin
Self.DisplayText('Mother slime not found! Please follow it and then execute the script.');
Finished := True;
end;
while (not Terminated) and (not Finished) do
begin
UpdateWorld;
if GetNumberOfAttackingCreatures >= MinCreatures then
begin
Item := GetItemFromOpenBackpack(StrongWeaponID);
if Item <> nil then
begin
if Self.RightHand = WeakWeaponID then
Item.MoveToBody(Self.RightHand, 0);
else
Item.MoveToBody(Self.LeftHand, 0);
end;
AttackCreatureByID(MotherSlime);
Self.DisplayText('There are too many creatures around you. Exiting script.');
Finished := True;
end;
if StartTime + (MaxSeconds / 100000) <= FloatToStr(Time) then
begin
Item := GetItemFromOpenBackpack(StrongWeaponID);
if Item <> nil then
begin
if Self.RightHand = WeakWeaponID then
Item.MoveToBody(Self.RightHand, 0);
else
Item.MoveToBody(Self.LeftHand, 0);
end;
AttackCreatureByID(MotherSlime);
Self.DisplayText('You have trained for too long. Exiting script.');
Finished := True;
end;
if Self.Health <= MinHP then
begin
Item := GetItemFromOpenBackpack(StrongWeaponID);
if Item <> nil then
begin
if Self.RightHand = WeakWeaponID then
Item.MoveToBody(Self.RightHand, 0);
else
Item.MoveToBody(Self.LeftHand, 0);
end;
AttackCreatureByID(MotherSlime);
Self.DisplayText('Your health is too low. Exiting script.');
Finished := True;
end;
if not Self.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;
Z1 := Creatures.Creature[x].Z;
if (Abs(X1 - Self.X) <= 1) and (Z1 = Self.Z) then
begin
UpdateWorld;
if (Abs(Y1 - Self.Y) <= 1) and (Z1 = Self.Z) then
begin
Creatures.Creature[x].Attacking := true;
Break;
end;
end;
end;
end;
end;
end;
Sleep(1000);
end;
end;

Combo Ue

Const
Leader='Hiho';//set the leader name.
KeyWord='attack!';//key word to triger ue casting.

procedure Event_Message(Channel: integer; Name, Text: String);
begin
If Name=Leader then
If Pos(KeyWord, Text) <> 0 then
Self.Say('exevo gran mas vis');
end;

begin
while not terminated do
begin
processEvents;
sleep(100);
end;
end;