cradlefatal
2013-03-07 20:54:17
can someone show me to a code for Click if Uptext I tried using MMmouse left click it didn't work I got my colors in for the bank in taverley this is my script so far I'm not really sure how to make it if find uptext counter then leftclick mouse
program The_Walker;
{$DEFINE SMART8}
{$I SRL\SRL.simba}
{$I SRL\SRL\misc\Debug.simba}
{$I Srl/Srl/Skill/Mining.Simba}
{$I Srl/Srl/Skill/Crafting.Simba}
{$I SRL\SRL\Misc\smartgraphics.simba}
{$I sps/sps.simba}
{$i ObjectDTM\ObjDTMInclude.simba}
CONST
Version = '1.0';
Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; // Player username
Pass := ''; // Player password
Active := True;
end;
End;
Procedure BasicSetup;
Var
LastPainted, StartTime: Integer;
Begin
Smart_FixSpeed:=True;
SRL_SixHourFix:=True;
SetupSRL;
ObjDTM_Setup;
MarkTime(LastPainted);
MouseSpeed:=50;
DeclarePlayers;
StartTime:=GetSystemTime;
LoginPlayer;
Wait(1500);
If (TimeFromMark(StartTime) > 120000) Then
SelectWorld(RandomWorld(Players[0].Member,True));
End;
Procedure PrepTime;
Begin
LodestoneTeleport('Taverley');
Writeln('porting now');
Wait(8000);
Writeln('wait time for portal');
SPS_Setup(RUNESCAPE_SURFACE,['11_7','11_6','10_6','10_7','12_7','12_6']);
SPS_GetMyPos;
Writeln('checking location');
MakeCompass('S');
GameTab(tab_inv);
End;
procedure SettheAngle(Angle: Integer);
begin
if ((Angle = SRL_ANGLE_NONE) or (not LoggedIn)) then
Exit;
KeyDown((Angle * 2) + 38);
Sleep(1000 + Random(300));
KeyUp((Angle * 2) + 38);
Wait(500 + Random(100));
end;
function BankCounter(var cx, cy: Integer): Boolean;
var
arP: TPointArray;
ararP: T2DPointArray;
tmpCTS, i, arL: Integer;
P: TPoint;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00, 2.07);
if not(FindColorsTolerance(arP, 12378593, MSX1, MSY1, MSX2, MSY2, 17)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
SortTPAFrom(arP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arP, 10, 10);
arL := High(ararP);
for i := 0 to arL do
begin
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Counter')) then
begin;
Result := True;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Writeln('FindObject could not find object.');
Exit;
end;
GetMousePos(cx, cy);
end;
Procedure My_Path1;
Var
WalkTime, cx, cy: Integer;
Begin
If not LoggedIn then Exit;
MarkTime(WalkTime);
SPS_GetMyPos;
begin
If (ObjDTM_Find('90:79:5:0:7:142:47:0:7:88:31:1:7:120:29:3:7:106:96:3:7:102:121:6:81:46:110:48:112:75:72:154:53:68:66:48', cx, cy, True)) Then
Writeln('In Edgeville');
If (ObjDTM_Find('80:80:5:0:7:87:32:0:7:141:47:1:7:119:31:3:7:106:96:3:7:102:120:5:45:48:107:49:101:127:64:125:60:98', cx, cy, True)) Then
Writeln('Lodestone 2nd Attempt');
If (ObjDTM_Find('80:80:5:0:7:139:44:0:7:87:29:1:7:118:28:3:7:105:91:3:7:101:115:5:89:148:109:43:46:47:48:85:65:100', cx, cy, True)) Then
Writeln('Lodestone Found on 3rd try');
If (ObjDTM_Find('80:80:5:0:7:134:48:0:7:83:34:1:7:113:32:3:7:101:95:3:7:97:118:3:46:55:104:55:91:123', cx, cy, True)) Then
Writeln('Wow Finally found the Lodestone 4th try');
If (ObjDTM_Find('80:80:4:3:7:96:118:3:7:100:95:1:7:112:33:0:7:83:35:4:48:53:102:54:79:151:49:83', cx, cy, True)) Then
Writeln('Found Lodestone on 5th Attempt')
Else
Begin
Writeln('Unable to locate starting point, Starting over');
MakeCompass('S');
end;
end;
begin
If (ObjDTM_Walk('103:107:3:1:7:90:48:2:7:25:125:10:7:126:92:3:82:81:78:134:122:130', 2, 100, 5, True)) Then
Writeln('Walking to Bank');
If (ObjDTM_Walk('75:127:3:1:7:66:27:10:7:66:102:10:7:102:69:3:80:79:62:133:101:146', 2, 100, 5, True)) Then
Writeln('made it to point B');
If (ObjDTM_Walk('46:111:4:1:7:68:119:1:7:84:127:10:7:97:131:10:7:97:103:5:79:84:47:99:44:124:50:122:56:117', 2, 100, 5, True)) Then
Writeln('point c');
begin
Writeln('Made it to the Bank');
end;
end;
End;
Begin
BasicSetup;
PrepTime;
My_Path1;
End.