Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program WalkLumbyToGrandExchange;
- {$DEFINE SRL_SMART}
- {.include SRL/SRL/Misc/Smart.scar}
- {.include SRL/SRL.scar}
- {.include SRL/SRL/misc/GrandExchange.scar}
- Var x, y: Integer;
- procedure DeclarePlayers;
- begin
- HowManyPlayers := 1; // How many Players to work with, Remember to fill in Their forms >.>
- NumberOfPlayers(HowManyPlayers);
- CurrentPlayer := 0; // Start Player in Array , Default [0].
- with Players[0] do
- begin
- Name := ''; // Username
- Pass := ''; // Password
- Nick := ''; // Nickname. Example. Username : Sally. Nickname : ally. 4 Letters of the Username non capitilized.
- Active := True; // Leave as True if you plan on using this Character.
- Pin := ''; // Bank have a Pin #? if not, leave blank, ''.
- Booleans[0] := False; // Are you a Member? False for Non-Member, True for Member.
- Integers[0] := 19; // World you want to log into. Please Keep in Mind that This World will be used for all Players.
- Booleans[1] := True; // Signed Client? True for Yes, False for No.
- Booleans[2] := False; // High Detail? Not Recommended. False for No , True for Yes.
- Integers[1] := 10; // Loads to Do.
- Integers[2] := 3000; // Time to Wait before Mining another Ore. 1000 Milliseconds := 1 Second.
- Booleans[3] := False; // Want This Character to PowerMine? (Mine Ores, Drop Them, Mine Ores, Drop Them, You get the Point)
- end;
- Procedure DeclarePlayers;
- Begin
- HowManyPlayers := 1; // How many Players to work with, Remember to fill in Their forms >.>
- NumberOfPlayers(HowManyPlayers);
- CurrentPlayer := 0; // Start Player in Array , Default [0].
- with Players[0] do
- begin
- Name := ''; // Characters full RS username.
- Pass := ''; // Characters RS password.
- Nick := ''; // 3 non-caps letters of char's RS username.
- Pin := ''; // Bank Pin
- Active := True;
- BoxRewards := ['XP'];
- Booleans[0] := True; //True if you want to sell, false if not.
- Strings[0] := ''; //Price: 'min', 'med', 'max', exact value.
- Strings[1] := ''; //'1', '10', '100', 'all', exact value.
- Integers[0] := 0; //InvSpot: the Invspot where you have your item.
- Booleans[1] := True; //True if you wan to buy, false if not
- Strings[2] := ''; //What (item name) has to be exact
- Strings[3] := ''; //Price: 'min', 'med', 'max', exact value
- Strings[4] := ''; //Quantity: '1', '10', '100', '1000', exact value
- end;
- End;
- {---------------------------------Start of: Functions from Charmz and Garrett, thanks---------------------------------}
- function GEScreen: Boolean;
- var
- TPA: TPointArray;
- B: TBox;
- begin
- Result := False;
- FindColors(TPA, 39116, 205, 31, 315, 52);
- if Length(TPA) < 5 then
- Exit;
- B := GetTPABounds(TPA);
- with B do
- Result := Pos('Grand', GetTextAtEx(x1 - 1, y1 - 2, 0, UpChars, False, False, 0, 1, 39116, 20, False, tr_AllChars)) > 0;
- end;
- function OpenGE: Boolean;
- var
- C: TPointArray;
- B: TBox;
- C2D: T2DPointArray;
- I, T: Integer;
- begin
- if ( not LoggedIn ) then
- Exit;
- Result := False;
- ColorToleranceSpeed(2);
- SetColorSpeed2Modifiers(0.10, 0.19);
- FindColorsTolerance(C, 3219751, MSX1, MSY1, MSX2, MSY2, 7);
- if Length(C) > 0 then
- C2D := SplitTPA(C, 5)
- else
- Exit;
- SortATPAFromFirstPoint(C2D, Point(MSCX, MSCY));
- for I := 0 to High(C2D) do
- begin
- if Length(C2D[I]) < 50 then
- Continue;
- B := GetTPABounds(C2D[I]);
- with B do
- MMouse(RandomRange(x1, x2), RandomRange(y1, y2), 2, 2);
- //if ( not Pos('clerk', rs_GetUpText) > 0 ) then
- //Continue;
- GetMousePos(x, y);
- Mouse(x, y, 0, 0, False);
- Result := FastChooseOption('ange Gra');
- if Result then
- Break;
- end;
- if Result then
- begin
- T := GetSystemTime;
- while ( GetSystemTime - T < 10000 ) and
- ( not GEScreen ) do
- Wait(50 + Random(100));
- end;
- Result := GEScreen;
- end;
- Function WalkTPA(C1, C2, XM, YM, XR, YR : Integer; SortPoint : TPoint) : Boolean; //thanks to 3Garrett3
- Var
- TPA: TPointArray;
- TDPA: T2DPointArray;
- I, CTS, H, X, Y: Integer;
- Begin
- If Not LoggedIn Then Exit;
- cts := GetColorToleranceSpeed;
- ColorToleranceSpeed(2);
- SetColorspeed2Modifiers(0.10, 25);
- FindColorsSpiralTolerance(MMCX, MMCY, TPA, C1, MMX1, MMY1, MMX2, MMY2, 7);
- If Length(TPA) = 0 Then
- FindColorsSpiralTolerance(MMCX, MMCY, TPA, C2, MMX1, MMY1, MMX2, MMY2, 7);
- TDPA := TPAtoATPAEx(TPA, 20, 20);
- SortATPAFromFirstPoint(TDPA, SortPoint);
- H := High(TDPA);
- For i := 0 To H Do
- Begin
- MiddleTPAEx(TDPA[i], x, y);
- If rs_OnMinimap(x,y) Then
- Begin
- MouseFlag(x + XM, y + YM, XR, YR, 0);
- Result := True;
- Wait(200 + Random(80));
- ColorToleranceSpeed(cts);
- Exit;
- End;
- End;
- Result := False;
- ColorToleranceSpeed(cts);
- End;
- {---------------------------------End of: Functions from Charmz and Garrett, thanks---------------------------------}
- procedure CheckLumb;
- var
- x,y: integer;
- begin
- If Not LoggedIn Then Exit;
- If not FindSymbolIn(x, y, water, MMX1, MMY1, MMX2, MMY2) then //checking if in lumb
- gametab(magic_tab);
- Mouse(572, 230, 3, 3, true); // teleporting til lumb, becouse you aren't there
- wait(20000+random(5000));
- If not FindSymbolIn(1, 1, water, MMX1, MMY1, MMX2, MMY2) then //if still not in lumb, then fail, logging
- WriteLn('Something went wrong, youre either not in lumb, or doesnt have a hometeleport ready.');
- exit;
- end;
- Procedure WalkLumbToGoblinhut;
- begin
- If Not LoggedIn Then Exit;
- WalkTPA(1336112, 1004832,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- //Get some failsafes and checks
- end;
- Procedure WalkGoblinhutToAlkaridEntrance;
- begin
- If Not LoggedIn Then Exit;
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- //Get some failsafes and checks
- end;
- Procedure WalkAlkaridEntranceToVarrockSouthGate;
- begin
- If Not LoggedIn Then Exit;
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- //Get some failsafes and checks
- end;
- Procedure WalkVarrockSouthGateToGrandExchange;
- begin
- If Not LoggedIn Then Exit;
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- WalkTPA(1055774, 2722926,( - 1),( - 10), 2, 2, Point(MMCX, MMY2));
- //Get some failsafes and checks
- end;
- procedure UseGE;
- begin
- If not GEScreen:=true then
- begin
- writeln('Couldnt open GE')
- exit;
- end else
- if Players[CurrentPlayer].Booleans[0]=true then
- GESell(Strings[0], Strings[1], Integers[0]);
- if GESell:=true then
- writenl('Succesfully trying to sell items');
- else
- writenl('Couldnt set up the items for sale');
- if Players[CurrentPlayer].Boolean[1]=true then
- GEBuy(Strings[2], Strings[3], Strings[4]);
- if GEBuy:=true then
- writenl('Succesfully trying to buy items');
- else
- writenl('Coulndt set up the items for sale');
- end.
- Procedure SetUpScript;
- Begin
- {$IFDEF SRL_SMART}
- Smart_Server := World;
- Smart_Members := False;
- Smart_Signed := False;
- Smart_SuperDetail := False;
- {$ENDIF}
- SetUpSRL;
- DeclarePlayers;
- End;
- Procedure SetUpPlayer;
- Begin
- LogInPlayer;
- FindNormalRandoms;
- If (Not LoggedIn) Then Exit;
- SetRun(True);
- SetAngle(True);
- MakeCompass('N');
- End;
- Procedure MainLoop;
- Begin
- SetUpScript;
- SetupPlayer;
- CheckLumb;
- WalkLumbToGoblinhut;
- WalkGoblinhutToAlkharidEntrance;
- WalkAlkharidEntranceToVarrockSouthGate;
- WalkVarrockSouthGateToGrandExchange;
- UseGE;
- Logout;
- End;
- Begin
- MainLoop;
- End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement