Advertisement
Guest User

Untitled

a guest
May 6th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 8.64 KB | None | 0 0
  1. Program WalkLumbyToGrandExchange;
  2.  
  3. {$DEFINE SRL_SMART}
  4.   {.include SRL/SRL/Misc/Smart.scar}
  5.   {.include SRL/SRL.scar}
  6.   {.include SRL/SRL/misc/GrandExchange.scar}
  7.  
  8. Var x, y: Integer;
  9.  
  10. procedure DeclarePlayers;
  11. begin
  12.   HowManyPlayers := 1;   // How many Players to work with, Remember to fill in Their forms >.>
  13.   NumberOfPlayers(HowManyPlayers);
  14.   CurrentPlayer := 0;    // Start Player in Array , Default [0].
  15.  
  16.   with Players[0] do
  17.   begin
  18.     Name := '';              // Username
  19.     Pass := '';              // Password
  20.     Nick := '';              // Nickname. Example. Username : Sally. Nickname : ally. 4 Letters of the Username non capitilized.
  21.     Active := True;          // Leave as True if you plan on using this Character.
  22.     Pin := '';               // Bank have a Pin #? if not, leave blank, ''.
  23.     Booleans[0] := False;    // Are you a Member? False for Non-Member, True for Member.
  24.     Integers[0] := 19;       // World you want to log into. Please Keep in Mind that This World will be used for all Players.
  25.     Booleans[1] := True;     // Signed Client? True for Yes, False for No.
  26.     Booleans[2] := False;    // High Detail? Not Recommended. False for No , True for Yes.
  27.     Integers[1] := 10;       // Loads to Do.
  28.     Integers[2] := 3000;     // Time to Wait before Mining another Ore. 1000 Milliseconds := 1 Second.
  29.     Booleans[3] := False;    // Want This Character to PowerMine? (Mine Ores, Drop Them, Mine Ores, Drop Them, You get the Point)
  30.   end;
  31.  
  32. Procedure DeclarePlayers;
  33.   Begin
  34.    HowManyPlayers := 1;   // How many Players to work with, Remember to fill in Their forms >.>
  35.    NumberOfPlayers(HowManyPlayers);
  36.    CurrentPlayer := 0;    // Start Player in Array , Default [0].
  37.  
  38.    with Players[0] do
  39.    begin
  40.      Name        := ''; // Characters full RS username.
  41.      Pass        := ''; // Characters RS password.
  42.      Nick        := ''; // 3 non-caps letters of char's RS username.
  43.      Pin         := ''; // Bank Pin
  44.      Active      := True;
  45.      BoxRewards  := ['XP'];
  46.      Booleans[0] := True; //True if you want to sell, false if not.
  47.      Strings[0]  := '';  //Price: 'min', 'med', 'max', exact value.
  48.      Strings[1]  := ''; //'1', '10', '100', 'all', exact value.
  49.      Integers[0] := 0; //InvSpot: the Invspot where you have your item.
  50.      Booleans[1] := True; //True if you wan to buy, false if not
  51.      Strings[2]  := ''; //What (item name) has to be exact
  52.      Strings[3]  := ''; //Price: 'min', 'med', 'max', exact value
  53.      Strings[4]  := ''; //Quantity: '1', '10', '100', '1000', exact value
  54.     end;
  55.   End;
  56.  
  57.  
  58. {---------------------------------Start of: Functions from Charmz and Garrett, thanks---------------------------------}
  59. function GEScreen: Boolean;
  60. var
  61.   TPA: TPointArray;
  62.   B: TBox;
  63. begin
  64.   Result := False;
  65.  
  66.   FindColors(TPA, 39116, 205, 31, 315, 52);
  67.   if Length(TPA) < 5 then
  68.     Exit;
  69.  
  70.   B := GetTPABounds(TPA);
  71.   with B do
  72.     Result := Pos('Grand', GetTextAtEx(x1 - 1, y1 - 2, 0, UpChars, False, False, 0, 1, 39116, 20, False, tr_AllChars)) > 0;
  73. end;
  74.  
  75. function OpenGE: Boolean;
  76. var
  77.   C: TPointArray;
  78.   B: TBox;
  79.   C2D: T2DPointArray;
  80.   I, T: Integer;
  81. begin
  82.   if ( not LoggedIn ) then
  83.     Exit;
  84.   Result := False;
  85.  
  86.   ColorToleranceSpeed(2);
  87.   SetColorSpeed2Modifiers(0.10, 0.19);
  88.  
  89.   FindColorsTolerance(C, 3219751, MSX1, MSY1, MSX2, MSY2, 7);
  90.  
  91.   if Length(C) > 0 then
  92.     C2D := SplitTPA(C, 5)
  93.   else
  94.     Exit;
  95.   SortATPAFromFirstPoint(C2D, Point(MSCX, MSCY));
  96.  
  97.   for I := 0 to High(C2D) do
  98.   begin
  99.     if Length(C2D[I]) < 50 then
  100.       Continue;
  101.  
  102.     B := GetTPABounds(C2D[I]);
  103.     with B do
  104.       MMouse(RandomRange(x1, x2), RandomRange(y1, y2), 2, 2);
  105.  
  106.     //if ( not Pos('clerk', rs_GetUpText) > 0 ) then
  107.       //Continue;
  108.  
  109.     GetMousePos(x, y);
  110.     Mouse(x, y, 0, 0, False);
  111.     Result := FastChooseOption('ange Gra');
  112.  
  113.     if Result then
  114.       Break;
  115.   end;
  116.  
  117.   if Result then
  118.   begin
  119.     T := GetSystemTime;
  120.     while ( GetSystemTime - T < 10000 ) and
  121.           ( not GEScreen ) do
  122.       Wait(50 + Random(100));
  123.   end;
  124.   Result := GEScreen;
  125. end;
  126.  
  127. Function WalkTPA(C1, C2, XM, YM, XR, YR : Integer; SortPoint : TPoint) : Boolean;     //thanks to 3Garrett3
  128. Var
  129.  TPA: TPointArray;
  130.  TDPA: T2DPointArray;
  131.  I, CTS, H, X, Y: Integer;
  132. Begin
  133.  If Not LoggedIn Then Exit;
  134.  cts := GetColorToleranceSpeed;
  135.  ColorToleranceSpeed(2);
  136.  SetColorspeed2Modifiers(0.10, 25);
  137.  FindColorsSpiralTolerance(MMCX, MMCY, TPA, C1, MMX1, MMY1, MMX2, MMY2, 7);
  138.  If Length(TPA) = 0 Then
  139.   FindColorsSpiralTolerance(MMCX, MMCY, TPA, C2, MMX1, MMY1, MMX2, MMY2, 7);
  140.  TDPA := TPAtoATPAEx(TPA, 20, 20);
  141.  SortATPAFromFirstPoint(TDPA, SortPoint);
  142.  H := High(TDPA);
  143.  For i := 0 To H Do
  144.  Begin
  145.   MiddleTPAEx(TDPA[i], x, y);
  146.   If rs_OnMinimap(x,y) Then
  147.   Begin
  148.    MouseFlag(x + XM, y + YM, XR, YR, 0);
  149.    Result := True;
  150.    Wait(200 + Random(80));
  151.    ColorToleranceSpeed(cts);
  152.    Exit;
  153.   End;
  154.  End;
  155.  Result := False;
  156.  ColorToleranceSpeed(cts);
  157. End;
  158.  
  159. {---------------------------------End of: Functions from Charmz and Garrett, thanks---------------------------------}
  160.  
  161. procedure CheckLumb;
  162. var
  163. x,y: integer;
  164. begin
  165.  If Not LoggedIn Then Exit;
  166.   If not FindSymbolIn(x, y, water,  MMX1, MMY1, MMX2, MMY2) then   //checking if in lumb
  167.    gametab(magic_tab);
  168.    Mouse(572, 230, 3, 3, true); // teleporting til lumb, becouse you aren't there
  169.    wait(20000+random(5000));
  170.    If not FindSymbolIn(1, 1, water,  MMX1, MMY1, MMX2, MMY2) then  //if still not in lumb, then fail, logging
  171.     WriteLn('Something went wrong, youre either not in lumb, or doesnt have a hometeleport ready.');
  172.     exit;
  173. end;
  174.  
  175. Procedure WalkLumbToGoblinhut;
  176. begin
  177.  If Not LoggedIn Then Exit;
  178.   WalkTPA(1336112, 1004832,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  179.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  180.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  181.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  182.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  183.   //Get some failsafes and checks
  184. end;
  185.  
  186. Procedure WalkGoblinhutToAlkaridEntrance;
  187. begin
  188.  If Not LoggedIn Then Exit;
  189.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  190.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  191.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  192.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  193.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  194.   //Get some failsafes and checks
  195. end;
  196.  
  197. Procedure WalkAlkaridEntranceToVarrockSouthGate;
  198. begin
  199.  If Not LoggedIn Then Exit;
  200.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  201.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  202.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  203.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  204.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  205.   //Get some failsafes and checks
  206. end;
  207.  
  208. Procedure WalkVarrockSouthGateToGrandExchange;
  209. begin
  210.  If Not LoggedIn Then Exit;
  211.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  212.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  213.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  214.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  215.   WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
  216.   //Get some failsafes and checks
  217. end;
  218.  
  219. procedure UseGE;
  220. begin
  221. If not GEScreen:=true then
  222.  begin
  223.   writeln('Couldnt open GE')
  224.   exit;
  225.  end else
  226.   if Players[CurrentPlayer].Booleans[0]=true then
  227.    GESell(Strings[0], Strings[1], Integers[0]);
  228.     if GESell:=true then
  229.      writenl('Succesfully trying to sell items');
  230.     else
  231.      writenl('Couldnt set up the items for sale');
  232.     if Players[CurrentPlayer].Boolean[1]=true then
  233.      GEBuy(Strings[2], Strings[3], Strings[4]);
  234.       if GEBuy:=true then
  235.        writenl('Succesfully trying to buy items');
  236.       else
  237.        writenl('Coulndt set up the items for sale');
  238. end.
  239.  
  240. Procedure SetUpScript;
  241. Begin
  242.   {$IFDEF SRL_SMART}
  243.   Smart_Server := World;
  244.   Smart_Members := False;
  245.   Smart_Signed := False;
  246.   Smart_SuperDetail := False;
  247.   {$ENDIF}
  248.   SetUpSRL;
  249.   DeclarePlayers;
  250. End;
  251.  
  252. Procedure SetUpPlayer;
  253. Begin
  254.   LogInPlayer;
  255.   FindNormalRandoms;
  256.   If (Not LoggedIn) Then Exit;
  257.   SetRun(True);
  258.   SetAngle(True);
  259.   MakeCompass('N');
  260. End;
  261.  
  262. Procedure MainLoop;
  263. Begin
  264.   SetUpScript;
  265.   SetupPlayer;
  266.   CheckLumb;
  267.   WalkLumbToGoblinhut;
  268.   WalkGoblinhutToAlkharidEntrance;
  269.   WalkAlkharidEntranceToVarrockSouthGate;
  270.   WalkVarrockSouthGateToGrandExchange;
  271.   UseGE;
  272.   Logout;
  273. End;
  274.  
  275. Begin
  276. MainLoop;
  277. End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement