SRL Archive - OSR Help

How can i write this shorter?


okokokok

2012-02-16 17:35:46

Hello everybody,

At the moment i'm pretty stuck. I made this procedure:

procedure FightGuards;
var x, y, Guard1, Guard2, Guard3, Guard4, Guard5, Guard6, Guard7, Guard8, Guard9: Integer;
TPA: TPointArray;
begin
Writeln('Looking for a Guard');
Guard1 := DTMFromString('mlwAAAHicY2dgYHgPxF+B+A0UvwPiT0D8AYhnA/ECIJ4PxDOAeDKSmL6qFIO9sQyDp5sbw4S8QIY6XXWGyLBQBid7ewZ+oDwuzIgHQwEADDEQ+g==');
Guard2 := DTMFromString('mrAAAAHic42BgYPgKxH+B+BeU/RGI3wPxFyD+DsSOUOwKxO5A7ALE9kBsDcS2QFxWWMjgbinPEB0RzuBkb8/g6ebGEOSkyhDgoMtgpafAwA9Ugw8zEsAwAAAPcRDS');
Guard3 := DTMFromString('mrAAAAHic42BgYMhmZGBIAeIMIM4B4mQoOx+Ii4CYC4iFgFgYiAWBmAeI2YCYFYg5gThPXYnB3NSUIchJFYxtbJQY7I2VGaq01RjcLTUY+IF24MOMBDAMAAA6aQm0');
Guard4 := DTMFromString('mwQAAAHic42RgYLBnZGAwA2JrIHYAYjcoGyTuAsROQLwLqG4PEO+H4n1AvB2INwPxVgaIvLudBkOAhwpDXnYmg7uLC4O3ixKDlbECg7eTFkNGvBtDhqkCAz9QHSHMSASGAwAEJBCd');
Guard5 := DTMFromString('mrAAAAHic42BgYLBnZGCwAGIbIHYEYhcgtgZiWyB2AuIZQDVzgXgeEM8B4plAPBWIJ0JpJyNZBk8LcYbQwECGgpxshsiwUAZPcwWGTlkRhkhnDQZ+oBp8mJEAhgEA3WkNzw==');
Guard6 := DTMFromString('mlwAAAHicY2dgYGBkBBEMDKxQzALE/4FC/4A4FIi9gNgHiAOBOByII4A4CIijI8IZwp3UGYLsVBn8rJUZcjIyGKLdZBg8zRUY+IHyuDAjHgwFANJSCoo=');
Guard7 := DTMFromString('m6wAAAHic42ZgYDgExCeB+BQQHwbiPUC8G4j3QTFI/igUVwJxORDXAnEdFFcAcTEQ5wFxDhDnA3EZEAf4+jIEeaky6GuJMpgYGzHoqAsz+LkpM5joyTK422kw1DmoMwS46zKs6k9g4AeqJxYzkoCRAABMPBZj');
Guard8 := DTMFromString('mwQAAAHicjcqxCkAAAIThM5qMlA0pUooNJaOUvAEDipS8jGRA8qBukJWrr1t+EUArACU1VFFPE43UUU07u40uOp8/aKWZFop9HUViwHNdaKoEx7aRRwqyQEYaWhhMDRK7L8IP726ruw8Y');
Guard9 := DTMFromString('m1gAAAHic42JgYMhjZGDIBOJsIC4E4hIorgDiYkaIPEjOAohtgNgBim2hYqZArA/ExlC2vakyg5GBPoOJsRFDgIsKg5O9PUODowaDn5MOQ56FEoOLpRqDn7cXAz/QbmIwI5EYAQDu9w5/');

If FindDTM(Guard1, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Guard found KILL IT!');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
repeat
Wait(50 + random(50));
case Random(2) of
0:
begin
Mouse(x,y,0,0,false);
ChooseOption('ttac');
end;
1:
Begin
Mouse(x,y,0,0,true);
end;
end;
until (not InFight) or (not OthersInFight) or (not LoggedIn)
end else If FindDTM(Guard2, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Guard found KILL IT!');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
repeat
Wait(50 + random(50));
case Random(2) of
0:
begin
Mouse(x,y,0,0,false);
ChooseOption('ttac');
end;
1:
Begin
Mouse(x,y,0,0,true);
end;
end;
until (not InFight) or (not OthersInFight) or (not LoggedIn)
end else If FindDTM(Guard3, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Guard found KILL IT!');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
repeat
Wait(50 + random(50));
case Random(2) of
0:
begin
Mouse(x,y,0,0,false);
ChooseOption('ttac');
end;
1:
Begin
Mouse(x,y,0,0,true);
end;
end;
until (not InFight) or (not OthersInFight) or (not LoggedIn)
end else If FindDTM(Guard4, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Guard found KILL IT!');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
repeat
Wait(50 + random(50));
case Random(2) of
0:
begin
Mouse(x,y,0,0,false);
ChooseOption('ttac');
end;
1:
Begin
Mouse(x,y,0,0,true);
end;
end;
until (not InFight) or (not OthersInFight) or (not LoggedIn)
end else If FindDTM(Guard5, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Guard found KILL IT!');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
repeat
Wait(50 + random(50));
case Random(2) of
0:
begin
Mouse(x,y,0,0,false);
ChooseOption('ttac');
end;
1:
Begin
Mouse(x,y,0,0,true);
end;
end;
until (not InFight) or (not OthersInFight) or (not LoggedIn)
end else If FindDTM(Guard6, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Guard found KILL IT!');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
repeat
Wait(50 + random(50));
case Random(2) of
0:
begin
Mouse(x,y,0,0,false);
ChooseOption('ttac');
end;
1:
Begin
Mouse(x,y,0,0,true);
end;
end;
until (not InFight) or (not OthersInFight) or (not LoggedIn)
end else If FindDTM(Guard7, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Guard found KILL IT!');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
repeat
Wait(50 + random(50));
case Random(2) of
0:
begin
Mouse(x,y,0,0,false);
ChooseOption('ttac');
end;
1:
Begin
Mouse(x,y,0,0,true);
end;
end;
until (not InFight) or (not OthersInFight) or (not LoggedIn)
end else If FindDTM(Guard8, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Guard found KILL IT!');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
repeat
Wait(50 + random(50));
case Random(2) of
0:
begin
Mouse(x,y,0,0,false);
ChooseOption('ttac');
end;
1:
Begin
Mouse(x,y,0,0,true);
end;
end;
until (not InFight) or (not OthersInFight) or (not LoggedIn)
end else If FindDTM(Guard9, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Guard found KILL IT!');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
repeat
Wait(50 + random(50));
case Random(2) of
0:
begin
Mouse(x,y,0,0,false);
ChooseOption('ttac');
end;
1:
Begin
Mouse(x,y,0,0,true);
end;
end;
until (not InFight) or (not OthersInFight) or (not LoggedIn)
end;
FreeDTM(Guard1);
FreeDTM(Guard2);
FreeDTM(Guard3);
FreeDTM(Guard4);
FreeDTM(Guard5);
FreeDTM(Guard6);
FreeDTM(Guard7);
FreeDTM(Guard8);
FreeDTM(Guard9);
end;

So as you can see this a really long code. Now what i want to do is replace this piece of code:

    
Writeln('Guard found KILL IT!');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
repeat
Wait(50 + random(50));
case Random(2) of
0:
begin
Mouse(x,y,0,0,false);
ChooseOption('ttac');
end;
1:
Begin
Mouse(x,y,0,0,true);
end;
end;
until (not InFight) or (not OthersInFight) or (not LoggedIn)

Now i know i have to do something with functions, but i haven't been scripting for a while and i don't know how to shorten this. I would really appreciate the help!

Greetz

Main

2012-02-16 17:42:54

If this is for runescape, you can just use color finding instead of DTM :)

Skim through
This thread
http://villavu.com/forum/showthread.php?t=21786
and this thread (Read from TPAtoATPAEx, you will be confused at first, and then it will come to life to you how easy this is)
http://villavu.com/forum/showthread.php?t=49067

footballjds

2012-02-16 17:44:13

multiple similar variables should be put into an array (:
Would you like me to just edit it or do you wanna? DTM's i suggest making into an array so you can do "for i:= 0 to high(DTMs) do freeDTM(DTMs);" (no quotes)
quite a few other ways to shorten everything. But that's up to you.

I wouldn't use DTM's at all but rather TPA's and ATPA's and splitting n splicing (:

JuKKa

2012-02-16 17:47:21


Guard[0] := DTMFROMSTRING('asdasdasdad')
Guard[1] := DTMFROMSTRING('asdasdasdad')
Guard[2] := DTMFROMSTRING('asdasdasdad')
Guard[3] := DTMFROMSTRING('asdasdasdad')
Guard[4] := DTMFROMSTRING('asdasdasdad')
Guard[5] := DTMFROMSTRING('asdasdasdad')
Guard[6] := DTMFROMSTRING('asdasdasdad')

for i:= 0 to 6 do
begin
if finddtm( Guard[i]{important part i increases + 1 every time}, blablabla)then
begin
//here just fight enemy remember to "BREAK;" when you have found enemy and clicked
end;
//last do this
for i:= 0 to 6 do
FreeDTM(Guard[1]);

Guard is a "array of Integer" or "array [0..6] of Integer;"

Guard[0]

you can loop throught them and store valuable information ;)

okokokok

2012-02-16 17:51:20

From: footballjds
multiple similar variables should be put into an array (:
Would you like me to just edit it or do you wanna? DTM's i suggest making into an array so you can do "for i:= 0 to high(DTMs) do freeDTM(DTMs);" (no quotes)
quite a few other ways to shorten everything. But that's up to you.

I wouldn't use DTM's at all but rather TPA's and ATPA's and splitting n splicing (:


Thanks for the fast respons! :)

From: JuKKa

Guard[0] := DTMFROMSTRING('asdasdasdad')
Guard[1] := DTMFROMSTRING('asdasdasdad')
Guard[2] := DTMFROMSTRING('asdasdasdad')
Guard[3] := DTMFROMSTRING('asdasdasdad')
Guard[4] := DTMFROMSTRING('asdasdasdad')
Guard[5] := DTMFROMSTRING('asdasdasdad')
Guard[6] := DTMFROMSTRING('asdasdasdad')

for i:= 0 to 6 do
begin
if finddtm( Guard[i]{important part i increases + 1 every time}, blablabla)then
begin
//here just fight enemy remember to "BREAK;" when you have found enemy and clicked
end;
//last do this
for i:= 0 to 6 do
FreeDTM(Guard[1]);

Guard is a "array of Integer" or "array [0..6] of Integer;"

Guard[0]

you can loop throught them and store valuable information ;)


Thanks for the fast response and help! You helped me out a lot here :)

footballjds

2012-02-16 18:09:39

I'm not sure your logic for your loops is right but… I didn't want to change it so I simply edited what you had to this:

function FindGuard(var x, y: integer): boolean;
var
GuardDTM: TStringArray;
GuardDTMS: TIntegerArray;
i, xs, xy: integer;
begin
GuardDTM := ['mlwAAAHicY2dgYHgPxF+B+A0UvwPiT0D8AYhnA/ECIJ4PxDOAeDKSmL6qFIO9sQyDp5sbw4S8QIY6XXWGyLBQBid7ewZ+oDwuzIgHQwEADDEQ+g==',
'mrAAAAHic42BgYPgKxH+B+BeU/RGI3wPxFyD+DsSOUOwKxO5A7ALE9kBsDcS2QFxWWMjgbinPEB0RzuBkb8/g6ebGEOSkyhDgoMtgpafAwA9Ugw8zEsAwAAAPcRDS',
'mrAAAAHic42BgYMhmZGBIAeIMIM4B4mQoOx+Ii4CYC4iFgFgYiAWBmAeI2YCYFYg5gThPXYnB3NSUIchJFYxtbJQY7I2VGaq01RjcLTUY+IF24MOMBDAMAAA6aQm0',
'mwQAAAHic42RgYLBnZGAwA2JrIHYAYjcoGyTuAsROQLwLqG4PEO+H4n1AvB2INwPxVgaIvLudBkOAhwpDXnYmg7uLC4O3ixKDlbECg7eTFkNGvBtDhqkCAz9QHSHMSASGAwAEJBCd',
'mrAAAAHic42BgYLBnZGCwAGIbIHYEYhcgtgZiWyB2AuIZQDVzgXgeEM8B4plAPBWIJ0JpJyNZBk8LcYbQwECGgpxshsiwUAZPcwWGTlkRhkhnDQZ+oBp8mJEAhgEA3WkNzw==',
'mlwAAAHicY2dgYGBkBBEMDKxQzALE/4FC/4A4FIi9gNgHiAOBOByII4A4CIijI8IZwp3UGYLsVBn8rJUZcjIyGKLdZBg8zRUY+IHyuDAjHgwFANJSCoo=',
'm6wAAAHic42ZgYDgExCeB+BQQHwbiPUC8G4j3QTFI/igUVwJxORDXAnEdFFcAcTEQ5wFxDhDnA3EZEAf4+jIEeaky6GuJMpgYGzHoqAsz+LkpM5joyTK422kw1DmoMwS46zKs6k9g4AeqJxYzkoCRAABMPBZj',
'mwQAAAHicjcqxCkAAAIThM5qMlA0pUooNJaOUvAEDipS8jGRA8qBukJWrr1t+EUArACU1VFFPE43UUU07u40uOp8/aKWZFop9HUViwHNdaKoEx7aRRwqyQEYaWhhMDRK7L8IP726ruw8Y',
'm1gAAAHic42JgYMhjZGDIBOJsIC4E4hIorgDiYkaIPEjOAohtgNgBim2hYqZArA/ExlC2vakyg5GBPoOJsRFDgIsKg5O9PUODowaDn5MOQ56FEoOLpRqDn7cXAz/QbmIwI5EYAQDu9w5/'];
for i := 0 to high(GuardDTM) do GuardDTMS[i] := DTMFromString(GuardDTM[i]);

for i := 0 to high(GuardDTMS) do
begin
if FindDTM(GuardDTMS[i], x, y, MSX1, MSY1, MSX2, MSY2) then break;
end;
result := (x <> 0) and (y <> 0);
for i := 0 to high(GuardDTMS) do FreeDTM(GuardDTMS[i]);
end;

procedure FightGuards;
var
x, y: integer;
begin
Writeln('Looking for a Guard');
if FindGuard(x, y) then
begin
Writeln('Guard found KILL IT!');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
repeat
Wait(50 + random(50));
case Random(2) of
0: begin Mouse(x,y,0,0,false); WaitOption('ttac', 300); end;
1: Mouse(x,y,0,0,true);
end;
until (not InFight) or (not OthersInFight) or (not LoggedIn);
end else
begin
Writeln('No Guards :(');
end;
end;

Should work and is 75% shorter :)
IMO i think it's better then Jukka's ;)

okokokok

2012-02-16 18:28:15

From: footballjds
I'm not sure your logic for your loops is right but… I didn't want to change it so I simply edited what you had to this:

function FindGuard(var x, y: integer): boolean;
var
GuardDTM: TStringArray;
GuardDTMS: TIntegerArray;
i, xs, xy: integer;
begin
GuardDTM := ['mlwAAAHicY2dgYHgPxF+B+A0UvwPiT0D8AYhnA/ECIJ4PxDOAeDKSmL6qFIO9sQyDp5sbw4S8QIY6XXWGyLBQBid7ewZ+oDwuzIgHQwEADDEQ+g==',
'mrAAAAHic42BgYPgKxH+B+BeU/RGI3wPxFyD+DsSOUOwKxO5A7ALE9kBsDcS2QFxWWMjgbinPEB0RzuBkb8/g6ebGEOSkyhDgoMtgpafAwA9Ugw8zEsAwAAAPcRDS',
'mrAAAAHic42BgYMhmZGBIAeIMIM4B4mQoOx+Ii4CYC4iFgFgYiAWBmAeI2YCYFYg5gThPXYnB3NSUIchJFYxtbJQY7I2VGaq01RjcLTUY+IF24MOMBDAMAAA6aQm0',
'mwQAAAHic42RgYLBnZGAwA2JrIHYAYjcoGyTuAsROQLwLqG4PEO+H4n1AvB2INwPxVgaIvLudBkOAhwpDXnYmg7uLC4O3ixKDlbECg7eTFkNGvBtDhqkCAz9QHSHMSASGAwAEJBCd',
'mrAAAAHic42BgYLBnZGCwAGIbIHYEYhcgtgZiWyB2AuIZQDVzgXgeEM8B4plAPBWIJ0JpJyNZBk8LcYbQwECGgpxshsiwUAZPcwWGTlkRhkhnDQZ+oBp8mJEAhgEA3WkNzw==',
'mlwAAAHicY2dgYGBkBBEMDKxQzALE/4FC/4A4FIi9gNgHiAOBOByII4A4CIijI8IZwp3UGYLsVBn8rJUZcjIyGKLdZBg8zRUY+IHyuDAjHgwFANJSCoo=',
'm6wAAAHic42ZgYDgExCeB+BQQHwbiPUC8G4j3QTFI/igUVwJxORDXAnEdFFcAcTEQ5wFxDhDnA3EZEAf4+jIEeaky6GuJMpgYGzHoqAsz+LkpM5joyTK422kw1DmoMwS46zKs6k9g4AeqJxYzkoCRAABMPBZj',
'mwQAAAHicjcqxCkAAAIThM5qMlA0pUooNJaOUvAEDipS8jGRA8qBukJWrr1t+EUArACU1VFFPE43UUU07u40uOp8/aKWZFop9HUViwHNdaKoEx7aRRwqyQEYaWhhMDRK7L8IP726ruw8Y',
'm1gAAAHic42JgYMhjZGDIBOJsIC4E4hIorgDiYkaIPEjOAohtgNgBim2hYqZArA/ExlC2vakyg5GBPoOJsRFDgIsKg5O9PUODowaDn5MOQ56FEoOLpRqDn7cXAz/QbmIwI5EYAQDu9w5/'];
for i := 0 to high(GuardDTM) do GuardDTMS[i] := DTMFromString(GuardDTM[i]);

for i := 0 to high(GuardDTMS) do
begin
if FindDTM(GuardDTMS[i], x, y, MSX1, MSY1, MSX2, MSY2) then break;
end;
result := (x <> 0) and (y <> 0);
for i := 0 to high(GuardDTMS) do FreeDTM(GuardDTMS[i]);
end;

procedure FightGuards;
var
x, y: integer;
begin
Writeln('Looking for a Guard');
if FindGuard(x, y) then
begin
Writeln('Guard found KILL IT!');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
repeat
Wait(50 + random(50));
case Random(2) of
0: begin Mouse(x,y,0,0,false); WaitOption('ttac', 300); end;
1: Mouse(x,y,0,0,true);
end;
until (not InFight) or (not OthersInFight) or (not LoggedIn);
end else
begin
Writeln('No Guards :(');
end;
end;

Should work and is 75% shorter :)
IMO i think it's better then Jukka's ;)


Hmmm seems interesting too :D Well as i sais before i'm not a really experienced scripter right now and also didn't script for like a month, because i couldn't really find any motivation :redface: Also i made this structure in 10 minutes so ofcourse it could use some improvement :D The code that is use at the moment is:


procedure FightGuards;
var x, y, i: Integer;
TPA: TPointArray;
Guard: Array [0..8] of Integer;
begin
Writeln('Looking for a Guard');
Guard[0] := DTMFromString('mlwAAAHicY2dgYHgPxF+B+A0UvwPiT0D8AYhnA/ECIJ4PxDOAeDKSmL6qFIO9sQyDp5sbw4S8QIY6XXWGyLBQBid7ewZ+oDwuzIgHQwEADDEQ+g==');
Guard[1] := DTMFromString('mrAAAAHic42BgYPgKxH+B+BeU/RGI3wPxFyD+DsSOUOwKxO5A7ALE9kBsDcS2QFxWWMjgbinPEB0RzuBkb8/g6ebGEOSkyhDgoMtgpafAwA9Ugw8zEsAwAAAPcRDS');
Guard[2] := DTMFromString('mrAAAAHic42BgYMhmZGBIAeIMIM4B4mQoOx+Ii4CYC4iFgFgYiAWBmAeI2YCYFYg5gThPXYnB3NSUIchJFYxtbJQY7I2VGaq01RjcLTUY+IF24MOMBDAMAAA6aQm0');
Guard[3] := DTMFromString('mwQAAAHic42RgYLBnZGAwA2JrIHYAYjcoGyTuAsROQLwLqG4PEO+H4n1AvB2INwPxVgaIvLudBkOAhwpDXnYmg7uLC4O3ixKDlbECg7eTFkNGvBtDhqkCAz9QHSHMSASGAwAEJBCd');
Guard[4] := DTMFromString('mrAAAAHic42BgYLBnZGCwAGIbIHYEYhcgtgZiWyB2AuIZQDVzgXgeEM8B4plAPBWIJ0JpJyNZBk8LcYbQwECGgpxshsiwUAZPcwWGTlkRhkhnDQZ+oBp8mJEAhgEA3WkNzw==');
Guard[5] := DTMFromString('mlwAAAHicY2dgYGBkBBEMDKxQzALE/4FC/4A4FIi9gNgHiAOBOByII4A4CIijI8IZwp3UGYLsVBn8rJUZcjIyGKLdZBg8zRUY+IHyuDAjHgwFANJSCoo=');
Guard[6] := DTMFromString('m6wAAAHic42ZgYDgExCeB+BQQHwbiPUC8G4j3QTFI/igUVwJxORDXAnEdFFcAcTEQ5wFxDhDnA3EZEAf4+jIEeaky6GuJMpgYGzHoqAsz+LkpM5joyTK422kw1DmoMwS46zKs6k9g4AeqJxYzkoCRAABMPBZj');
Guard[7] := DTMFromString('mwQAAAHicjcqxCkAAAIThM5qMlA0pUooNJaOUvAEDipS8jGRA8qBukJWrr1t+EUArACU1VFFPE43UUU07u40uOp8/aKWZFop9HUViwHNdaKoEx7aRRwqyQEYaWhhMDRK7L8IP726ruw8Y');
Guard[8] := DTMFromString('m1gAAAHic42JgYMhjZGDIBOJsIC4E4hIorgDiYkaIPEjOAohtgNgBim2hYqZArA/ExlC2vakyg5GBPoOJsRFDgIsKg5O9PUODowaDn5MOQ56FEoOLpRqDn7cXAz/QbmIwI5EYAQDu9w5/');

for i:= 0 to 6 do
If FindDTM(Guard[i], x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Writeln('Guard found KILL IT!');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
repeat
Wait(50 + random(50));
case Random(2) of
0:
begin
Mouse(x,y,0,0,false);
ChooseOption('ttac');
Writeln('Derpin it like a baws');
Wait(5000 + Random(1000));
end;
1:
Begin
Mouse(x,y,0,0,true);
Writeln('Derpin it like a baws');
Wait(5000 + Random(1000));
end;
end;
until (InFight) or (not OthersInFight) or (not LoggedIn)
end;
FreeDTM(Guard[0]);
FreeDTM(Guard[1]);
FreeDTM(Guard[2]);
FreeDTM(Guard[3]);
FreeDTM(Guard[4]);
FreeDTM(Guard[5]);
FreeDTM(Guard[6]);
FreeDTM(Guard[7]);
FreeDTM(Guard[8]);
end;

This works pretty good, but i will seriously consider your edited part :D
Thanks! :)

footballjds

2012-02-16 18:33:13

loop through freeing you dtms so its one line instead of 9!!!!

also, i'm glad you found the logic error and removed the not before InFight haha ;)

okokokok

2012-02-16 18:40:52

From: footballjds
loop through freeing you dtms so its one line instead of 9!!!!

also, i'm glad you found the logic error and removed the not before InFight haha ;)


Do you mean that i should use this?

  FreeDTM(Guard[i]); 

And yeah was a stupid mistake :P

footballjds

2012-02-16 18:41:39

From: okokokok
Do you mean that i should use this?

  FreeDTM(Guard[i]); 

And yeah was a stupid mistake :P


yes, you should do: "For i := 0 to High(Guard) do FreeDTM(Guard);"

okokokok

2012-02-16 18:46:49

From: footballjds
yes, you should do: "For i := 0 to High(Guard) do FreeDTM(Guard);"


Thank you very much :)

Nebula

2012-02-16 18:46:57

This script would NEVER work. There are lots of reasons why but The main reason is that a standard DTM can't be used to effectively find something like a guard. The guard would have to be in the EXACT same position as it was when you made the dtm, which is very unlikely.

footballjds

2012-02-16 18:52:38

From: Nebula
This script would NEVER work. There are lots of reasons why but The main reason is that a standard DTM can't be used to effectively find something like a guard. The guard would have to be in the EXACT same position as it was when you made the dtm, which is very unlikely.


this is incorrect if the dtm is properly made, let him live.

okokokok

2012-02-16 18:57:42

From: Nebula
This script would NEVER work. There are lots of reasons why but The main reason is that a standard DTM can't be used to effectively find something like a guard. The guard would have to be in the EXACT same position as it was when you made the dtm, which is very unlikely.


That is why i have 9 different DTM's of the guards. When i have finished my script into the beta stage, i'll make DTM of 16 sides of the guards. This way eventhough they keep walking all the time there will still be one side visible making it possible to detect them pretty fast.

footballjds

2012-02-17 10:40:15

From: okokokok
That is why i have 9 different DTM's of the guards. When i have finished my script into the beta stage, i'll make DTM of 16 sides of the guards. This way eventhough they keep walking all the time there will still be one side visible making it possible to detect them pretty fast.


I really suggest you learning what TPA's can do (: