Blender
2009-07-09 07:44:18
Here is a function that I find useful, and so do many other cooking noobs sorta like me:
Anything to say?
Also, from my *cough* awesome *cough* mager (WIP).
It may be small, but it works!
Any comments on these two (more on their way)?
{*******************************************************************************
function FindRangeMS(var x, y: Integer; tol, timeout: Integer): Boolean;
By: xXxBlender3DxXx
Description: Finds the range in the mainscreen and writes the coordinates into
the variables x and y.
*******************************************************************************}
function FindRangeMS(var x, y: Integer; tol, timeout: Integer): Boolean;
var
Mark: Integer;
colors: TIntegerArray;
begin
colors := [6776431, 1976236, 1065359];
Result := False;
if not(FindObjCustom(x, y, ['2'], colors, tol)) then
begin
MarkTime(Mark);
repeat
case Random(2) of
0: MakeCompass(Random(360));
1: SetHighest(RBool);
2: Sleep(500 + Random(1000));
end;
if (FindObjCustom(x, y, ['2'], colors, tol)) then
begin
Result := True;
Break;
end;
until (FindObjCustom(x, y, ['2'], colors, tol)) or (FindNormalRandoms) or (TimeFromMark(Mark) > timeout);
end else Result := True;
end;
Anything to say?
Also, from my *cough* awesome *cough* mager (WIP).
It may be small, but it works!
{*******************************************************************************
function IsCasting: Boolean;
By: xXxBlender3DxXx
Description: Blindly checks to see if you are casting a spell (for those so lazy
they reject reflection's awsomeness).
*******************************************************************************}
function IsCasting: Boolean;
var
XP1, XP2: Integer;
begin
Result := False;
XP1 := GetXP('magic');
Wait(2000 + Random(500));
XP2 := GetXP('magic');
if not(XP1 = XP2) then Result := True;
end;
Any comments on these two (more on their way)?