marc2333
11-04-2012, 12:12 AM
Outdated and wont update.
This is the first real script i am fully making. I had to write a function to check if the player is in combat since "srl_infight" doesn't work in Near-Reality. All it does is attack a basilisk when ever you are not attacking one. It doesn't work with food, only with prayer. It will check prayer each time it kills a basilisk and if your prayer is in the orange it will drink a pray pot. If it can,t find a pray pot, it will automatically click on the invent button and recheck for pray pot. If it can,t find one again, it will simply do ::home and to tele to edgeville.
Any comments are welcome. Even if you dont play this Rsps, you can still help me commenting the way i scripted this shit :) !
Oh yea and the "ClickInShit" procedure is just to get on the client after i click run in simba.
And something else, i used "movemouse" cause it a Rsps ^^
program Basilisk;
{$i srl/srl.simba}
var
count:integer;
stopitnow:boolean;
procedure ClickInShit;
begin
movemouse(743,106)
wait(200)
clickmouse(743,106,1)
end;
function BasiliskColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.06, 0.16);
if not (FindColorsTolerance(arP, 2702708, MSX1, MSY1, MSX2, MSY2, 3)) 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);
end;
procedure CheckPrayer;
var
x,y,w,h,PrayerPotColor:integer;
begin
PrayerPotColor := 9886755
GetClientDimensions(w,h);
if FindColor(x,y,501500,700,50,764,81)then
begin
if FindColor(x,y,9293346,546,200,w-1,h-1) or
FindColor(x,y,9686837,546,200,w-1,h-1)then
begin
wait(200)
writeln('pray pot found')
movemouse(x,y)
wait(200)
clickmouse(x,y,1)
end else
begin
wait(100);
writeln('clicking on invent to recheck');
if FindColor(x,y,1986182,620,168,662,200) then
begin
wait(100);
movemouse(x,y);
wait(200);
clickmouse(x,y,1);
wait(500)
if FindColor(x,y,9293346,546,200,w-1,h-1) or
FindColor(x,y,9686837,546,200,w-1,h-1)then
begin
wait(200);
writeln('pray pot found, we were not in invent');
movemouse(x,y);
wait(200);
clickmouse(x,y,1);
end else
begin
wait(100);
TypeSend('::home');
stopitnow:=true
end;
end;
end;
end;
end;
function IsPlayerInFight: Boolean;
var
green,red,x,y:integer;
begin
green:= 50820;
red:= 590010;
if findcolor(x,y,green,160,80,360,210) or
findcolor(x,y,red,160,80,360,210) then
begin
result := true
end else
result := false
end;
procedure AttackBasilisk;
var
x,y,h,w:integer;
infight:boolean;
begin
GetClientDimensions(w,h);
wait(300);
if FindColor(x,y,BasiliskColor,0,0,w-1,h-1) then
begin
wait(200);
movemouse(x,y);
wait(200);
clickmouse(x,y,1);
wait(3000);
repeat
wait(1000);
if IsPlayerInFight = false then
begin
writeln('not in fight anymore');
infight:=true;
end;
until(infight=true);
end;
end;
begin
ClickInShit;
repeat
AttackBasilisk;
inc(count);
writeln(count);
CheckPrayer;
until(stopitnow=true);
end.
This is the first real script i am fully making. I had to write a function to check if the player is in combat since "srl_infight" doesn't work in Near-Reality. All it does is attack a basilisk when ever you are not attacking one. It doesn't work with food, only with prayer. It will check prayer each time it kills a basilisk and if your prayer is in the orange it will drink a pray pot. If it can,t find a pray pot, it will automatically click on the invent button and recheck for pray pot. If it can,t find one again, it will simply do ::home and to tele to edgeville.
Any comments are welcome. Even if you dont play this Rsps, you can still help me commenting the way i scripted this shit :) !
Oh yea and the "ClickInShit" procedure is just to get on the client after i click run in simba.
And something else, i used "movemouse" cause it a Rsps ^^
program Basilisk;
{$i srl/srl.simba}
var
count:integer;
stopitnow:boolean;
procedure ClickInShit;
begin
movemouse(743,106)
wait(200)
clickmouse(743,106,1)
end;
function BasiliskColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.06, 0.16);
if not (FindColorsTolerance(arP, 2702708, MSX1, MSY1, MSX2, MSY2, 3)) 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);
end;
procedure CheckPrayer;
var
x,y,w,h,PrayerPotColor:integer;
begin
PrayerPotColor := 9886755
GetClientDimensions(w,h);
if FindColor(x,y,501500,700,50,764,81)then
begin
if FindColor(x,y,9293346,546,200,w-1,h-1) or
FindColor(x,y,9686837,546,200,w-1,h-1)then
begin
wait(200)
writeln('pray pot found')
movemouse(x,y)
wait(200)
clickmouse(x,y,1)
end else
begin
wait(100);
writeln('clicking on invent to recheck');
if FindColor(x,y,1986182,620,168,662,200) then
begin
wait(100);
movemouse(x,y);
wait(200);
clickmouse(x,y,1);
wait(500)
if FindColor(x,y,9293346,546,200,w-1,h-1) or
FindColor(x,y,9686837,546,200,w-1,h-1)then
begin
wait(200);
writeln('pray pot found, we were not in invent');
movemouse(x,y);
wait(200);
clickmouse(x,y,1);
end else
begin
wait(100);
TypeSend('::home');
stopitnow:=true
end;
end;
end;
end;
end;
function IsPlayerInFight: Boolean;
var
green,red,x,y:integer;
begin
green:= 50820;
red:= 590010;
if findcolor(x,y,green,160,80,360,210) or
findcolor(x,y,red,160,80,360,210) then
begin
result := true
end else
result := false
end;
procedure AttackBasilisk;
var
x,y,h,w:integer;
infight:boolean;
begin
GetClientDimensions(w,h);
wait(300);
if FindColor(x,y,BasiliskColor,0,0,w-1,h-1) then
begin
wait(200);
movemouse(x,y);
wait(200);
clickmouse(x,y,1);
wait(3000);
repeat
wait(1000);
if IsPlayerInFight = false then
begin
writeln('not in fight anymore');
infight:=true;
end;
until(infight=true);
end;
end;
begin
ClickInShit;
repeat
AttackBasilisk;
inc(count);
writeln(count);
CheckPrayer;
until(stopitnow=true);
end.