is there a command for looking at text in the text box? So the bot will know when to click a new rock and mine it, cuz the text in the text box will say "you get a gold ore(or whatever it says)"
is there a command for looking at text in the text box? So the bot will know when to click a new rock and mine it, cuz the text in the text box will say "you get a gold ore(or whatever it says)"
yes there is! lol I believe it is:
SCAR Code:GetBlackText('blah');
if that doesnt work then check in the SRL Library, I know its in there.
Hey,
It is not for me to say but what about a bitmap?
Take a picture of the sentence and present it to SCAR..... Than make SCAR look for it inside the text box.
A try couldn't hurt, tho I already see some errors.....
Fort Ash
Same thing, but dont use a Bitmap.
and sorry above I posted the wrong one, both of you, just use this:
SCAR Code:IsBlackText('whatever text your looking for');
the one I posted Above:
SCAR Code:GetBlackText(Line your looking for);
will just tell you what text is on the line Specified.
thanks, i got 1 more question. i think you saw my script wen i went for membs apps. and i dont understand why the FindNormalRandoms; doesn't work =(.
SCAR Code:program PowerMiner;
{------------------------------Script Info-------------------------------------|
| ScriptName = Power Miner |
| Author = DroppeD=) or 0 vv n ag e |
| Description = Mines ores then drops them |
| Version = 1 |
| Date = 1/10/09 |
|______________________________________________________________________________|
|-----------------------------Instructions-------------------------------------|
| |
| Instructions: |
| Setup: 1. Be next to the ore you wish to mine! |
| 2. Your Pickaxe MUST be equiped or in the FIRST slot of your |
| inventory |
| 2. Input SRL-stats ID & Password [In constants] |
| 3. Fill out lines 37 to 45 |
| 4. Read the "Need to knows" below. |
| 5. Push play! |
| |
| |
|______________________________________________________________________________}
{.include srl/srl.scar}
{.include SRL/SRL/skill/mining.scar}
{------------------------------------------------------------------------------}
{===============================Player Setup===================================}
{------------------------------------------------------------------------------}
const
directionToRun='E';
yourSRLID='5480';
yourSRLPW='gomo007';
var
i:integer;//dont touch this
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '0 vv n ag e'; //Your runescape username
Players[0].Nick := '0vv'; //3-4 letters from your username
Players[0].Pass := '484kvjhpr8orooney'; //Your runescape password
Players[0].Strings[0] := 'Iron'; //What type of ore you wish to mine, Iron, Tin, Copper
Players[0].Active := True;
{
Players[1].Name := 'username'; //Your runescape username
Players[1].Nick := 'sern'; //3-4 letters from your username
Players[1].Pass := 'password'; //Your runescape password
Players[1].Strings[0] := 'Iron'; //What type of ore you wish to mine, Iron, Tin, Copper
Players[1].Active := True;
}
end;
procedure RanWait(Time : Integer);// Jacked From mormonman =P
var
StartTime : Integer;
begin
MarkTime(StartTime);
while (TimeFromMark(StartTime) < Time) do
begin
Wait(100);
FindNormalRandoms;
if FindFight then RunAway(DirectionToRun, False, 1, 5000+random(1000));
end;
end;
Function CheckLine:boolean;
begin
if (not(Players[0].Strings[0] = 'Tin')) then
if (not(Players[0].Strings[0] = 'Iron')) then
if (not(Players[0].Strings[0] = 'Copper')) then
begin
Writeln('You did not fill out line ** correctly');
Writeln('Try using ''Tin'' or ''Iron'' or ''Copper''');
Writeln('Script terminated');
TerminateScript;
Result:= False;
end else
begin
Result:= True;
end;
end;
procedure Signature; //Idea from Narcles fast fighter
begin
ClearReport;
AddtoReport(' ____ ');
AddtoReport('| _ \ Made By ');
AddtoReport('| | \ \_ __ ___ _ __ _ __ ');
AddtoReport('| | | | ''__/ _ | `_ \ `_ \ ');
AddtoReport('| |_/ / | | (_)| (_) |(_) | ');
AddtoReport('|____/|_| \___| __/ __/ED ');
AddtoReport(' | | | | ');
AddtoReport('PowerMiner v1.0|_| |_| ');
AddtoReport('StartTime:' +TheTime);
writeln(' ____ ');
writeln('| _ \ Made By ');
writeln('| | \ \_ __ __ _ __ _ __ ');
writeln('| | | | ''__/_ \| `_ \ `_ \ ');
writeln('| |_/ / || (_) | (_) |(_) | ');
writeln('|____/|_| \___/| __/ __/ED ');
writeln(' | | | | ');
writeln('PowerMiner v1.0|_| |_| ');
writeln('StartTime:' +TheTime);
end;
procedure SetupScript;
begin
i:= 0;
Signature;
SetupSRL;
ActivateClient;
DeclarePlayers;
if not(LoggedIn) then LogInPlayer;
makecompass('n');
SetAngle(true);
FindPickHeadColor;
end;
function AutoColorTin: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 6118756, MSX1, MSY1, MSX2, MSY2, 113);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 0.00) and (H <= 3.35) and (S >= 3.14) and (S <= 6.40) and (L >= 12.14) and (L <= 63.16) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 1.27) and (X <= 33.76) and (Y >= 1.31) and (Y <= 34.38) and (Z >= 1.40) and (Z <= 35.88) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
procedure TinMProcess;//find the tin, mines it, then drops it
var
x,y:integer;
begin
if (FindColor(x,y,AutoColorTin,MSX1, MSY1, MSX2, MSY2)) then
begin
FindPick;
if (not(FindGas(x,y))) then
begin
MMouse(x,y,0,0);
if (IsUpText('Mine')) then
begin
Mouse(x,y,0,0,true);
RanWait(500+random(700))
end else
begin
Mouse(x,y,0,0,false);
ChooseOption('Mine');
RanWait(550+random(700));
end;
end;
end;
end;
Procedure TinProcess;
begin
repeat
if not(LoggedIn) then LogInPlayer;
FindNormalRandoms;
TinMProcess;
i:=i + 1;
until(InvFull = true);
begin
MMouseItem(1);
if (IsUpText('icka')) then
begin
DropItem(2);
DropItem(3);
DropItem(4);
DropItem(5);
RanWait(250+random(700));
DropItem(6);
DropItem(7);
DropItem(8);
DropItem(9);
DropItem(10);
DropItem(11);
RanWait(250+random(700));
DropItem(12);
DropItem(13);
DropItem(14);
DropItem(15);
DropItem(16);
DropItem(17);
RanWait(250+random(700));
DropItem(18);
DropItem(19);
DropItem(20);
DropItem(21);
DropItem(22);
DropItem(23);
DropItem(24);
DropItem(25);
DropItem(26);
DropItem(27);
DropItem(28);
end else
begin
RanWait(250+random(700));
DropAll;
end;
end;
end;
function AutoColorCopper: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 3692409, MSX1, MSY1, MSX2, MSY2, 60);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 7.70) and (H <= 8.23) and (S >= 36.34) and (S <= 37.24) and (L >= 21.74) and (L <= 47.27) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 4.58) and (X <= 23.44) and (Y >= 4.28) and (Y <= 21.74) and (Z >= 2.16) and (Z <= 9.81) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
procedure CopperMProcess;//finds the copper then mines it
var
x,y:integer;
begin
if (FindColor(x,y,AutoColorTin,MSX1, MSY1, MSX2, MSY2)) then
begin
FindPick;
if (not(FindGas(x,y))) then
begin
MMouse(x,y,0,0);
if (IsUpText('Mine')) then
begin
Mouse(x,y,0,0,true);
RanWait(550+random(700));
end else
begin
Mouse(x,y,0,0,false);
ChooseOption('Mine');
RanWait(550+random(700));
end;
end;
end;
end;
Procedure CopperProcess;
begin
repeat
if not(LoggedIn) then LogInPlayer;
FindNormalRandoms;
CopperMProcess;
i:=i + 1;
until(InvFull = true);
begin
MMouseItem(1);
if (IsUpText('icka')) then
begin
DropItem(2);
DropItem(3);
RanWait(250+random(700));
DropItem(4);
DropItem(5);
DropItem(6);
DropItem(7);
RanWait(250+random(700));
DropItem(8);
DropItem(9);
DropItem(10);
DropItem(11);
DropItem(12);
DropItem(13);
RanWait(250+random(700));
DropItem(14);
DropItem(15);
DropItem(16);
RanWait(250+random(700));
DropItem(17);
DropItem(18);
DropItem(19);
DropItem(20);
RanWait(250+random(700));
DropItem(21);
DropItem(22);
DropItem(23);
DropItem(24);
RanWait(250+random(700));
DropItem(25);
DropItem(26);
DropItem(27);
DropItem(28);
end else
begin
DropAll;
end;
end;
end;
function AutoColorIron: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 1976385, MSX1, MSY1, MSX2, MSY2, 39);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 4.45) and (H <= 5.15) and (S >= 35.98) and (S <= 38.26) and (L >= 9.78) and (L <= 27.27) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 1.00) and (X <= 6.71) and (Y >= 0.89) and (Y <= 5.66) and (Z >= 0.59) and (Z <= 3.14) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
procedure IronMProcess;//finds the iron then mines it
var
x,y:integer;
begin
if (FindColor(x,y,AutoColorIron,MSX1, MSY1, MSX2, MSY2)) then
begin
FindPick;
if (not(FindGas(x,y))) then
begin
MMouse(x,y,0,0);
if (IsUpText('Mine')) then
begin
Mouse(x,y,0,0,true);
RanWait(550+random(700));
end else
begin
Mouse(x,y,0,0,false);
ChooseOption('Mine');
RanWait(550+random(700));
end;
end;
end;
end;
Procedure IronProcess;
begin
repeat
if not(LoggedIn) then LogInPlayer;
FindNormalRandoms;
IronMProcess;
i:=i + 1;
until(InvFull = true);
begin
MMouseItem(1);
if (IsUpText('icka')) then
begin
DropItem(2);
DropItem(3);
RanWait(250+random(700));
DropItem(4);
DropItem(5);
DropItem(6);
RanWait(250+random(700));
DropItem(7);
DropItem(8);
DropItem(9);
RanWait(250+random(700));
DropItem(10);
DropItem(11);
DropItem(12);
DropItem(13);
DropItem(14);
DropItem(15);
RanWait(250+random(700));
DropItem(16);
DropItem(17);
DropItem(18);
RanWait(250+random(700));
DropItem(19);
DropItem(20);
DropItem(21);
RanWait(250+random(700));
DropItem(22);
DropItem(23);
DropItem(24);
DropItem(25);
DropItem(26);
DropItem(27);
DropItem(28);
end else
begin
DropAll;
end;
end;
end;
{
___
========== |\/| /\ ___ |\ | | ___ |\ | | ===========
| | |__| | | \ | | | | \ | |___
========== | | | | _|_ | \| |__ _|_ | \| |___ ===========}
begin
SetupScript;
repeat
begin
if (Players[0].Strings[0] = 'Tin') then
begin
TinProcess;
end else
begin
if (Players[0].Strings[0] = 'Iron') then
begin
IronProcess;
end else
if (Players[0].Strings[0] = 'Copper') then
begin
CopperProcess;
end else
begin
Writeln('Script could not execute, you did something wrong!');
TerminateScript;
end;
end;
end;
until(false);
end.
you still use color for the ore ...? i thought you changed that.
oh and you don't have a anti Random lol... here insert this.
SCAR Code:Procedure RandomCheck;
begin
FindNormalRandoms;
if FindFight then
begin
MakeCompass('n');
mouse(630, 154, 5, 5, True);
fflag(0);
SleepAndMoveMouse(15000+random(5000));
Mouse(630, 15, 5, 5, True);
SleepAndMoveMouse(2000 + random(2000));
fflag(0);
end;
end;
And add it to your mainloop.
Hi
Some of the Randoms in SRL are broken right now but will hopefully be fixed soon.
As far as I know tho FindGas is not in FindNormalRandoms; you have to call it seperately.
Open Scar, go to help, then Click SRL Manual and scroll down to Mining. You will find that Libarary to be extremely useful while scripting.
SCAR Code:procedure MineCoal;
var
FinishedRock:Boolean;
begin
if (FindColor ( x, y, AutoColorCoal, MSX1, MSY1, MSX2, MSY2)) then
FindPick;
if (not ( FindGas( x, y))) then
MMouse( x, y, 0, 0);
if (IsUpText( ' ine ' )) then
Mouse( x, y, 0, 0, false);
ChooseOption( ' ine ' );
Fixed the standards
But if I was you I would make FinishedRock a Seperate Function like:
SCAR Code:function FinishedRock : Boolean;
begin
if (IsBlackText ('The Text') then
Result := True;
end;
Something like that. That way you can just do:
SCAR Code:procedure MineCoal;
var
x, y : Integer
begin
if (FindColor ( x, y, AutoColorCoal, MSX1, MSY1, MSX2, MSY2)) then
FindPick;
if (not ( FindGas( x, y))) then
MMouse( x, y, 0, 0);
if (IsUpText( ' ine ' )) then
Mouse( x, y, 0, 0, false);
ChooseOption( ' ine ' );
Wait(RandomRange( 1000, 2000);
if (FinishedRock) then
begin
WriteLn('Mined Rock')
end else
WriteLn('Could Not Find Rock');
Logout;
Exit;
end;
Something like that.
you do need this
SCAR Code:Wait(RandomRange( 1000, 2000);
as NCDS put in there because if it lags, then it will get the last line before it started mining the new rock which would be "you have managed to mine some coal" or watever...
now i'm getting this error
Line 115: [Error] (17100:5): Unknown identifier 'IsBlackText' in script
SCAR Code:function FinishedRock : Boolean;
begin
if (IsBlackText ('You manage to mine some copper.') then//this is line 115
Result := True;
end;
Make sure you included SRL:
SCAR Code:{.include srl/srl.scar}
put that right underneath program name and put:
as the first thing in your mainloop.SCAR Code:SetUpSRL;
here you go
a bit oftopic but, on my memb app u said i should use TPa's? i'm not sure wut those r , and u said not to use ACA, i dont know what that is either
SCAR Code:program BarbVilleColorMinnerAndBanker;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/mining.scar}
const
directionToRun='E';
yourSRLID='5480';
yourSRLPW='gomo007';
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '0 vv n ag e'; //Your runescape username
Players[0].Nick := '0vv'; //3-4 letters from your username
Players[0].Pass := ''; //Your runescape password
Players[0].Booleans[0] := False; //Is your Pickaxe equiped?
Players[0].Active := True;
{
Players[1].Name := 'username'; //Your runescape username
Players[1].Nick := 'sern'; //3-4 letters from your username
Players[1].Pass := 'password'; //Your runescape password
Players[1].Strings[0] := false; //Is your PickAxe equiped?
Players[1].Active := True;
}
end;
procedure RanWait(Time : Integer);// Jacked From mormonman =P
var
StartTime : Integer;
begin
MarkTime(StartTime);
while (TimeFromMark(StartTime) < Time) do
begin
Wait(100);
FindNormalRandoms;
if FindFight then RunAway(DirectionToRun, False, 1, 5000+random(1000));
end;
end;
Procedure RandomCheck;
begin
FindNormalRandoms;
if FindFight then
begin
MakeCompass('n');
mouse(630, 154, 5, 5, True);
fflag(0);
SleepAndMoveMouse(15000+random(5000));
Mouse(630, 15, 5, 5, True);
SleepAndMoveMouse(2000 + random(2000));
fflag(0);
end;
end;
procedure DropAllExcept(A : Array of Integer);
var
i: Integer;
begin
For I:=1 To 28 Do
if not(InIntArray(a, i)) then
DropItem(i);
end;
function AutoColorCoal: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 2504504, MSX1, MSY1, MSX2, MSY2, 22);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the coal, no result.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 15.77) and (H <= 16.69) and (S >= 18.29) and (S <= 20.02) and (L >= 13.90) and (L <= 22.57) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 1.98) and (X <= 5.03) and (Y >= 2.22) and (Y <= 5.62) and (Z >= 1.47) and (Z <= 3.42) then
begin
Result := arC[i];
Writeln('AutoColorColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
Writeln('AutoColorCoal failed in finding the color.');
end;
function GameTabOn:boolean;
var
x,y:integer;
GameTabDTM:integer;
begin
GameTabDTM := DTMFromString('78DA63946262607800C45800238CD607CADF4' +
'7556365AA8BAA8615534D6E6220AA1A905DD751D5248679A0AA91' +
'04CA3F4755A3ABA381AA461B28FF0C558D89A136AA1A36A0FC0D5' +
'43595996198FE4253E3E6608AAA8605D3AE604F5B143500C5F50F' +
'8B');
if (FindDTM(GameTabDTM,x,y,51, 479,125, 502))then
begin
Mouse(x,y,0,0,true);
Result:=true;
exit;
end else
Result:=true;
Writeln('Game Tab was already set.');
exit;
end;
function FinishedRock : Boolean;
begin
if (IsBlackText ('You manage to mine some copper.') then//this is line 115
Result := True;
end;
procedure MineCoal;
var
x, y : Integer
begin
if (FindColor ( x, y, AutoColorCoal, MSX1, MSY1, MSX2, MSY2)) then
FindPick;
if (not ( FindGas( x, y))) then
MMouse( x, y, 0, 0);
if (IsUpText( ' ine ' )) then
Mouse( x, y, 0, 0, false);
ChooseOption( ' ine ' );
Wait(RandomRange( 1000, 2000);
if (FinishedRock) then
begin
WriteLn('Mined Rock')
end else
WriteLn('Could Not Find Rock');
Logout;
Exit;
end;
procedure SetupScript;
begin
SetupSrl;
ActivateClient;
if (not(LoggedIn)) the LogInPlayer;
MakeCompass('n');
SetAngle(true);
GameTabOn;
FindPickHeadColor;
end;
begin
SetupScript;
MineCoal;
end.
IsBlackText(Text: string; ChatLine: Integer).
Soooo you would be:
function FinishedRock : Boolean;
SCAR Code:begin
if IsBlackText('You manage to mine',8) then
Result := True;
end;
I do visit every 2-6 months
oops sorry, I didnt know you had to specify the Chatline.
SCAR Code:if not(IsBlackText ('You manage to mine some copper.', 1) then
if not(IsBlackText ('You manage to mine some copper.', 2) then
if not(IsBlackText ('You manage to mine some copper.', 3) then
if not(IsBlackText ('You manage to mine some copper.', 4) then
if not(IsBlackText ('You manage to mine some copper.', 5) then
if not(IsBlackText ('You manage to mine some copper.', 6) then
if not(IsBlackText ('You manage to mine some copper.', 7) then
if not(IsBlackText ('You manage to mine some copper.', 8) then
WriteLn('Could Not Find Text');
Result := False;
Exit
else
WriteLn('Found Text, Nice Job!');
Result := True;
end;
Something like that, there may be a way to search all 8 lines with the same search but im not sure.
I would not do that N C D S ALL 8 chat lines would have to say 'managed to mine copper'. What if someone said something, or u mined a gem?
I do visit every 2-6 months
yea i used that but i'm still getting the unknown identifier error for 'IsBlackText'
SCAR Code:Line 142: [Error] (17127:5): Unknown identifier 'IsBlackText' in script C:\SCAR 3.15\Scripts\BarbVilleCoalMinnerAndBanker.scar
function IsChatBlackTextAnyLine(ChatTxt: String): Boolean;
By: Wizzup?
Description:
Returns true if ChatTxt is found in any of the 8 lines in ChatBox.
try that Function instead then.
It would be:
SCAR Code:IsChatBlackTextAnyLine('text here');
and that one searches all lines
There are currently 1 users browsing this thread. (0 members and 1 guests)