R0b0t1
2008-04-24 21:57:06
program New;
{.include SRL/SRL.scar}
const
ScriptURL = 'isnotregistered';
BoltType = 'Diamond';
type
TBoltCont = record
B: TBox;
P: TPoint;
end;
var
BB: TBoltCont;
procedure SetBoltBounds;
begin
case LowerCase(BoltType) of
'opal' :begin;BB.B := PointToBox(IntToPoint(35,65),IntToPoint(80,175));
BB.P := IntToPoint(60,115);end;
'sapphire',
'sapph' :begin;BB.B := PointToBox(IntToPoint(110,60),IntToPoint(200,180));
BB.P := IntToPoint(155,115);end;
'jade' :begin;BB.B := PointToBox(IntToPoint(220,65),IntToPoint(280,180));
BB.P := IntToPoint(255,120);end;
'pearl' :begin;BB.B := PointToBox(IntToPoint(320,65),IntToPoint(380,180));
BB.P := IntToPoint(355,115);end;
'emerald',
'emer' :begin;BB.B := PointToBox(IntToPoint(410,60),IntToPoint(495,180));
BB.P := IntToPoint(445,115);end;
'red topaz',
'red top':begin;BB.B := PointToBox(IntToPoint(30,195),IntToPoint(95,310));
BB.P := IntToPoint(70,250);end;
'ruby' :begin;BB.B := PointToBox(IntToPoint(115,190),IntToPoint(195,310));
BB.P := IntToPoint(155,250);end;
'diamond',
'diam' :begin;BB.B := PointToBox(IntToPoint(210,195),IntToPoint(295,310));
BB.P := IntToPoint(250,250);end;
'dragonstone',
'drag',
'ds' :begin;BB.B := PointToBox(IntToPoint(310,190),IntToPoint(390,310));
BB.P := IntToPoint(355,245);end;
'onyx' :begin;BB.B := PointToBox(IntToPoint(410,195),IntToPoint(490,310));
BB.P := IntToPoint(445,250);end;
end;
end;
procedure ClickBow(BowTol, WMS: Integer);
var x, y: Integer;
begin
if not FindColorTolerance(x, y, 1523812, 635, 230, 650, 245, BowTol) then
begin
WriteLn('Did not find crossbow color, stopping!');
WriteLn('Please relocate your mouse and switch to the correct screen.');
repeat
Wait(1);
until(FindColorTolerance(x, y, 1523812, 635, 230, 650, 245, BowTol));
end;
Mouse(x, y, -5, 5, True); //640, 235
Wait(WMS + Random(100));
end;
function BoltsUp(BoltTol, ST: Integer): Boolean;
var x, y, TTS: Integer;
begin
Result:= True;
if not FindColorTolerance(x, y, 2070783, 240, 30, 245, 40, BoltTol) then
begin
WriteLn('Event: Screen not up, waiting...');
TTS := 0;
repeat
Wait(1);
Inc(TTS);
if TTS>ST then //If searching >S(afe)T(ime), stop.
begin
WriteLn('Error: Enchant screen not found!');
Result:= False;
Break;
end;
until(FindColorTolerance(x, y, 2070783, 240, 30, 245, 40, BoltTol));
end;
end;
procedure ClickBolts(RTol, WST: Integer);
var x, y: Integer;
begin
if FindColorTolerance(x, y, BB.B.x1, BB.B.y1, BB.B.x2, BB.B.y2, 310, RTol) then
begin
WriteLn('Event: Not enough runes!');
WriteLn('MSG : Do you have the correct co-ords for your bolts?');
TerminateScript;
end;
Mouse(BB.P.x, BB.P.y, 10, 10, True);
Wait(WST+Random(100));
end;
procedure ScriptTerminate;
begin
WriteLn('Event: Script terminated.');
WriteLn('MSG : If this is a recurring error, please go to');
WriteLn(' '+ScriptURL+' for help or email the creator');
WriteLn(' at [email]R030t1@gmail.com[/email] (ctrl+click to follow)');
end;
begin
MouseSpeed:= 12;
SetBoltBounds;
repeat
ClickBow(5, 600);
if BoltsUp(5, 10000) then
ClickBolts(10, 50);
until(IsFKeyDown(12))
end.
Seems like it should work! Someone help me see why it isn't?