If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up
process will only take up about a minute of two of your time.

begin
updateworld;
while self.attacking=0 do
begin
sleep(200);
updateworld;
end;
LockID:=self.attacking;
while not terminated do
begin
updateworld;
ProcessEvents;
if ((self.attacking)<>(LockID)) and ((self.attacking)<>(0)) then
LockID:=Self.Attacking;
Creature:=GetCreatureByID(LockID);
if (Creature<>nil) and (Self.attacking=0) then
if Creature.z=self.z then
Creature.attacking:=true;
sleep(100);
end;
end;

begin
updateworld;
while self.attacking=0 do
begin
sleep(200);
updateworld;
end;
LockID:=self.attacking;
while not terminated do
begin
updateworld;
ProcessEvents;
if ((self.attacking)<>(LockID)) and ((self.attacking)<>(0)) then
LockID:=Self.Attacking;
If Self.Attacking=0 then
begin
Creature:=GetCreatureByID(LockID);
If Creature<>nil then Creature.Attacking:=true;
end;

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(TrainName[x]);
if Creature <> nil then
creature.attacking:=true;
sleep(100); updateworld;
end;
end;
if attacking then
begin
Creature:=GetAttackedCreature;
if Creature <> nil then
if creature.Health < StopAt then creature.attacking:=false;
end;
sleep(1000);
end;
end;

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;

begin
updateworld;
G:=false;
T:=false;
while not terminated do
begin
Bla:=Self.Containers.Count;
updateworld;
Creature:=GetCreatureBesideYou;
if Creature<>nil then
if Creatures.Creature[x].Health>AttackAt 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 IsTileWalkable(Tile) 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 IsTileWalkable(Tile) 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 IsTileWalkable(Tile) 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 IsTileWalkable(Tile) then
Self.MoveRight;
end;
end;
end;
sleep(1000);
end;
end;