SRL Archive - SRL Archives

My Procedures/Functions!


bullzeye95

2007-03-19 20:00:37

Don't pay attention to the old ones. I'll probably be adding useful stuff when I update now.

//////////////////////////////////////////////////////////////////////////
////////////////////////////ALL BY BULLZEYE95!////////////////////////////
//////////////////////////////////////////////////////////////////////////
{

Procedure WaitB(lowest: Integer; highest: Integer);
Function ModFound: Boolean;
Function IsUpTextMultiArr(text: array of string): Boolean;
Function IsMouseIn(x1, y1, x2, y2: Integer): Boolean;
Procedure DropAllRan;
Function GetDate(getTime, displayWords, militaryTime: Boolean): String;
Procedure TargetRS;
Function Reverse(Text: String): String;
Function IsPrime(Num: Integer): Boolean;
Function IsComposite(Num: Integer): Boolean;
Function RandomCase(Text: String): String;
Function GetNumbers(Text: String): String;
Function GetLetters(Text: String): String;
Function ReArrange(Text: String): String;
Function TrimAllSpaces(Text: String): String;
Function DeleteAll(Str, Del: String): String;
Function Average(Num: Array of Integer): Integer;
Function StrContains(Find, InString: String): Boolean;
Function BitmapFromColor(Width, Height, Color: Integer): Integer;
Function GetTradeAmount(TradePos: Integer; Side: String): Integer;
Function Range(Num1, Num2: Integer): Integer;
Function MixColors(col1, col2: Integer): Integer;
Function Place(I: Integer): String;
Function FindColorRightTol2(var cx, cy: Integer; Color, x1, y1, x2, y2, Tolerance: Integer): Boolean;

}



{*******************************************************************************
Procedure WaitB(lowest, highest: Integer);
By: Bullzeye95
Description: Waits a time between "lowest" and "highest".
*******************************************************************************}

procedure waitB(lowest, highest: Integer);
var
waitTime: Integer;
begin
if(lowest >= highest)then
begin
writeln('Lowest number is greater than or equal to your highest.');
exit;
end;
repeat
WaitTime:= random(highest);
until(not(waitTime<= lowest))
wait(waittime);
end;

{*******************************************************************************
Function ModFound: boolean;
By: Bullzeye95
Description: Returns true if a mod is present.
*******************************************************************************}

function ModFound: boolean;
var
tx, ty: Integer;
begin
if (not (GetColor(20, 434) = 0)) then Exit;
Wait(100);
if (BmpMod = 0) or (BmpAdmin = 0) then
LoadSRLBitMaps;
if (FindBitmapToleranceIn(bmpMod, tx, ty, 1, 345, 110, 430, 15)) or
(FindBitmapToleranceIn(bmpAdmin, tx, ty, 1, 345, 110, 430, 15)) then
begin
Result := True;
end;
end;

{*******************************************************************************
Function IsUpTextMultiArr(text: array of string): Boolean;
By: Bullzeye95
Description: This is like IsUpTextMulti, but you can have however many
different strings to check for as you want.
REMEMBER: Use like if(MyIsUpTextMulti(['hi', 'hi', 'hi', 'hi']))then
*******************************************************************************}
function IsUpTextMultiArr(text: array of string): boolean;
var
tempx, tempy, I: Integer;
begin
for I := 0 to getarraylength(text)-1 do
begin
if IsTextInAreaEx(7, 7, 334, 20, tempx, tempy, text[i], 100, UpChars, True, True, 0, 2, -1)then
Result := True;
end;
end;

{*******************************************************************************
Function IsMouseIn(x1, y1, x2, y2: Integer): Boolean;
By: Bullzeye95
Description: This checks if your mouse is in a defined box.
*******************************************************************************}
function IsMouseIn(x1, y1, x2, y2: integer) : Boolean;
begin
getmousepos(x, y);
if(x >= x1) and (x <= x2) and (y >= y1) and (y <= y2)then
Result:= true;
end;

{*******************************************************************************
Procedure DropAllRan;
By: Bullzeye95
Description: This chooses a random drop procedure each time. There are
currently three different ones it can choose from.
*******************************************************************************}
procedure DropAllRan;
begin
case Random(3) of
0: begin
dropall;
end;

1: begin
DropTo(1, 4);
DropInvPosition(8);
DropInvPosition(12);
DropInvPosition(16);
DropInvPosition(20);
DropInvPosition(24);
DropInvPosition(28);
DropInvPosition(27);
DropInvPosition(26);
DropInvPosition(25);
DropInvPosition(21);
DropInvPosition(17);
DropInvPosition(13);
DropInvPosition(9);
DropTo(5, 7);
DropInvPosition(11);
DropInvPosition(15);
DropInvPosition(19);
DropInvPosition(23);
DropInvPosition(22);
DropInvPosition(18);
DropInvPosition(14);
DropInvPosition(10);
end;

2: begin
dropto(1, 4);
DropInvPosition(8);
DropInvPosition(7);
DropInvPosition(6);
DropInvPosition(5);
dropto(9, 12);
DropInvPosition(16);
DropInvPosition(15);
DropInvPosition(14);
DropInvPosition(13);
dropto(17, 20);
DropInvPosition(24);
DropInvPosition(23);
DropInvPosition(22);
DropInvPosition(21);
dropto(23, 28);
end;
end;
end;

{*******************************************************************************
Function GetDate(getTime, displayWords, militaryTime: Boolean): String;
By: Bullzeye95
Description: This function returns a string containing the date, with
some options.
How to use the booleans:
-getTime: Return the time also.
-displayWords: Make it look like January 14th, 2007, instead of 1/14/2007
-militaryTime: Make the time look like 16:27:32, not 4:27:32

USED RON'S FUNCTION TO MAKE THIS! I JUST BUILT ON TO IT!
*******************************************************************************}
function GetDate(getTime, displayWords, militaryTime: Boolean): String;
var
Year, Month, Day, Hour, Min, Sec, MSec: Word;
M, D: String;
begin
if(displayWords)then
begin
DecodeDate(Date, Year, Month, Day);
case Month of
1 : M := 'January';
2 : M := 'February';
3 : M := 'March';
4 : M := 'April';
5 : M := 'May';
6 : M := 'June';
7 : M := 'July';
8 : M := 'August';
9 : M := 'September';
10 : M := 'October';
11 : M := 'November';
12 : M := 'December';
end;
case Day of
1 : D := 'st';
2 : D := 'nd';
3 : D := 'rd';
end;
if(Day > 3)then
D := 'th';
if(getTime)then
begin
DecodeTime(time, Hour, Min, Sec, MSec);
if(not(militaryTime))then
begin
if(Hour > 12)then
begin
Hour:= Hour-12;
Result:= M+' '+IntToStr(Day)+D+', '+IntToStr(Year) + ' ' + IntToStr(Hour)+':'+IntToStr(Min)+':'+IntToStr(Sec);
exit;
end;
end;
Result:= M+' '+IntToStr(Day)+D+', '+IntToStr(Year) + ' ' + IntToStr(Hour)+':'+IntToStr(Min)+':'+IntToStr(Sec);
end
else
Result := M+' '+IntToStr(Day)+D+', '+IntToStr(Year);
end;
if(not(displayWords))then
begin
if(getTime)then
begin
DecodeTime(time, Hour, Min, Sec, MSec);
if(not(militaryTime))then
begin
if(Hour > 12)then
begin
Hour:= Hour-12;
Result:= DateToStr(date) + ' ' + IntToStr(Hour)+':'+IntToStr(Min)+':'+IntToStr(Sec);
exit;
end;
if(not(Hour > 12))then
begin
Result:= DateToStr(date) + ' ' + IntToStr(Hour)+':'+IntToStr(Min)+':'+IntToStr(Sec);
exit;
end;
end;
if(militaryTime)then
begin
Result:= DateToStr(date) + ' ' + IntToStr(Hour)+':'+IntToStr(Min)+':'+IntToStr(Sec);
exit;
end;
end;
if(not(getTime))then
begin
Result:= DateToStr(date);
end;
end;
end;

{*******************************************************************************
Function CapitalizeIt(theWord: String): String;
By: Bullzeye95
Description: Capitalizes the first letter of the first word in your string.
*******************************************************************************}
function CapitalizeIt(theWord: String): String;
var
tWord, firstLetter: String;
begin
tWord:= theWord;
if(tWord = '')then
begin
writeln('Your string is blank');
exit;
end;
tWord:= Trim(tWord);
firstLetter:= uppercase(copy(tWord, 1, 1));
delete(tWord, 1, 1);
tWord:= firstLetter + tWord;
Result:= tWord;
end;

{*******************************************************************************
Procedure TargetRS;
By: Bullzeye95
Description: Does the same thing as selecting the RS screen with the
crosshairs.
*******************************************************************************}
Procedure TargetRS;
begin
FindWindowBySize(766, 504);
end;

{*******************************************************************************
Function Reverse(Text: String): String;
By: Bullzeye95
Description: This reverses a string. For example, asdf would become fdsa.
*******************************************************************************}
function Reverse(Text: String): String;
var
I: Integer;
S: String;
begin
Text:= Trim(Text);
for I:= Length(Text) downto 1 do
S:= S + copy(Text, I, 1);
Result:= S;
end;

{*******************************************************************************
Function IsPrime(Num: Integer): Boolean;
By: Bullzeye95
Description: Returns true if a number is prime.
*******************************************************************************}
function IsPrime(Num: Integer): Boolean;
var
I: Integer;
begin
if(Num = 2)then
begin
Result:= True;
exit;
end;
for I:= 2 to Num - 1 do
begin
if((Num mod I) = 0)then
begin
Result:= False;
exit;
end;
end;
Result:= True;
end;

{*******************************************************************************
Function IsComposite(Num: Integer): Boolean;
By: Bullzeye95
Description: Returns true if a number is composite.
*******************************************************************************}
function IsComposite(Num: Integer): Boolean;
begin
Result:= not(IsPrime(Num));
end;

{*******************************************************************************
Function RandomCase(Text: String): String;
By: Bullzeye95
Description: Makes all letters of a string a different case. For example,
'hello bob' might become 'hELlO boB'
*******************************************************************************}
function RandomCase(Text: String): String;
var
S: Array of String;
I: Integer;
begin
setarraylength(S, Length(Text));
for I:= 0 to Length(Text) - 1 do
case Random(2) of
0: S[I]:= Uppercase(copy(Text, I + 1, 1));
1: S[I]:= Lowercase(copy(Text, I + 1, 1));
end;
for I:= 0 to Length(Text) - 1 do
Result:= Result + S[I];
end;

{*******************************************************************************
Function GetNumbers(Text: String): String;
By: Bullzeye95
Description: Returns only the numbers in a string.
*******************************************************************************}
function GetNumbers(Text: String): String;
var
I: Integer;
CE: String;
begin
Text:= Trim(Text);
for I:= 1 to Length(Text) do
if(Lowercase(copy(Text, I, 1)) = Uppercase(copy(Text, I, 1)))then
try
CE:= inttostr(strtoint(copy(Text, I, 1)));
Result:= Result + copy(Text, I, 1);
except
end;
end;

{*******************************************************************************
Function GetLetters(Text: String): String;
By: Bullzeye95
Description: Returns only the letters in a string.
*******************************************************************************}
function GetLetters(Text: String): String;
var
I: Integer;
begin
Text:= Trim(Text);
for I:= 1 to Length(Text) do
if(not(Lowercase(copy(Text, I, 1)) = Uppercase(copy(Text, I, 1))))then
Result:= Result + copy(Text, I, 1);
end;

{*******************************************************************************
Function ReArrange(Text: String): String;
By: Bullzeye95
Description: It mixes up a string. For example, 'hello' might become 'loleh'
*******************************************************************************}
function ReArrange(Text: String): String;
var
Str: Array of String;
I, TempRan: Integer;
Finish: Boolean;
begin
Text:= Trim(Text);
SetArrayLength(Str, Length(Text));
for I:= 0 to GetArrayLength(Str) - 1 do
Str[I]:= copy(Text, I + 1, 1);
while Finish = False do
begin
TempRan:= Random(GetArrayLength(Str));
Result:= Result + Str[TempRan];
Str[TempRan]:= '';
for I:= 0 to GetArrayLength(Str) - 1 do
begin
if(not(Str[I] = ''))then
begin
Finish:= False;
break;
end;
if(I = GetArrayLength(Str) - 1)then
exit;
end;

end;
end;

{*******************************************************************************
Function TrimAllSpaces(Text: String): String;
By: Bullzeye95
Description: Takes out all spaces in your string.
*******************************************************************************}
function TrimAllSpaces(Text: String): String;
var
I: Integer;
begin
Text:= Trim(Text);
for I:= 1 to Length(Text) do
while pos(' ', Text) <> 0 do
delete(Text, pos(' ', Text), 1);
Result:= Text;
end;

{*******************************************************************************
Function DeleteAll(Str, Del: String): String;
By: Bullzeye95
Description: Deletes all of the string Del in the string Str, then
returns it.
*******************************************************************************}
function DeleteAll(Str, Del: String): String;
var
I: Integer;
begin
for I:= 1 to Length(Str) do
begin
delete(Str, pos(Del, Str), Length(Del));
end;
Result:= Str;
end;

{*******************************************************************************
Function Average(Num: Array of Integer): Integer;
By: Bullzeye95
Description: Returns the average of an array of integers.
*******************************************************************************}
function Average(Num: Array of Integer): Integer;
var
TAns, I: Integer;
begin
try
SetArrayLength(Num, GetArrayLength(Num));
for I:= 0 to GetArrayLength(Num) - 1 do
TAns:= TAns + Num[I];
Result:= TAns div GetArrayLength(Num);
except
end;
end;

{*******************************************************************************
Function StrContains(Find, InString: String): Boolean;
By: Bullzeye95
Description: Returns true if string InString contains string Find.
*******************************************************************************}
Function StrContains(Find, InString: String): Boolean;
begin
Result:= pos(Find, InString) <> 0;
end;

{*******************************************************************************
Function BitmapFromColor(Width, Height, Color: Integer): Integer;
By: Bullzeye95
Description: Returns a bitmap of one color.
*******************************************************************************}
function BitmapFromColor(Width, Height, Color: Integer): Integer;
var
Buffer: Integer;
begin
Buffer:= BitmapFromString(Width, Height, '');
FastDrawClear(Buffer, Color);
Result:= Buffer;
end;

{*******************************************************************************
Function GetTradeAmount(TradePos: Integer; Side: String): Integer;
By: Bullzeye95
Description: Returns the amount of an item on either side of the trade
screen.
TradePos - The position of the item. Used like inventory position.
Side - Tells it on what side of the trade screen to look. Left or right.
*******************************************************************************}
function GetTradeAmount(TradePos: Integer; Side: String): Integer;
var
CoordPoint: TPoint;
begin
case lowercase(Side) of
'left': CoordPoint:= AmountCoords('your trade', TradePos);
'right': CoordPoint:= AmountCoords('trade', TradePos);
else Exit;
end;
Result:= GetAmount(CoordPoint.x, CoordPoint.y);
end;

{*******************************************************************************
function Range(Num1, Num2: Integer): Integer;
By: Bullzeye95
Description: Returns the range of two numbers.
*******************************************************************************}
function Range(Num1, Num2: Integer): Integer;
begin
if(Num1 - Num2 >-1)then
Result:= Num1 - Num2
else
Result:= Num2 - Num1;
end;

{*******************************************************************************
function MixColors(col1, col2: Integer): Integer;
By: Bullzeye95
Description: Mixes two colors.
*******************************************************************************}
function MixColors(col1, col2: Integer): Integer;
var
H1, S1, L1, H2, S2, L2, H3, S3, L3: Extended;
begin
ColortoHSL(col1, H1, S1, L1);
ColortoHSL(col2, H2, S2, L2);
H3:= abs((H1 + H2) div 2);
S3:= abs((S1 + S2) div 2);
L3:= abs((L1 + L2) div 2);
Result:= HSLtoColor(H3, S3, L3);
end;

{*******************************************************************************
function Place(I: Integer): String;
By: Bullzeye95
Description: Returns the number as a string, with either a 'st', 'nd', 'rd', or
'th' at the end of it.
*******************************************************************************}
function Place(I: Integer): String;
begin
case Copy(IntToStr(I), Length(IntToStr(I)), 1) of
'1': Result:= IntToStr(I) + 'st';
'2': Result:= IntToStr(I) + 'nd';
'3': Result:= IntToStr(I) + 'rd';
else Result:= IntToStr(I) + 'th';
end;
end;

{*******************************************************************************
function FindColorRightTol2(var cx, cy: Integer; Color, x1, y1, x2, y2, Tolerance: Integer): Boolean;
By: Bullzeye95
Description: Faster version of FindColorRightTol.
*******************************************************************************}
function FindColorRightTol2(var cx, cy: Integer; Color, x1, y1, x2, y2, Tolerance: Integer): Boolean;
var
Boxes: TBoxArray;
I: Integer;
tX1, tY1, tX2, tY2: Integer;
begin
SetLength(Boxes, x2 - x1);
tX1:= x2 - 1;
tY1:= y1;
tX2:= x2;
tY2:= y2;
for I:= 0 to Length(Boxes) - 1 do
begin
tX1:= tX1 - 1;
tX2:= tX2 - 1;
Boxes[I]:= IntToBox(tX1, tY1, tX2, tY2);
end;
for I:= 0 to Length(Boxes) - 1 do
if(FindColorTolerance(cx, cy, Color, Boxes[I].x1, Boxes[I].y1, Boxes[I].x2, Boxes[I].y2, Tolerance))then
begin
Result:= True;
exit;
end;
end;

I have to say the ReArrange function was definitely the hardest to make. I tried at least 20 times, no joke.

You can also see how much better I've gotten since when I started.

UPDATE: MUCH faster FindColorRightTol.

bullzeye95

2007-03-23 17:04:07

Just added another function

{*******************************************************************************
Function BitmapFromColor(Width, Height, Color: Integer): Integer;
By: Bullzeye95
Description: Returns a bitmap of one color.
*******************************************************************************}
function BitmapFromColor(Width, Height, Color: Integer): Integer;
var
Buffer: Integer;
begin
Buffer:= BitmapFromString(Width, Height, '');
FastDrawClear(Buffer, Color);
Result:= Buffer;
end;

Updated first post.



Hey, it might be useful to someone lol

bullzeye95

2007-03-24 23:02:14

Nobody has any suggestions or comments? *cries*



EDIT: Whoops! I just realized I triple posted :duh:

Cheesehunk

2007-03-25 00:56:49

Some pretty unique functions and stuff there, keep up the good work!

oliver1205

2007-03-25 05:37:20

yeah, after i look through them deeper, i may consider using some

bullzeye95

2007-03-25 22:02:12

Thanks guys :)

Lol now that I look back at the ReArrange function, I have no clue how it works :p

Any suggestions of what to make? I'm stuck :-/

syberium

2007-03-28 01:13:29

Something to count the yellow number on a noted item in a trade screen. like for example GetItemAmount(Name : String); or something/

bullzeye95

2007-03-28 17:37:55

Hmm that's an idea. I'll see what I can do.

EDIT: This should work
function GetTradeAmount(TradePos: Integer; Side: String): Integer;
var
CoordPoint: TPoint;
begin
case lowercase(Side) of
'left': CoordPoint:= AmountCoords('your trade', TradePos);
'right': CoordPoint:= AmountCoords('trade', TradePos);
else Exit;
end;
Result:= GetAmount(CoordPoint.x, CoordPoint.y);
end;
TradePos is the position of the item, like in the inventory.
Side tells it to either check the left side or the right side of the trade screen.

syberium

2007-03-29 00:05:02

so i could do something like
 Var TheAmount : Integer; 
Procedure GetThatAmount;
begin
TheAmount := GetTradeAmount(1,'right');
//Coind DTM and blah blah right click coins
TypeSend(IntToStr(TheAmount));
end;

basic idea but that should work right?

SKy Scripter

2007-03-30 12:12:03

you could make these alot smaller then you have them


{*******************************************************************************
Function GetNumbers(Text: String): String;
By: Bullzeye95 Edit By Sky Scripter
Description: Returns only the numbers in a string.
*******************************************************************************}

function GetNumbers(Text: String): String;
var
i, c:Integer;
begin
For i:= 1 to length(Text) do
For C:= 48 to 57 do
if (Text[i] = Chr(c)) then
result:= Result + text[i];
end;

{*******************************************************************************
Function Reverse(Text: String): String;
By: Bullzeye95 Edit By Sky Scripter
Description: This reverses a string. For example, asdf would become fdsa.
*******************************************************************************}
function Reverse(Text: String): String;
var
I: Integer;
begin
for I:= Length(Text) downto 1 do
Result:= Result + Text[i]
Trim(Result);
end;



Basically all i am saying is you can use result
instead of asking for a new string.
it can save you a few lines, great job ;)

bullzeye95

2007-07-04 00:16:53

I can't believe I'm actually taking the time to update this with a worthless function, but here:
function MixColors(col1, col2: Integer): Integer;
var
H1, S1, L1, H2, S2, L2, H3, S3, L3: Extended;
begin
ColortoHSL(col1, H1, S1, L1);
ColortoHSL(col2, H2, S2, L2);
H3:= abs((H1 + H2) div 2);
S3:= abs((S1 + S2) div 2);
L3:= abs((L1 + L2) div 2);
Result:= HSLtoColor(H3, S3, L3);
end;
It… mixes two colors…
I was bored…
To test it:
program New;
var
Buffer: Integer;

const
TheColor = 12764645; //Put in the color to view it

function BitmapFromColor(Width, Height, Color: Integer): Integer;
var
Buffer: Integer;
begin
Buffer:= BitmapFromString(Width, Height, '');
FastDrawClear(Buffer, Color);
Result:= Buffer;
end;

begin
Buffer:= BitmapFromColor(40, 40, TheColor);
DisplayDebugImgWindow(40, 40);
SafeDrawBitmap(Buffer, GetDebugCanvas, 0, 0);
end.

SKy Scripter

2007-07-04 01:30:11

lol you bounced a old thread up :p

bullzeye95

2007-07-04 01:41:24

OMG I R T3H BANZ
Haha my new function is fun to play with. I like to see what it comes up with.

SKy Scripter

2007-07-04 03:21:49

Hah What a Dork…. jk ;)
i like pretty Colors as Well :)

Edit : woe and im a king black dragon when that happen XD

Santa_Clause

2007-07-04 09:19:50

Dude I swear the SRL Activity and Longevity is rigged. My post count and Activity are alot higher than yours, yet I'm still a Lesser Demon.

My longevity isn't that much higher than yours anyway. What's wrong?!

n3ss3s

2007-07-04 11:44:51

Dunno. BTW if its about post count and those, by looking at SKy's , I will soon become KBD too :O :)

SKy Scripter

2007-07-04 14:13:19

it might be because of your Rep++?

nielsie95

2007-07-04 14:39:31

It's because of the time you spent on the board and the longetivity and activity I believe :p

Dan Cardin

2007-07-08 21:01:11

getdate could be helpful if you only wanted a script to go on at certain times of day to be more human, or am i mistaken

bullzeye95

2007-07-10 00:37:29

Dunno dan, I don't even remember making it :p

And updated with a faster version of FindColorRightTol. The old version was SLOW.

function FindColorRightTol2(var cx, cy: Integer; Color, x1, y1, x2, y2, Tolerance: Integer): Boolean;
var
Boxes: TBoxArray;
I: Integer;
tX1, tY1, tX2, tY2: Integer;
begin
SetLength(Boxes, x2 - x1);
tX1:= x2 - 1;
tY1:= y1;
tX2:= x2;
tY2:= y2;
for I:= 0 to Length(Boxes) - 1 do
begin
tX1:= tX1 - 1;
tX2:= tX2 - 1;
Boxes[I]:= IntToBox(tX1, tY1, tX2, tY2);
end;
for I:= 0 to Length(Boxes) - 1 do
if(FindColorTolerance(cx, cy, Color, Boxes[I].x1, Boxes[I].y1, Boxes[I].x2, Boxes[I].y2, Tolerance))then
begin
Result:= True;
exit;
end;
end;

Johura

2007-07-11 09:08:59

Cool. I love you random dropping procedure. I was about to make one of my own but i don't do that much scripting anymore.

jhildy

2007-07-11 13:44:05

{*******************************************************************************
Procedure WaitB(lowest, highest: Integer);
By: Bullzeye95
Description: Waits a time between "lowest" and "highest".
*******************************************************************************}

procedure waitB(lowest, highest: Integer);
var
waitTime: Integer;
begin
if(lowest >= highest)then
begin
writeln('Lowest number is greater than or equal to your highest.');
exit;
end;
repeat
WaitTime:= random(highest);
until(not(waitTime<= lowest))
wait(waittime);
end;

you could make that a lot simpler

{*******************************************************************************
Procedure WaitB(wait1, wait2: Integer);
By: Bullzeye95
Description: Waits a time between "wait1" and "wait2".
*******************************************************************************}

procedure waitB(wait1, wait2: Integer);
begin
wait(Randomrange(wait1,wait2));
end;