From: embowled
Hi, could i have your help wth something? I'm trying to fix this error of code,
"x, y, pickpocketbmp, loginscreenbmp, steals, xpgained, TimesStunned, relogs, Is_Relogger, Gems, bankbmp:Integer; status, NpcString, username, password:string;
Error: Duplicate declaration "status" at line 6
Compiling failed.
"
Do you know what's wrong?
Thank you.
Sometime inbetween when this script was posted and the time you posted this SRL-OSR was updated and the 'status' variable was added (for reasons unknown to me, anyway this means you can't use status as a variable anymore)
So I changed 'status' to state, I have no idea if there are any other errors but that should fix that particular one
program Going_For_Gems_V1_5;
{$i srl-osr/srl.simba}
var
How_long_break, Break_gem_randomizer, Randomizer_for_break, dim_x, dim_y, Break_Rate, Gems_collected_before_break, x, y, g, l, a, b, d, f, c, pickpocket_rate, timer_fgs, normal_mode, previous_invcount, h, i, login, pixel_check_rate, pixel_stop_rate, tol_for_all_gems, sapphire, emerald, ruby, diamond, dragonstone, walkbb, myname, rotatecameraforgemstall, gandalf, clickbanker, yellowbankermap, bankpack, baloginckloginscreen, clickbacktostall, walkbb2, roadtoafk, afterimoved, walkbb3, walkbb4, GemH, InvH, ForceResets, inv_x, inv_y, Gem, relog, xp_dropped_too_hard, total_xp_gained, sapphire_xp, emerald_xp, ruby_xp, diamond_xp, dragonstone_xp, Black_Ibis_full_xp, double_xpp, main_gem_xp, xp_h, remember_to_change_compass_angle, stall_color: Integer;
username, state, status_movement, password, info: String;
numberss, gemstall_colors: TIntegerArray;
aFound: Extended;
PlayerBox: TBox;
TPA: TPointArray;
ATPA: T2DPointArray;
Black_Ibis_full, Human_Mouse, Double_Xp, Enable_Breaks, Log_out_during_break, Enable_animation_checking: Boolean;
Procedure load_once;
begin
username := ('');
password := ('');
//1. Stall pickpocketing settings
pickpocket_rate := (710); // change this higher if script clicks stall too fast and you dont receive any gems.
//2. For correct XP counting.
Black_Ibis_full := True; // for XP counting, True = Yes, False = No
Double_Xp := False;
//3. Mouse movements...
Human_Mouse := False; // might make misclicks in TRUE]
// Minimap icon clicking colors
SetLength(numberss, 7);
numberss := [85, 2566646, 130, 2566646, 398826, 6908401, 6908401]
// Gem stall colors
SetLength(gemstall_colors, 4);
gemstall_colors := [3541648, 3082622, 3541648, 3082622]
// ************************************************************************* //
if Human_Mouse = True then
begin
MouseSpeed := 32;
end else
MouseSpeed := 1105;
if Black_Ibis_full = True then
begin
Black_Ibis_full_xp := 40;
end else
Black_Ibis_full_xp := 0;
if Double_Xp = True then
begin
double_xpp := 2;
end else
double_xpp := 1;
main_gem_xp := 1000;
end;
procedure LoadBitmapsAndDtms;
begin
////////////////////////////////////////////////////////////////////////////////
login := BitmapFromString(153, 13, 'meJztlrEOAUEQhvc5aCQKCgoqr' +
'ZZWwTucl9HoFBSiUKAQIXIqVAoi8QYewyaTTC53uzsTucvcJrf5Ij' +
'f/7j+5mz+O4P0NKMYF0pAZaYbXD8moQBpOTL5EqZTKoics8adLJcp' +
'e+CTpX17i6IEPNmFGbbPonC6cmLqHhxfAzG1buGx6bMvYFs64z+eZ' +
'zvZGs7uLAzM36voTvlkaKI26zY46JIgubJULGDG1ViFJOwfAzEkdS' +
'5vusOPL1m0RgRNTY3kmaeYAGCypY2nTHXamRQROTLX5kaS+OIkDgy' +
'V1LG26w860iMCJqTrbewEMltSxjOrwI0jaba18oTLdeoFKLOOWLvX' +
'8Yzpco540Yhk9Y7QUpAL+HUWMW0aLLZeYK2kXf2o+pcmapOw/EKX4' +
'bfwNJ6YfpX2UPQ==');
myname := BitmapFromString(69, 10, 'meJzdldtKQlEQhn2j6l16gG56gG' +
'6EKOxEUQQqWASRFuqmlExRo9NF0Wv0Mv3ub/s37C3RdYth+Jk1iz3' +
'fnnUo11uVq37lslcqlXauhzKJzYvbUjqIOE4EsdUcbLceDpKptLzs' +
'5O5Zutp/QRwlExla3ppRG7wpU8YsxnKC9dGHg9Kra+tfv44kSZaWV' +
'8r1lgrbqDYjDtU6KC1x2B4z67Tdm5GMyvVda4Q8FBQMuChicCGOci' +
'RO00yB/AUnSYdw4s+PYr87kUnLE5Q4vn2KXEedi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d929YUMiHA01XEiYdOv7G0oRQrMZA7eXa3zq9gnxBMq' +
'/87CICnZeKol3G4laTr8FTjYCanRtfUHwj5osQxQZDw6z9C0cgqPI' +
'Mgy/IWgdIhm6EKPjr/WMgTQKbt5eDOkaSzL8g2Xoo+NMfZK0zkCj2' +
'h7Ih1HgHgzwUGwkDuSvyINRDUQKmLgBkByTZPJg/sd54ovA1GR7kp' +
'rjrstaxebGE0OAZxQMq7tbRMBV5WDbhiKMnAyLgw+cB+UofVsk+f2' +
'ze1I8YBOIWbVYaw0vm0qA1skUGAjo+ZTKZwk5NoF/2LlPv');
end;
procedure FreeBitmapsAndDtms;
begin
FreeBitmap(login);
FreeBitmap(myname);
FreeBitmap(gandalf);
FreeBitmap(bankpack);
end;
Function right_client_h_n_w: Boolean;
begin
if dim_x = 765 then
if dim_y = 503 then
begin
Result := True;
end;
end;
procedure progress;
var
GemI: Integer;
begin
GemH := round((Gem)/(gettimerunning/3600000.0));
GemI := round(Gem/28);
InvH := round((GemI)/(gettimerunning/3600000.0));
xp_h := round((total_xp_gained) / (gettimerunning/3600000.0));
Cleardebug;
Writeln(' Villaa´s Going For Gems V1.5+ [' + ('Current Count = ' + inttostr(roadtoafk) + ('/42] ' + ('[Force Resets: ' + inttostr(ForceResets)+ ('] [' + inttostr(timer_fgs) + ']')))));
if right_client_h_n_w = True then
begin
Writeln('+ Correct client width and height');
end else
Writeln('- Incorrect client width and height, may not work properly');
writeln('* Time Running: ' + MsToTime(GetTimeRunning,3) + (' [') + ('Login Count: ') + inttostr(relog) + (']') );
writeln('* Gems Gathered: ' + inttostr(Gem) + (' [') + inttostr(GemH) + '/hour]' + (' Inventories Done: ' + inttostr(GemI) + (' [') + inttostr(InvH) + ('/Hour]') ));
Writeln('* Xp Gained: ' + inttostr(total_xp_gained) + (' [') + inttostr(xp_h) + '/XP hour]');
Writeln('');
Writeln('* Script: ' + (state));
Writeln('* Movement: ' + (status_movement));
Writeln('');
Writeln('To stop this script, hold down F12.');
end;
procedure show_settings_info;
begin
i := 5;
Repeat
Cleardebug;
Writeln(' * Settings');
Writeln(' * Script starting in: ' + inttostr(i) );
Writeln('');
if username = '' then
begin Writeln(' - Username: Not set'); end else Writeln(' + Username: Set');
if password = '' then
begin Writeln(' - Password: Not set'); end else Writeln(' + Password: Set');
Writeln(' * Human_Mouse: ' + booltostr(Human_Mouse) );
Writeln(' * Stall colors: [' + inttostr(gemstall_colors[0]) + ', ' + inttostr(gemstall_colors[1]) + ', ' + inttostr(gemstall_colors[2]) + ', ' + inttostr(gemstall_colors[3]) + ']');
Writeln(' * Minimap icon colors: [' + inttostr(numberss[0]) + ', ' + inttostr(numberss[1]) + ', ' + inttostr(numberss[2]) + ', ' + inttostr(numberss[3]) + ', ' + inttostr(numberss[4]) + ', ' + inttostr(numberss[5]) + ', ' + inttostr(numberss[6]) + ']');
wait(1000);
i := i-1;
Until(i <= 0);
end;
Function find_gemstall: Boolean;
begin
if FindColorTolerance(x, y, gemstall_colors[0], 1, 5, 514, 337, 2) or
FindColorTolerance(x, y, gemstall_colors[1], 1, 5, 514, 337, 2) or
FindColorTolerance(x, y, gemstall_colors[2], 9, 11, 508, 330, 2) or
FindColorTolerance(x, y, gemstall_colors[3], 4, 11, 508, 330, 2) then
begin
if InvCount = 0 then
begin
Mmouse(x, y, 0, 0);
wait(150);
if IsUpText('eal') then
begin
Result := True;
end;
end else
begin
Result := True;
timer_fgs := 0;
end;
end;
end;
{//FindColorsSpiralTolerance(MSCX, MSCY, TPA, 10451353, MSX1, MSY1, MSX2, MSY2, 5);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, stall_color, MSX1, MSY1, MSX2, MSY2, 5);
//FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3082622, MSX1, MSY1, MSX2, MSY2, 5);
ATPA := TPAtoATPA(TPA, 25);
If Length(ATPA) = 0 Then //If no points were found
Exit;
H := High(ATPA);
For I := 0 To H Do
Begin
MiddleTPAEx(ATPA[I], X, Y); //Used to get the middle of the current sorted tpa
MMouse(X, Y, 0, 0);
//Wait(50 + Random(50));
if IsUpTextMultiCustom(['Stea', 'l-fro', 'em', 'Gem']) then
Begin
Result := True;
if timer_fgs >= 1 then
begin
timer_fgs := 0;
end;
end;
end;
end; }
Function Is_Running: Boolean;
begin
Result := (AveragePixelShift(PlayerBox, pixel_check_rate, pixel_stop_rate) > 120);
end;
Function Is_Thieving: Boolean;
begin
Result := (AveragePixelShift(PlayerBox, 250, 2500) > 85);
end;
Function Logged_Out: Boolean;
begin
if (FindBitmap(login, x, y)) then
Result := True;
end;
Function usernamepasswordfilled: Boolean;
begin
if FindColorTolerance(a, b, 12378347, 276, 177, 345, 198, 5) then
begin
if FindColorTolerance(a, b, 12378347, 278, 226, 377, 241, 5) then
begin
if FindColorTolerance(c, d, 3320256, 296, 269, 464, 283, 3) or
FindColorTolerance(c, d, 4044234, 296, 269, 464, 283, 3) then
Result := True;
begin
Mouse(c, d, 0, 0, mouse_left);
wait(4600+random(250)+random(150));
end;
end;
end;
end;
Function Run_energy: Boolean;
begin
if FindColorTolerance(a, b, 65024, 736, 103, 758, 118, 3) or
FindColorTolerance(a, b, 65278, 736, 103, 758, 118, 3) or
FindColorTolerance(a, b, 2004990, 736, 103, 758, 118, 3) then
begin
if FindColorTolerance(c, d, 48875, 713, 98, 732, 120, 3) then
begin
Result := True; // run on
end else
Result := False; // run off
end;
end;
Function after_5_years: Boolean;
begin
if FindColorTolerance(c, d, 1127265, 381, 299, 413, 321, 2) then
Result := True;
end;
Function iseenoyellow: Boolean;
begin
if FindColorTolerance(x, y, 64250, 546, 7, 692, 166, 4) then // if find yellow dot
Result := True;
end;
Function bankscreenn: Boolean;
begin
if FindColorTolerance(c, d, 1127265, 381, 299, 413, 321, 2) then
Result := True;
end;
Function FindStall: Boolean;
begin
if FindSymbol(g, l, 'gem stall') then
begin
if FindColorSpiralTolerance(g, l, numberss[0], 540, 1, 703, 167, 3) or
FindColorSpiralTolerance(g, l, numberss[1], 540, 1, 703, 167, 3) or
FindColorSpiralTolerance(g, l, numberss[3], 540, 1, 703, 167, 3) or
FindColorSpiralTolerance(g, l, numberss[3], 540, 1, 703, 167, 3) or
FindColorSpiralTolerance(g, l, numberss[4], 540, 1, 703, 167, 3) or
FindColorSpiralTolerance(g, l, numberss[5], 540, 1, 703, 167, 3) or
FindColorSpiralTolerance(g, l, numberss[6], 540, 1, 703, 167, 3) then
begin
Result := True;
end;
end else
Exit;
end;
Function Gemstole: Boolean;
begin
if InvCount <= 27 then
begin
if find_gemstall then
begin
state := ('Thieving gems, hopefully i dont get stuck when i¨ll try find banker on my journey.');
progress();
previous_invcount := InvCount;
if clickbacktostall >= 1 then
clickbacktostall := 0;
MoveMouse(x, y);
ClickMouse(x, y, Mouse_left);
wait(pickpocket_rate);
InvCount();
if remember_to_change_compass_angle >= 1 then
begin
Mouse(541 + random(3), 23 + random(3), 0, 0, mouse_left);
wait(300+random(300));
wait(500);
KeyDown(37);
wait(1500);
KeyUp(37);
KeyDown(38);
wait(600);
KeyUp(38);
remember_to_change_compass_angle := 0;
end;
end else
if not find_gemstall then
if InvCount <= 27 then
if not Is_Running then
if clickbacktostall < 1 then
begin
//for i := 0 to High(numberss) do
FindStall();
begin
state := ('Running / Walking back to stall');
progress();
MoveMouse(g+random(1), l-random(1));
ClickMouse(g+random(1), l-random(1), mouse_left);
clickbacktostall := clickbacktostall+2;
roadtoafk := 0;
end;
end else
state := ('I cant find stall [Colors/Dtms/Uptexts]');
progress();
timer_fgs := timer_fgs+1;
wait(1000);
if clickbacktostall >= 2 then
if not find_gemstall then
if timer_fgs >= 10 then
begin
Repeat
remember_to_change_compass_angle := remember_to_change_compass_angle+1;
KeyDown(37);
wait( 150 + random(200));
KeyUp(37);
wait( 150 + random(200));
Until((find_gemstall = True) or IsKeyDown(123));
end;
end;
end;
Function Bank: Boolean;
begin
if InvCount > 27 then
begin
if clickbanker < 1 then
if InvCount = 28 then
if bankscreenn = false then
if FindObjCustom(a, b, ['talk', 'tal', 'alk', '-to'], [1983823, 1587520, 1719365], 2) then
begin
if clickbanker < 1 then
begin
Mouse(a, b, 0, 0, mouse_right);
begin
if FindBitmapToleranceIn(gandalf, d, f, 1, 1, 533, 410, 175) then
begin
if clickbanker < 1 then
movemouse(d, f);
clickmouse(d, f, mouse_left);
clickbanker := clickbanker+2;
end else
begin
Mmouse(random(380), random(380), 1, 1);
wait(random(2));
Mmouse(random(180), random(180), 10, 10);
if yellowbankermap < 1 then
if FindColorTolerance(x, y, 64250, 546, 7, 692, 166, 4) then // if find yellow dot
begin
Mouse(x+random(1), y+random(1), 0, 0, mouse_left);
yellowbankermap := yellowbankermap+2;
end;
end;
end;
end;
end else
if InvCount > 27 then
begin
if after_5_years = false then
if FindColorTolerance(x, y, 64250, 546, 7, 692, 166, 4) then // if find yellow dot
begin
if yellowbankermap < 1 then
Mouse(x+random(1), y+random(1), 0, 0, mouse_left); // click yellow dot
yellowbankermap := yellowbankermap+2;
afterimoved := afterimoved+2;
//wait(1750)+random(300)); // 4000
end else
begin
if afterimoved > -1 then
if yellowbankermap < 1 then
if bankscreenn = false then
begin
Mouse(633, 45, 1, 1, mouse_left);
end;
end;
end;
// I JUST MANAGED OPEN THE DAMN BANK
begin
if InvCount > 27 then
begin
if FindColorTolerance(c, d, 1127265, 381, 299, 413, 321, 3) then
begin
Mouse(c, d, 0, 0, mouse_left);
if clickbanker > 1 then //reset clickbanker
clickbanker := 0;
if yellowbankermap > 1 then //reset yellowmapclickbanker
yellowbankermap := 0;
if afterimoved > 1 then
afterimoved := 0;
if remember_to_change_compass_angle >= 1 then
remember_to_change_compass_angle := 0; // bankall // click bank all
wait(600); // was 775
end else
begin
state := ('if i get stuck here make sure you play on "Software" or manually 318 line');
progress();
end;
end;
end;
end;
end;
procedure timerforresetting;
begin
if FindColorTolerance(x, y, 7082254, 693, 436, 717, 455, 4) or //s // Checks inv
FindColorTolerance(x, y, 1008909, 693, 436, 717, 455, 4) or //e // for
FindColorTolerance(x, y, 725334, 693, 436, 717, 455, 4) or //r // gems
FindColorTolerance(x, y, 9145490, 693, 436, 717, 455, 4) or //dia
FindColorTolerance(x, y, 6229062, 693, 436, 717, 455, 4) then //drag // GEMS
begin
roadtoafk := roadtoafk +1;
wait(10);
if roadtoafk >= 42 then
begin
Writeln('Force Reset Incoming');
if rotatecameraforgemstall >= 1 then
rotatecameraforgemstall := 0;
if clickbacktostall >= 1 then
clickbacktostall := 0;
if clickbanker >= 1 then //reset clickbanker
clickbanker := 0;
if afterimoved >= 1 then
afterimoved := 0;
if yellowbankermap >= 1 then //reset yellowmapclickbanker
yellowbankermap := 0;
if roadtoafk >= 1 then
roadtoafk := 0;
ForceResets := ForceResets+1;
state := ('Succesfully Reseted All Values to 0');
end;
end;
end;
procedure thiev;
begin
if usernamepasswordfilled = false then
begin
if (Logged_Out) = true then
begin
if FindColorTolerance(x, y, 1710623, 273, 155, 488, 179, 6) or
FindColorTolerance(x, y, 2960695, 273, 155, 488, 179, 6) then
begin
MMouse(x, y, 1, 1);
Mouse(x, y, 1, 1, mouse_left);
wait(400+random(250)+random(150));
Typesend(Username);
wait(400+random(250)+random(150));
Typesend(Password);
if rotatecameraforgemstall > 1 then
rotatecameraforgemstall := 0;
if clickbacktostall > 1 then
clickbacktostall := 0;
if clickbanker > 1 then //reset clickbanker
clickbanker := 0;
if yellowbankermap > 1 then //reset yellowmapclickbanker
yellowbankermap := 0;
if remember_to_change_compass_angle >= 1 then
remember_to_change_compass_angle := 0;
wait(4600+random(250)+random(150));
relog := relog+1;
end;
end;
end else
begin
if FindColorTolerance(x, y, 3556431, 305, 323, 451, 335, 3) or
FindColorTolerance(x, y, 7311264, 305, 323, 451, 335, 3) then
begin
if rotatecameraforgemstall > 1 then
rotatecameraforgemstall := 0;
if clickbacktostall > 1 then
clickbacktostall := 0;
if clickbanker > 1 then //reset clickbanker
clickbanker := 0;
if yellowbankermap > 1 then //reset yellowmapclickbanker
yellowbankermap := 0;
if remember_to_change_compass_angle >= 1 then
remember_to_change_compass_angle := 0;
Mouse(x, y, 0, 0, mouse_left);
wait(500+random(800)+random(600));
if FindColorTolerance(a, b, 12378347, 276, 177, 345, 198, 5) then
begin
if FindColorTolerance(a, b, 12378347, 278, 226, 377, 241, 5) then
begin
if FindColorTolerance(c, d, 3320256, 296, 269, 464, 283, 3) or
FindColorTolerance(c, d, 4044234, 296, 269, 464, 283, 3) then
begin
Mouse(c, d, 0, 0, mouse_left);
wait(4600+random(250)+random(150));
end;
end;
end;
end;
end;
begin
if (Logged_Out) = false then
/////////////////////////////////////////////////////////////////////////////////
begin
if rotatecameraforgemstall < 1 then
begin
rotatecameraforgemstall := rotatecameraforgemstall+2;
if FindColorTolerance(x, y, 12044755, 538, 12, 552, 32, 5) then
Mouse(x, y, 0, 0, mouse_left);
wait(300+random(300));
wait(500);
KeyDown(37);
wait(1500);
KeyUp(37);
KeyDown(38);
wait(600);
KeyUp(38);
end;
//if rotatecameraforgemstall > 1 then
//////////////////////////////////////////////////////////////////////////////CHAPTER 2
end;
end;
begin
if usernamepasswordfilled = false then
begin
if Logged_Out = false then
begin
if not Run_energy then
if FindColorTolerance(x, y, 10202292, 713, 95, 730, 115, 3) then
begin
Mouse(x, y, 0, 0, mouse_left);
wait(500 + random(500));
end;
Gemstole;
Bank;
end;
end;
end;
end;
begin
GetClientDimensions(dim_x, dim_y);
pixel_check_rate := 50;
pixel_stop_rate := 500;
PlayerBox := IntToBox(254, 140, 275, 187);
load_once;
show_settings_info;
repeat
if Is_Running = True then
begin
status_movement := ('True');
end else
status_movement := ('False');
if InvCount > previous_invcount then
begin
IncEx(gem, 1);
total_xp_gained := ((total_xp_gained + main_gem_xp + Black_Ibis_full_xp) * double_xpp);
previous_invcount := InvCount();
progress();
end;
LoadBitmapsAndDtms;
timerforresetting;
progress;
/////////////////////////////////
thiev; //
/////////////////////////////////
FreeBitmapsAndDtms;
wait(50); // Higer = less CPU = slower script, Less = more CPU = faster script .70. was 120
until(IsKeyDown(123));
end.