SRL Archive - OSR Help

RSPS FullInv+Drop Procedure Help


Dynam0

2013-01-21 11:16:11

Hey guys, I'm struggling to create a procedure which will stop woodcutting when my inventory is full, then drop all the logs and continue to Woodcut again.

At the minute I've created a script which clicks the willow tree, waits 15 seconds and clicks the same, or another tree. (I did this so if the tree has been cut down, it'll click another when 15 seconds has passed, but it will click the same tree again if it hasn't been cut down. If anyone knows a better system to see if a tree has been cut, please share).

You can also see from the script that I attempted to create a procedure that when a log is placed in the last slot of my inventory, it will move the mouse to it. Unfortunately this isn't working. I tried with both DTM and a Bitmap of the Willow Log, but it doesn't work.

So if anyone has any suggestions of how I can create a procedure to stop when my Inventory is full, and then drop the logs, it would be appreciated.

Note - This script is for a private server.





program AutoColor;
{$i SRL\SRL.simba}

var
x, y, ChopDown, WillowLog, WillowBit:Integer;



function TreeColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.09, 0.15);

if not (FindColorsTolerance(arP, 4023404, MSX1, MSY1, MSX2, MSY2, 6)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;


procedure WillowColor;
begin
WriteLn('Test.');
If FindColorTolerance(x, y, TreeColor, MSX1, MSY1, MSX2, MSY2, 5) then
begin
Case random (2) Of
0: begin
MMouse(x, y, 3, 3);
ClickMouse(x, y, 1);
Wait(15000+random(2000));
end;
1: begin
Mouse(x, y, 3, 3, false);
If FindBitmapToleranceIn(ChopDown, x, y, MSX1, MSY1, MSX2, MSY2, 5) then
begin
Wait(500+random(200));
Mouse(x, y, 3, 4, true)
end;
end;
end;
end;
end;


Procedure LastWillow;
begin
WriteLn('Test2');
If FindBitmapToleranceIn(WillowBit, x, y, 696, 434, 729, 460, 15) then
//If FindDTM(WillowLog, x, y, 695, 433, 736, 460) then
begin
Mouse(x, y, 5, 5, False);
WriteLn('Cut the last Willow.');
end;
end;



begin
ChopDown := BitmapFromString(115, 6, 'meJzNk1EKwCAIhr1dF9hr9z/GBg' +
'oif2pGBRMf1G3+9tna09vTXzYiapyqR/VTfrs/SxArkFuROKrvD5a' +
'DVYseVepJZ9V1v03SZLwRozIEaEQOTHhHUrsFWMqYFsHyYHgiGalS' +
'j+Ss7rTnmEbjJWBtULyxGtvtRPCBYQ7WHhYgFOMjPYVbvgtPbg52M' +
'3Z/hCLYzXi/J9iK3F2w4NF5bfA3sHotl+RcAmKnwOqyLNgPQNL5Cg==');
WillowLog := DTMFromString('mAAEAAHic42FgYPBiYmAIAuJwKA3CIDFHILYFYksgtgJiZyD2BuJnQD1vgPg5ED8E4ltAfBuI7wDxAyB+CpX/CMTvgNjTSQpIMpKASQOkmIxuOgA6PQ78');
WillowBit := BitmapFromString(14, 8, 'meJyT9w2TR0aB0fJoImAk4xkEkoI' +
'jbGqwqMStDIjE7VyR1YiYWItbOoKQnSsESTl5gpCrHxBBpXArANoL' +
'QVBBZARWgKwG5EiwUwkiiNvs0grgTsWjDIgAMq9QJw==');

SetupSRL;
ClearDebug;


repeat
WillowColor;
LastWillow;
until(false);
FreeBitmap(ChopDown);
FreeDTM(WillowLog);
FreeBitmap(WillowBit);
end.

DannyRS

2013-01-21 11:22:16

Have it search your bottom right inventory spot for log colors, then if it is found, find all colors of logs within the main inv and rightclick move mouse down to drop option and click, until (not find log color in inventory),

Thats the cheapest fatest way to do it :p

Obviously you could make your own InvFull function for the rsps, and use DTM's for the logs and stuff if you know how, but thats completely upto you to decide

Dynam0

2013-01-21 11:45:42

From: DannyRS
Have it search your bottom right inventory spot for log colors, then if it is found, find all colors of logs within the main inv and rightclick move mouse down to drop option and click, until (not find log color in inventory),

Thats the cheapest fatest way to do it :p

Obviously you could make your own InvFull function for the rsps, and use DTM's for the logs and stuff if you know how, but thats completely upto you to decide



I tried to find the last log with a DTM and a Bitmap, but they both went weird.

I just created a procedure, to find the log color in the last slot, however it doesn't move the mouse to the color.

program new;
{$i SRL/SRL.Simba}
var
x,y:integer;


procedure LastInventoryItem;
begin
If FindColorTolerance(x, y, 1985621, 699, 438, 724, 454, 10) then
MoveMouse(x, y);
end;



begin
SetupSRL;
LastInventoryItem;
end.

DannyRS

2013-01-21 11:55:34

The color must be bad? Is it defo detecting the color? Add a Writeln('Saw The Color'); inside the If statement

Ian

2013-01-21 11:59:41

Use the DTM editor to check if your colors are good, type in your color and tolerance, then click "show matching colors"

Dynam0

2013-01-21 12:18:23

The colors are good, just checked in the DTM Editor. I added the WriteLn's in, like you suggested. It runs the procedure, but then stops on the 'If Find' statements.

program new;
{$i SRL/SRL.Simba}
var
x,y, WillowLog, DTMWillow:integer;


procedure Last;
begin
WriteLn('Checking for Color');
If FindColorTolerance(x, y, 2183257, 693, 435, 731, 461, 10) or
FindColorTolerance(x, y, 4286835, 693, 435, 731, 461, 10) or
FindColorTolerance(x, y, 1653828, 693, 435, 731, 461, 10) then
WriteLn('test');
Begin
MoveMouse(x, y);
end;
end;

procedure LastWillowBit;
begin
WriteLn('Checking Bitmap Willow Log');
If FindBitmapToleranceIn(WillowLog, x, y, 693, 435, 731, 461, 10) then
begin
WriteLn('We Found the willow');
end;
end;



procedure LastDTMWillow;
begin
WriteLn('Searching for DTM Willow');
If FindDTM(DtmWillow, x, y, 693, 435, 731, 461) then
begin
WriteLn('We have found the DTM Willow Image');
Mouse(x, y, 3, 3, False);
end;
end;



begin
WillowLog:= BitmapFromString(11, 7, 'meJyTdPRwySlzzCwGIvv0AsWQOAQ' +
'KiAQiGVcfIIKrQZYCIjFzW9uUHBmPQCCCyErauKAgRw+gsRAFBv6h' +
'VnFpEAOREVAjXAHQIqCBcj6hyAiiQM87EO4MqEvAbgAqgFiBrADqF' +
'5gCAEjOQWA=');
DtmWillow:= DTMFromString('mggAAAHicY2NgYJjHxMCwHIgXAvFUIJ4IxLOBmIuRgYEPiFmAmA2IeYFYAIh9XGUY4kIUGSIDFBlyUmwZijMdwWxcgBEHhgAAJ50JQw==');

SetupSRL;
LastDTMWillow;
//Last;
//LastWillowBit
FreeBitmap(WillowLog);
FreeDTM(DtmWillow);
end.


You can see I've just tried with DTM/Bitmap/Colors. I also changed the DTM's last Inventory Co-ordinates to MSX1, MSY1, MSX2, MSY2, and it still didn't run it.

Ian

2013-01-21 13:13:23

Maybe try using MMouse. I wouldn't make a difference, but maybe MoveMouse is having issues

DannyRS

2013-01-21 13:15:06

what does this output


Procedure Last;
Begin
WriteLn('Checking for Color');
If FindColorTolerance(x, y, 2183257, 693, 435, 731, 461, 10) Or
FindColorTolerance(x, y, 4286835, 693, 435, 731, 461, 10) Or
FindColorTolerance(x, y, 1653828, 693, 435, 731, 461, 10) Then
Begin
WriteLn('Saw Log Color');
End;
End;

Dynam0

2013-01-21 14:15:49

From: DannyRS
what does this output


Procedure Last;
Begin
WriteLn('Checking for Color');
If FindColorTolerance(x, y, 2183257, 693, 435, 731, 461, 10) Or
FindColorTolerance(x, y, 4286835, 693, 435, 731, 461, 10) Or
FindColorTolerance(x, y, 1653828, 693, 435, 731, 461, 10) Then
Begin
WriteLn('Saw Log Color');
End;
End;


As in what comes up in the Debug? If so Only "Checking for Color" appears. The script pretty much doesnt read anything past an 'If' statement.

DannyRS

2013-01-21 14:37:38

From: Dynam0
As in what comes up in the Debug? If so Only "Checking for Color" appears. The script pretty much doesnt read anything past an 'If' statement.


The colors or co-ordinates are wrong then

FindColorTolerance(x, y, 1653828, 693, 435, 731, 461, 10)


Dynam0

2013-01-22 03:18:54

From: DannyRS
The colors or co-ordinates are wrong then

FindColorTolerance(x, y, 1653828, 693, 435, 731, 461, 10)



I've redone the Co ordinates several times, I've also made sure the color was correct. I changed the Co ordinates to "MIX1, MIY1, MIX2, MIY2", which as you know are the co ordinates for the whole Inventory, which appears to work. It's a bit weird, but I guess i'll have to use MIX1, MIY1, MIX2, MIY2 from now on.



Update;

I scripted the procedure from scratch, this time it has worked.

The code below will search for the willow log's color in the last inventory spot. If it is there it will drop all the logs in the inventory. Now my only problem is getting it to stop, if it doesn't find the last willow log in the last inventory spot. What it will do at the minute is continue to search for the last willow log, and spam my debug with "Searching for Last Willow Log". Do you know if it's possible to create an 'If Not FindColorTolerance', so that if it doesn't find the last willow log, it won't do anything? Thanks.







program new;
{$i SRL/SRL.Simba}
var
x, y, DropWillowLog:Integer;

procedure FindLastWillowLog;
begin
WriteLn('Searching For Color');
If FindColorTolerance(x, y, 4155249, 689, 431, 733, 462, 15) or
FindColorTolerance(x, y, 1919571, 689, 431, 733, 462, 15) or
FindColorTolerance(x, y, 2051671, 689, 431, 733, 462, 15) then
begin
If FindColorTolerance(x, y, 4155249, MIX1, MIY1, MIX2, MIY2, 15) or
FindColorTolerance(x, y, 1919571, MIX1, MIY1, MIX2, MIY2, 15) or
FindColorTolerance(x, y, 2051671, MIX1, MIY1, MIX2, MIY2, 15) then
begin
Mouse(x, y, 5, 5, false);
If FindBitmapToleranceIn(DropWillowLog, x, y, MIX1, MIY1, MIX2, MIY2, 10) then
begin
Mouse(x, y, 3, 3, true);
Wait(500+Random(200));
WriteLn('We found the color');
end;
end;
end;
end;
begin
DropWillowLog := BitmapFromString(70, 8, 'meJzdVEkOgCAM9Gne+gGu/MkfA6F' +
'JU7sJkRi1mcMo02WAACmXHlsP5JCywH6UhibQhFaF0uOUq/X6Uw9w' +
'WQqYI8FnHd3kOMyUI5O/xJHAA47M1njuqxzRLq1yREFzxqa4bKRdn' +
'M43xxxgvBScX4bADsKT8T8ej9NN7rUISsU37aP4jSO8hBVccmtn');
ClearDebug;
SetupSRL;
repeat
FindLastWillowLog;
until(false);
FreeBitmap(DropWillowLog);

DannyRS

2013-01-22 06:30:37

Yes you can do If (Not FindColorTolerance(0,0,0,0,0,0)) Then

Dynam0

2013-01-22 12:57:49

From: DannyRS
Yes you can do If (Not FindColorTolerance(0,0,0,0,0,0)) Then


Thanks. It is pretty much done, the only problem I'm having now, is making it work like this; Starting cutting Willow logs, If the inventory gets full, empty it all, once empty, start over. Do you know if it is possible to do** At the minute It clicks a tree, drops a log, and repeats. If I want it to keep woodcutting, I have to add wait timers. Hope you understand. Thanks.





program AutoColor;
{$i SRL\SRL.simba}

var
x, y, ChopDown, DropWillowLog:Integer;



function TreeColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.09, 0.15);

if not (FindColorsTolerance(arP, 4023404, MSX1, MSY1, MSX2, MSY2, 6)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;


procedure WillowColor;
begin
WriteLn('Seaching for the willow');
If FindColorTolerance(x, y, TreeColor, MSX1, MSY1, MSX2, MSY2, 5) then
begin
Case random (2) Of
0: begin
MMouse(x, y, 3, 3);
ClickMouse(x, y, 1);
Wait(5000+random(1000));
end;
1: begin
Mouse(x, y, 3, 3, false);
If FindBitmapToleranceIn(ChopDown, x, y, MSX1, MSY1, MSX2, MSY2, 5) then
begin
Wait(500+random(200));
Mouse(x, y, 3, 4, true)
end;
end;
end;
end;
end;


procedure FindLastWillowLog;
begin
WriteLn('Searching For Color');
If FindColorTolerance(x, y, 4155249, 689, 431, 733, 462, 15) or
FindColorTolerance(x, y, 1919571, 689, 431, 733, 462, 15) or
FindColorTolerance(x, y, 2051671, 689, 431, 733, 462, 15) then
begin
If FindColorTolerance(x, y, 4155249, MIX1, MIY1, MIX2, MIY2, 15) or
FindColorTolerance(x, y, 1919571, MIX1, MIY1, MIX2, MIY2, 15) or
FindColorTolerance(x, y, 2051671, MIX1, MIY1, MIX2, MIY2, 15) then
begin
Mouse(x, y, 5, 5, false);
If FindBitmapToleranceIn(DropWillowLog, x, y, MIX1, MIY1, MIX2, MIY2, 10) then
begin
Mouse(x, y, 3, 3, true);
Wait(500+Random(200));
WriteLn('We found the color');
end;
end;
end;
end;


procedure NoWillowLogInLastSpot;
begin
If (Not FindColorTolerance(x, y, 4155249, 689, 431, 733, 462, 15)) or
(Not FindColorTolerance(x, y, 1919571, 689, 431, 733, 462, 15)) or
(Not FindColorTolerance(x, y, 2051671, 689, 431, 733, 462, 15)) then
begin
WriteLn('There is no log in the last inventory slot, we will keep cutting');
end;
end;




begin
DropWillowLog := BitmapFromString(70, 8, 'meJzdVEkOgCAM9Gne+gGu/MkfA6F' +
'JU7sJkRi1mcMo02WAACmXHlsP5JCywH6UhibQhFaF0uOUq/X6Uw9w' +
'WQqYI8FnHd3kOMyUI5O/xJHAA47M1njuqxzRLq1yREFzxqa4bKRdn' +
'M43xxxgvBScX4bADsKT8T8ej9NN7rUISsU37aP4jSO8hBVccmtn');
ChopDown := BitmapFromString(115, 6, 'meJzNk1EKwCAIhr1dF9hr9z/GBg' +
'oif2pGBRMf1G3+9tna09vTXzYiapyqR/VTfrs/SxArkFuROKrvD5a' +
'DVYseVepJZ9V1v03SZLwRozIEaEQOTHhHUrsFWMqYFsHyYHgiGalS' +
'j+Ss7rTnmEbjJWBtULyxGtvtRPCBYQ7WHhYgFOMjPYVbvgtPbg52M' +
'3Z/hCLYzXi/J9iK3F2w4NF5bfA3sHotl+RcAmKnwOqyLNgPQNL5Cg==');



SetupSRL;
ClearDebug;
repeat
WillowColor;
FindLastWillowLog;
NoWillowLogInLastSpot
until(false);
FreeBitmap(ChopDown);
FreeBitmap(DropWillowLog);
end.

johnlukey

2013-01-22 23:04:06

my idea has been to search for the period at the end of the line telling you that the tree ran out of logs. if you have chat on hide, this message is the longest recieved while woodcutting.
You could set it to continue cutting until it notices the black color of the period in a box where the 'tree out of logs' message appears. Then make it search for a new tree.


after clicking your tree you could simply add a function like this 'wait(5000+RandomRange(1,10000)); ' to let you cut the tree for a while, while still being random.
if you are in an area of clustered trees the wait time can be short, as long as you dont move much if you click another tree early and waste time walking

doxin

2013-01-22 23:32:46

From: Dynam0
Thanks. It is pretty much done, the only problem I'm having now, is making it work like this; Starting cutting Willow logs, If the inventory gets full, empty it all, once empty, start over. Do you know if it is possible to do** At the minute It clicks a tree, drops a log, and repeats. If I want it to keep woodcutting, I have to add wait timers. Hope you understand. Thanks.





program AutoColor;
{$i SRL\SRL.simba}

var
x, y, ChopDown, DropWillowLog:Integer;



function TreeColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.09, 0.15);

if not (FindColorsTolerance(arP, 4023404, MSX1, MSY1, MSX2, MSY2, 6)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;


procedure WillowColor;
begin
WriteLn('Seaching for the willow');
If FindColorTolerance(x, y, TreeColor, MSX1, MSY1, MSX2, MSY2, 5) then
begin
Case random (2) Of
0: begin
MMouse(x, y, 3, 3);
ClickMouse(x, y, 1);
Wait(5000+random(1000));
end;
1: begin
Mouse(x, y, 3, 3, false);
If FindBitmapToleranceIn(ChopDown, x, y, MSX1, MSY1, MSX2, MSY2, 5) then
begin
Wait(500+random(200));
Mouse(x, y, 3, 4, true)
end;
end;
end;
end;
end;


procedure FindLastWillowLog;
begin
WriteLn('Searching For Color');
If FindColorTolerance(x, y, 4155249, 689, 431, 733, 462, 15) or
FindColorTolerance(x, y, 1919571, 689, 431, 733, 462, 15) or
FindColorTolerance(x, y, 2051671, 689, 431, 733, 462, 15) then
begin
If FindColorTolerance(x, y, 4155249, MIX1, MIY1, MIX2, MIY2, 15) or
FindColorTolerance(x, y, 1919571, MIX1, MIY1, MIX2, MIY2, 15) or
FindColorTolerance(x, y, 2051671, MIX1, MIY1, MIX2, MIY2, 15) then
begin
Mouse(x, y, 5, 5, false);
If FindBitmapToleranceIn(DropWillowLog, x, y, MIX1, MIY1, MIX2, MIY2, 10) then
begin
Mouse(x, y, 3, 3, true);
Wait(500+Random(200));
WriteLn('We found the color');
end;
end;
end;
end;


procedure NoWillowLogInLastSpot;
begin
If (Not FindColorTolerance(x, y, 4155249, 689, 431, 733, 462, 15)) or
(Not FindColorTolerance(x, y, 1919571, 689, 431, 733, 462, 15)) or
(Not FindColorTolerance(x, y, 2051671, 689, 431, 733, 462, 15)) then
begin
WriteLn('There is no log in the last inventory slot, we will keep cutting');
end;
end;




begin
DropWillowLog := BitmapFromString(70, 8, 'meJzdVEkOgCAM9Gne+gGu/MkfA6F' +
'JU7sJkRi1mcMo02WAACmXHlsP5JCywH6UhibQhFaF0uOUq/X6Uw9w' +
'WQqYI8FnHd3kOMyUI5O/xJHAA47M1njuqxzRLq1yREFzxqa4bKRdn' +
'M43xxxgvBScX4bADsKT8T8ej9NN7rUISsU37aP4jSO8hBVccmtn');
ChopDown := BitmapFromString(115, 6, 'meJzNk1EKwCAIhr1dF9hr9z/GBg' +
'oif2pGBRMf1G3+9tna09vTXzYiapyqR/VTfrs/SxArkFuROKrvD5a' +
'DVYseVepJZ9V1v03SZLwRozIEaEQOTHhHUrsFWMqYFsHyYHgiGalS' +
'j+Ss7rTnmEbjJWBtULyxGtvtRPCBYQ7WHhYgFOMjPYVbvgtPbg52M' +
'3Z/hCLYzXi/J9iK3F2w4NF5bfA3sHotl+RcAmKnwOqyLNgPQNL5Cg==');



SetupSRL;
ClearDebug;
repeat
WillowColor;
FindLastWillowLog;
NoWillowLogInLastSpot
until(false);
FreeBitmap(ChopDown);
FreeBitmap(DropWillowLog);
end.


make a DropAllInventory procedure. make sure it begins with if FindDTM() so DropAllInventory will keep repeating until it doesn't find a log in the inventory.

Dynam0

2013-01-23 07:11:52

From: johnlukey
my idea has been to search for the period at the end of the line telling you that the tree ran out of logs. if you have chat on hide, this message is the longest recieved while woodcutting.
You could set it to continue cutting until it notices the black color of the period in a box where the 'tree out of logs' message appears. Then make it search for a new tree.


I tried to do something like this, however it didn't work. I'll try and rescript it as a last resort, thanks for the help :).


From: johnlukey
after clicking your tree you could simply add a function like this 'wait(5000+RandomRange(1,10000)); ' to let you cut the tree for a while, while still being random.
if you are in an area of clustered trees the wait time can be short, as long as you dont move much if you click another tree early and waste time walking


That's what I'm currently doing, I'm adding wait timers so it allows time for my player to cut the trees.


From: doxin
make a DropAllInventory procedure. make sure it begins with if FindDTM() so DropAllInventory will keep repeating until it doesn't find a log in the inventory.


I created this quickly, it searches for the logs in the inventory through DTMs

program new;
{$i SRL/SRL.Simba}
var
x, y, WillowLog, DropWillow:integer;


procedure FindWillowLog;
begin
If FindDTM(WillowLog, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 3, 3, false);
If FindBitmapToleranceIn(DropWillow, x, y, MIX1, MIY1, MIX2, MIY2, 10) then
begin
Mouse(x, y, 3, 3, true);
end;
end;
end;




begin
SetupSRL;
DropWillow := BitmapFromString(70, 8, 'meJzdVEkOgCAM9Gne+gGu/MkfA6F' +
'JU7sJkRi1mcMo02WAACmXHlsP5JCywH6UhibQhFaF0uOUq/X6Uw9w' +
'WQqYI8FnHd3kOMyUI5O/xJHAA47M1njuqxzRLq1yREFzxqa4bKRdn' +
'M43xxxgvBScX4bADsKT8T8ej9NN7rUISsU37aP4jSO8hBVccmtn');
WillowLog := DTMFromString('m6wAAAHic42ZgYOADYmkgFgViLgYIYAFidiAWBmJJqLwcEHMAsRBUXByIBYGYFYiZoPqYgZgTamZkgCKQZCQSEw+INRHNVABmGAIZ');
FindWillowLog;
FreeDTM(WillowLog);
end.


I'm trying to set something up so it's like;

begin
repeat
FindWillowTree;
until(LastWillowInInventory);
repeat
DropWillowLogs
until(InventoryEmpty);
end.

and get that to loop. But the only thing I can do if I want to repeat my loop is repeat until(false);.

doxin

2013-01-24 18:18:51

So you want to do this?
begin
repeat
begin
repeat
FindWillowTree;
until(LastWillowInInventory);
repeat
DropWillowLogs
until(InventoryEmpty);
until (false)
end.

and why don't you want it to loop until(false)? i would think you would like the script to keep repeating until you stopped it.

Dynam0

2013-01-25 08:11:17

From: doxin
So you want to do this?
begin
repeat
begin
repeat
FindWillowTree;
until(LastWillowInInventory);
repeat
DropWillowLogs
until(InventoryEmpty);
until (false)
end.

and why don't you want it to loop until(false)? i would think you would like the script to keep repeating until you stopped it.



Is that possible? I didn't think it was so i never tried it. Also I forgot to add in until(false);.

Wardancer

2013-01-25 11:36:04

From: Dynam0
Is that possible? I didn't think it was so i never tried it. Also I forgot to add in until(false);.


It is. It's horribly formatted with too many begin, but that'd be a way around your problem. That being said, personally I'd put the loop to drop all logs in the DropWillowLogs function itself for better understandability. I also strongly suggest to add a condition when to end the script. Simply "until false" could end up looking extremely botlike if anything goes wrong. See the end of the loop as a failsafe (on top of the failsafes you get to put in the core of the script).

doxin

2013-01-26 00:48:14

From: Wardancer
It is. It's horribly formatted with too many begin, but that'd be a way around your problem. That being said, personally I'd put the loop to drop all logs in the DropWillowLogs function itself for better understandability. I also strongly suggest to add a condition when to end the script. Simply "until false" could end up looking extremely botlike if anything goes wrong. See the end of the loop as a failsafe (on top of the failsafes you get to put in the core of the script).


all he needs is a couple of failsafes and some antirandoms