SRL Archive - First Scripts

[OSR]Ardougne silk stealer


kristi

2014-01-20 17:44:28

Hi!

I made this script last night, took me a few hours of looking around at other scripts here at the forum and kind of just redoing them a bit.

This is my code thus far:
program SilkStealer;
{$DEFINE SMART8}
{$DEFINE SMART}
{$I SRL-OSR/SRL.Simba}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
procedure StealSilk;
var x : Integer;
y : Integer;
Tries : Integer;
begin
if not LoggedIn then
Exit;
if (not (FindObjCustom(x, y, ['eal', 'ilk'], [8229534], 35))) then
begin
Wait(8500+Random(800));
end else
if FindObjCustom(x, y, ['eal', 'ilk'], [8229534], 35) then
repeat
begin Mouse(x, y, 4, 4, False);
ChooseOption('eal')
end;
until (InvFull);
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
repeat
StealSilk;
until (False)
end.

So what it does is that it searches for the top color of the stand(beige), right click it, and press the "steal from" option. That's pretty much it. When the stand is empty, it right-clicks like crazy in search for the "steal from"-option, untill it finally finds it again.

So here's some of the problems that needs resolving
- Instead of right-clicking like crazy, it just waits a while when the "steal-from"-option has been chosen. I tried to do this at line 24-26, but it doesn't work and I have no idea why.
- Make it search for something more specific than just the top color of the stand.
- Make it run away if combat is detected(I was thinking about making it check if the health bar is visible, and if it is it would just run far away and come back after a while, though it currently seem too advanced for me)
- Drop all/bank option(I'll add a dropping option later, though I'll have to learn how to walk before)
- Make it left click instead of right click. The best thing would be to just let the cursor rest over the stand, and click only when the silk has respawned.

I'm still a newbie, I've only spent a few hours learning all this. I don't need anyone to resolve all the problems the script has, I just want someone to point me in the right direction, if it's possible :). Also, I'm sorry if I used something from your script without mentioning you, I just copied and pasted at random and changed it to work here.

NKN

2014-01-21 14:34:32

Not bad for a first script, just a few things.

 if FindObjCustom(x, y, ['eal', 'ilk'], [8229534], 35) then
repeat
begin Mouse(x, y, 4, 4, False);
ChooseOption('eal')
end;
until (InvFull);

You should add a failsafe, like if your character moves. He'll click forever without stopping.
There are a few other things like this that you should check out.

Flight

2014-01-21 21:42:34

Looking good buddy. I'd like to help you out with this, but first may I ask which silk stall this steals from? The north stall in Ardougne, correct?

kristi

2014-01-22 12:07:12

From: NKN
Not bad for a first script, just a few things.

 if FindObjCustom(x, y, ['eal', 'ilk'], [8229534], 35) then
repeat
begin Mouse(x, y, 4, 4, False);
ChooseOption('eal')
end;
until (InvFull);

You should add a failsafe, like if your character moves. He'll click forever without stopping.
There are a few other things like this that you should check out.


Yeah, that is one of those things I was thinking about adding later on. I can't really add antiban to a script that isn't working, haha.


From: Flight
Looking good buddy. I'd like to help you out with this, but first may I ask which silk stall this steals from? The north stall in Ardougne, correct?


Yeah, exactly,

kristi

2014-01-24 16:57:17

From: Flight
Looking good buddy. I'd like to help you out with this, but first may I ask which silk stall this steals from? The north stall in Ardougne, correct?


Btw Flight, I couldn't answer your PM. Could you PM any contact details(skype or whatever) so I can somehow answer you?

Flight

2014-01-24 19:59:52

From: kristi
Btw Flight, I couldn't answer your PM. Could you PM any contact details(skype or whatever) so I can somehow answer you?


I guess just post here because aside from Villavu's PM system I don't use anything else. Did the example script I send help you at all?

kristi

2014-01-25 07:14:09

From: Flight
I guess just post here because aside from Villavu's PM system I don't use anything else. Did the example script I send help you at all?


It did help a ton! I managed to make it drop all the silks when the inventory is full, the only problem now is to make it escape from a fight. I added fight detection using DTMs by making it look after a health bar. I still have no idea how to make it run away, do you have any idea?

Flight

2014-01-25 07:34:51

From: kristi
It did help a ton! I managed to make it drop all the silks when the inventory is full, the only problem now is to make it escape from a fight. I added fight detection using DTMs by making it look after a health bar. I still have no idea how to make it run away, do you have any idea?


Very good, you're making progress then. If it were me I would make a DTM of a place (on the MM) to run and a DTM (again, on the MM) of the exact spot north of the silk stall. If combat is detected then search for the first DTM (where you will run) on your MM, if you find it then click it and if it's far enough away the combat threat will go away. Then running back to the stall you do the same thing as running away except look for the second DTM you made.

Of course you'll want to have a backup incase either of those DTMs are not found on the MM, otherwise you stand there and get hit while the script continually searches for a DTM. Maybe simply run in a random direction and log out for safety. Let me know if you'd like some help with that.

kristi

2014-01-25 12:54:03

From: Flight
Very good, you're making progress then. If it were me I would make a DTM of a place (on the MM) to run and a DTM (again, on the MM) of the exact spot north of the silk stall. If combat is detected then search for the first DTM (where you will run) on your MM, if you find it then click it and if it's far enough away the combat threat will go away. Then running back to the stall you do the same thing as running away except look for the second DTM you made.

Of course you'll want to have a backup incase either of those DTMs are not found on the MM, otherwise you stand there and get hit while the script continually searches for a DTM. Maybe simply run in a random direction and log out for safety. Let me know if you'd like some help with that.


That's exactly what I am trying to do! I read a guide about using SPS which was apparently much easier, but I couldn't get it to compile correctly so I though of using DTMs instead. I have like code everywhere and I still have to add anti ban to every single thing, so it get kinda complicated lol.

Flight

2014-01-25 22:15:37

From: kristi
That's exactly what I am trying to do! I read a guide about using SPS which was apparently much easier, but I couldn't get it to compile correctly so I though of using DTMs instead. I have like code everywhere and I still have to add anti ban to every single thing, so it get kinda complicated lol.


SPS can work on OSRS but chances are it will be very inaccurate due to the three occurrences that happen with the minimap: random rotation, random zooming in/out, and dramatic color shifting. All of these decrease the chance of SPS correctly reading the minimap enough to determine our position, and even if it does it's probably far off. In this script you'll need something accurate to the exactly tile (exactly north of the silk stall) so you'll definitely want to use DTMs. Since you're looking into those already you're on the right track!

By the way I got your PM from Coh3n; it was nice of him to pass it along to me but we shouldn't keep using him as a middle man, if you have questions just ask me here in this thread and I'll be happy to answer them. With enough posts you can PM me directly. Also if you ask questions here publicly other people besides myself could also give suggestions, win-win.

kristi

2014-01-26 11:10:07

From: Flight
SPS can work on OSRS but chances are it will be very inaccurate due to the three occurrences that happen with the minimap: random rotation, random zooming in/out, and dramatic color shifting. All of these decrease the chance of SPS correctly reading the minimap enough to determine our position, and even if it does it's probably far off. In this script you'll need something accurate to the exactly tile (exactly north of the silk stall) so you'll definitely want to use DTMs. Since you're looking into those already you're on the right track!

By the way I got your PM from Coh3n; it was nice of him to pass it along to me but we shouldn't keep using him as a middle man, if you have questions just ask me here in this thread and I'll be happy to answer them. With enough posts you can PM me directly. Also if you ask questions here publicly other people besides myself could also give suggestions, win-win.


Oh, nice of him for forwarding it! I forgot I'd sent it to him.

I'm kinda stuck with the script though. I tried to make it repeat the StealSilk procedure until it found a specific DTM(the healthbar), and then do another procedure that would run away. It didn't work out though, and when attacked the script does nothing :/.

Here's the code, do you have any suggestions?
program SilkStealer;
{$DEFINE SMART8}
{$DEFINE SMART}
{$I SRL-OSR/SRL.Simba}

var
StealTimer : Integer;
x, y, HealthBar, Point1: Integer;



Procedure declarePlayers();
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

procedure stealSilk();
var
b : TBox;
pnt : TPoint;
i : Integer;
tpa : TPointArray;
atpa: T2DPointArray;
begin
HealthBar := DTMFromString('mggAAAHicY2NgYOAHYmEgZgdiLgYIkAViJgYEYAFiZihm+I+J/0PVIQvDACMODAEAR1MJYA==');
repeat
if not loggedIn() then
Exit;
if (timeFromMark(StealTimer) < (7200+Random(800))) then
Exit;

colorToleranceSpeed(2);
setColorSpeed2Modifiers(0.04, 0.11);
findColorsTolerance(tpa, 4883056, 200, MSCY, 330, 270, 9);
setColorSpeed2Modifiers(0.02, 0.02);
colorToleranceSpeed(1);

if length(tpa) < 1 then
Exit;

atpa := clusterTPA(tpa, 5);
for i:=0 to high(atpa) do
begin
pnt := middleTPA(atpa[i]);
MMouse(pnt.x, pnt.y, 5, 5);
if waitUpTextMulti(['Steal','l fr','om Si','lk st'], 200) then
begin
clickMouse2(MOUSE_LEFT);
markTime(StealTimer);
if didRedClick() then
break;

end;
end;
until(InvFull or FindDTM(HealthBar, x, y, MSX1, MSY2, MSX2, MSY2));
end;
Procedure DropSilk();
begin
if InvFull then
DropAll;
end;
procedure Escape;
var
aFound: Extended;
begin
SRL_COMBATRANDOMS := False;
HealthBar := DTMFromString('mggAAAHicY2NgYOAHYmEgZgdiLgYIkAViJgYEYAFiZihm+I+J/0PVIQvDACMODAEAR1MJYA==');
Point1 := DTMFromString('mrAAAAHic42BgYJjPzMAwD4pnAPFUIJ4JxMuAeCkQ3wWquQbEjxkg7MdI/OtA3N1syNBSZwOmwbgLwm/thrAJAUYCGAYA0xcWAQ==');
if FindDTM(HealthBar, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
if FindDTMRotated(Point1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, Pi/30, aFound) then
begin
Mouse(x,y,0,0,true);
wait(20+random(30));
end;
end;
end;
Procedure antiban();
var
i: Integer;
begin
if not loggedIn() then
Exit;

i := Random(4500);
case i of
1,2 : hoverMovingObject();
3 : hoverSkill(skill_Thieving, False);
4..14: smallRandomMouse();
end;
end;
Procedure Freethemall;
begin
FreeDTM(HealthBar);
FreeDTM(Point1);
end;
begin
declarePlayers();
setUpSRL();
ActivateClient;
LoginPlayer;
setAngle(SRL_ANGLE_HIGH);
makeCompass(0);
Addonterminate('Freethemall');
repeat
findNormalRandoms();
stealSilk();
DropSilk;
antiban();
Freethemall;
Escape;
until(allPlayersInactive());
Logout;
end.

Flight

2014-01-26 19:29:15

Ok the biggest mistake I can see is your extra loop within the StealSilk() procedure; this isn't needed. You want this to be called once and exit so the other, more essential procedures, like randoms-checking, can be called constantly. I also removed combat-checking (which used your DTM-finding) and replaced it with a healthbar finder based just only color. Also, if your "point1" DTM isn't found on the MM it'll tell you. Try this out:


program SilkStealer;
{$DEFINE SMART8}
{$DEFINE SMART}
{$I SRL-OSR/SRL.Simba}

var
StealTimer : Integer;
Point1: Integer;

Procedure declarePlayers();
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

procedure setGlobals();
begin
Point1 := DTMFromString('mrAAAAHic42BgYJjPzMAwD4pnAPFUIJ4JxMuAeCkQ3wWquQbEjxkg7MdI/OtA3N1syNBSZwOmwbgLwm/thrAJAUYCGAYA0xcWAQ==');
end;

Procedure freeGlobals();
begin
FreeDTM(Point1);
end;

//By Shatterhand, modified by Flight
function getHPPercent(): Integer;
var
CombinedTPA, GreenTPA, RedTPA : TPointArray;
CombinedATPA, GreenATPA, FinalATPA : Array of TPointArray;
i,j,k, BoxWidth,BoxHeight : Integer;
ExcludeBoxes : Array of TBox;
TempBox,B : TBox;
BadTPA : Boolean;
begin
Result := -1;

B := intToBox(220, 145, 295, 190);

FindColorsTolerance(GreenTPA,65280,B.X1,B.Y1,B.X2,B.Y2,0);
FindColorsTolerance(RedTPA,255,B.X1,B.Y1,B.X2,B.Y2,0);

CombinedTPA := combineTPA(GreenTPA,RedTPA);

if (High(CombinedTPA) > 0) then
begin
CombinedATPA := clusterTPA(CombinedTPA, 1);
SetArrayLength(ExcludeBoxes,0);
j := -1;

for i:=0 to High(CombinedATPA) do
begin
TempBox := getTPABounds(CombinedATPA[i]);
BoxWidth := TempBox.x2-TempBox.x1;
BoxHeight := TempBox.y2-TempBox.y1;
if not (BoxWidth = 29) or not (BoxHeight = 4) then
begin
Inc(j);
SetArrayLength(ExcludeBoxes,j+1);
ExcludeBoxes[j] := TempBox;
end;
end;

GreenATPA := clusterTPA(GreenTPA, 1);
SetArrayLength(FinalATPA,0);
k := 0;

for i:=0 to High(GreenATPA) do
begin
BadTPA := False;
for j:=0 to High(ExcludeBoxes) do
if pointInBox(middleTPA(GreenATPA[i]),ExcludeBoxes[j]) then
BadTPA := True;
if not BadTPA then
begin
SetArrayLength(FinalATPA,k+1);
FinalATPA[k] := GreenATPA[i];
end;
end;

sortATPAFrom(FinalATPA,Point(MSCX,MSCY));

if (Length(FinalATPA) < 1) then Exit;

TempBox := getTPABounds(FinalATPA[0]);
BoxWidth := TempBox.x2-TempBox.x1;

Result := Round(BoxWidth*100/29);
end;
end;

procedure stealSilk();
var
b : TBox;
pnt : TPoint;
i : Integer;
tpa : TPointArray;
atpa: T2DPointArray;
begin
if not loggedIn() then
Exit;
if (timeFromMark(StealTimer) < (7200+Random(800))) then
Exit;

colorToleranceSpeed(2);
setColorSpeed2Modifiers(0.04, 0.11);
findColorsTolerance(tpa, 4883056, 200, MSCY, 330, 270, 9);
setColorSpeed2Modifiers(0.02, 0.02);
colorToleranceSpeed(1);

if length(tpa) < 1 then
Exit;

atpa := clusterTPA(tpa, 5);
for i:=0 to high(atpa) do
begin
pnt := middleTPA(atpa[i]);
MMouse(pnt.x, pnt.y, 5, 5);
if waitUpTextMulti(['Steal','l fr','om Si','lk st'], 200) then
begin
clickMouse2(MOUSE_LEFT);
markTime(StealTimer);
if didRedClick() then
break;
end;
end;
end;

procedure Escape;
var
x,y : Integer;
aFound: Extended;
begin
if getHPPercent() > 10 then // Healthbar found
begin
if findDTMRotated(Point1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, Pi/30, aFound) then
begin
Mouse(x,y,0,0,true);
wait(20+random(30));
end else
Writeln('Failed to find DTM Point1');
end;
end;

Procedure antiban();
var
i: Integer;
begin
if not loggedIn() then
Exit;

i := Random(4500);
case i of
1,2 : hoverMovingObject();
3 : hoverSkill(skill_Thieving, False);
4..14: smallRandomMouse();
end;
end;

begin
declarePlayers();
setUpSRL();
ActivateClient;

setGlobals(); // Load them only 1 time
Addonterminate('freeGlobals');

SRL_COMBATRANDOMS := False; // Only needs to be called once
LoginPlayer;
setAngle(SRL_ANGLE_HIGH);
makeCompass(0);

repeat
findNormalRandoms();
antiban();
Escape;
if invFull then
DropAll;
stealSilk(); // Let's put this at the bottom so the important ones are called first
until(allPlayersInactive());
Logout;
end.

kristi

2014-01-27 16:48:48

From: Flight
Ok the biggest mistake I can see is your extra loop within the StealSilk() procedure; this isn't needed. You want this to be called once and exit so the other, more essential procedures, like randoms-checking, can be called constantly. I also removed combat-checking (which used your DTM-finding) and replaced it with a healthbar finder based just only color. Also, if your "point1" DTM isn't found on the MM it'll tell you. Try this out:


program SilkStealer;
{$DEFINE SMART8}
{$DEFINE SMART}
{$I SRL-OSR/SRL.Simba}

var
StealTimer : Integer;
Point1: Integer;

Procedure declarePlayers();
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

procedure setGlobals();
begin
Point1 := DTMFromString('mrAAAAHic42BgYJjPzMAwD4pnAPFUIJ4JxMuAeCkQ3wWquQbEjxkg7MdI/OtA3N1syNBSZwOmwbgLwm/thrAJAUYCGAYA0xcWAQ==');
end;

Procedure freeGlobals();
begin
FreeDTM(Point1);
end;

//By Shatterhand, modified by Flight
function getHPPercent(): Integer;
var
CombinedTPA, GreenTPA, RedTPA : TPointArray;
CombinedATPA, GreenATPA, FinalATPA : Array of TPointArray;
i,j,k, BoxWidth,BoxHeight : Integer;
ExcludeBoxes : Array of TBox;
TempBox,B : TBox;
BadTPA : Boolean;
begin
Result := -1;

B := intToBox(220, 145, 295, 190);

FindColorsTolerance(GreenTPA,65280,B.X1,B.Y1,B.X2,B.Y2,0);
FindColorsTolerance(RedTPA,255,B.X1,B.Y1,B.X2,B.Y2,0);

CombinedTPA := combineTPA(GreenTPA,RedTPA);

if (High(CombinedTPA) > 0) then
begin
CombinedATPA := clusterTPA(CombinedTPA, 1);
SetArrayLength(ExcludeBoxes,0);
j := -1;

for i:=0 to High(CombinedATPA) do
begin
TempBox := getTPABounds(CombinedATPA[i]);
BoxWidth := TempBox.x2-TempBox.x1;
BoxHeight := TempBox.y2-TempBox.y1;
if not (BoxWidth = 29) or not (BoxHeight = 4) then
begin
Inc(j);
SetArrayLength(ExcludeBoxes,j+1);
ExcludeBoxes[j] := TempBox;
end;
end;

GreenATPA := clusterTPA(GreenTPA, 1);
SetArrayLength(FinalATPA,0);
k := 0;

for i:=0 to High(GreenATPA) do
begin
BadTPA := False;
for j:=0 to High(ExcludeBoxes) do
if pointInBox(middleTPA(GreenATPA[i]),ExcludeBoxes[j]) then
BadTPA := True;
if not BadTPA then
begin
SetArrayLength(FinalATPA,k+1);
FinalATPA[k] := GreenATPA[i];
end;
end;

sortATPAFrom(FinalATPA,Point(MSCX,MSCY));

if (Length(FinalATPA) < 1) then Exit;

TempBox := getTPABounds(FinalATPA[0]);
BoxWidth := TempBox.x2-TempBox.x1;

Result := Round(BoxWidth*100/29);
end;
end;

procedure stealSilk();
var
b : TBox;
pnt : TPoint;
i : Integer;
tpa : TPointArray;
atpa: T2DPointArray;
begin
if not loggedIn() then
Exit;
if (timeFromMark(StealTimer) < (7200+Random(800))) then
Exit;

colorToleranceSpeed(2);
setColorSpeed2Modifiers(0.04, 0.11);
findColorsTolerance(tpa, 4883056, 200, MSCY, 330, 270, 9);
setColorSpeed2Modifiers(0.02, 0.02);
colorToleranceSpeed(1);

if length(tpa) < 1 then
Exit;

atpa := clusterTPA(tpa, 5);
for i:=0 to high(atpa) do
begin
pnt := middleTPA(atpa[i]);
MMouse(pnt.x, pnt.y, 5, 5);
if waitUpTextMulti(['Steal','l fr','om Si','lk st'], 200) then
begin
clickMouse2(MOUSE_LEFT);
markTime(StealTimer);
if didRedClick() then
break;
end;
end;
end;

procedure Escape;
var
x,y : Integer;
aFound: Extended;
begin
if getHPPercent() > 10 then // Healthbar found
begin
if findDTMRotated(Point1, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, Pi/30, aFound) then
begin
Mouse(x,y,0,0,true);
wait(20+random(30));
end else
Writeln('Failed to find DTM Point1');
end;
end;

Procedure antiban();
var
i: Integer;
begin
if not loggedIn() then
Exit;

i := Random(4500);
case i of
1,2 : hoverMovingObject();
3 : hoverSkill(skill_Thieving, False);
4..14: smallRandomMouse();
end;
end;

begin
declarePlayers();
setUpSRL();
ActivateClient;

setGlobals(); // Load them only 1 time
Addonterminate('freeGlobals');

SRL_COMBATRANDOMS := False; // Only needs to be called once
LoginPlayer;
setAngle(SRL_ANGLE_HIGH);
makeCompass(0);

repeat
findNormalRandoms();
antiban();
Escape;
if invFull then
DropAll;
stealSilk(); // Let's put this at the bottom so the important ones are called first
until(allPlayersInactive());
Logout;
end.


I'll look through the code later on when I got more time :). One thing that hit me though was if it would be possible to just enable the SRL_Combatrandom whenever the DTM can't be found, letting the client run away from the fight, and then just exit the script. What do you think?

kristi

2014-01-30 18:04:34

@flight, I'm clueless now. I've tried everything with DTMs, even though it finds them at first, whenever I log out and in again it can't I've done everything possible, followed several DTM tutorials, but it still doesn't work. This is the area I'm trying to make it click, right east of the stall(sorry for the low-res image, it's late and I didn't bother, you get the idea):
[ATTACH=CONFIG]22830[/ATTACH]

Could you point me in the right direction?

Flight

2014-01-30 22:39:15

I sure can. Here's a DTM I made of your run away spot:

DTMFromString('mwQAAAHic42RgYNjCBMFbgXgbEO8E4l1QvASIVwNxElBdFBBnAnEOlA6FirlCcVWbAcP3d5/AOFCJAc4G4W8MEL4ckCaEGYGYiQCGAwD5HR5g');

I'll give you AL's DTM-finder (reverted back to PS) which you can use for finding the best single point where that DTM exists.


function DTM_findBestPointEx(DTMs: TIntegerArray; Area: TBox; var Pnt: TPoint): Boolean;
var
i : Integer;
pnts : TPointArray;
atpa : T2DPointArray;
angs : T2Dextendedarray;
begin
Result := False;
if length(DTMs) < 1 then
Exit;

for i:=0 to high(DTMs) do
begin
if not findDTMs(DTMs[i], pnts, Area.x1, Area.y1, Area.x2, Area.y2) then
findDTMsRotatedAlternating(DTMs[i], pnts, Area.x1, Area.y1, Area.x2, Area.y2, -Pi, Pi, Pi/30, angs);
if length(pnts) > 0 then
begin
Result := True;
atpa := clusterTPA(pnts, 5);
sortATPASize(atpa, True);
Pnt := middleTPA(atpa[0]);
Exit;
end;
end;
end;

Now just do something like…

procedure getMeOuttaHere();
var
pnt : TPoint;
begin
if not DTM_findBestPointEx([DTM_RUN_AWAY], intToBox(MMX1,MMY1,MMX2,MMY2), pnt) then
begin
Writeln('DTM still not found!');
Exit;
end;

MMouse(pnt.X, pnt.Y, 3, 3);
ClickMouse2(MOUSE_LEFT);
waitFunc(@FlagPresent, 10, 500);
FFlag(0);
end;

Replace "DTM_RUN_AWAY" with the DTM I supplied above. Run just that procedure (while standing at the silk stall) and let me know how it works for ya. I hope there's no errors, I can't compile this because I'm using Lape so what I wrote above I wrote blindly.