Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //OSRS07 - Willow Cutter and banker v0.7
- //Amberleaf
- //Instructions & more scripts can be found at http://www.scar-divi.com
- //2/4/13
- {$DEFINE RS07} // V - Bright Settings
- {$DEFINE SMART} // Comment out to use normal browser
- {$DEFINE OSI_RS07_Color_Anti_Randoms}
- {$I OSI\OSI.scar}
- {$I MSSL\MSSL.scar}
- const
- USERNAME = 'username';
- PASSWORD = 'password';
- BANK_PIN = 'pin'; // Change if you use bank pin
- {$IFNDEF MSSL_1.04-1(+)}
- begin
- ClearDebug;
- WriteLn('MSSL is OUTDATED! Please update it with Includes Manager.');
- end.
- {$ENDIF}
- var
- forceBanking: Boolean;
- procedure DeclarePlayers;
- begin
- RS07_SetActivePlayer(USERNAME, PASSWORD, '', MSSL_TCAToTIA(MSSL_StrToTCA(BANK_PIN)));
- end;
- procedure ScriptTerminate;
- begin
- MSSL_Unsetup;
- FreeOSI;
- end;
- function EvilTreeAt(x, y: Integer): Boolean; // Make sure treeName is exactly the same as in uptext! CASE-SENSITIVE
- var
- p: TPoint;
- t: Integer;
- b: Boolean;
- a: TStrArray;
- begin
- Result := False;
- p := Point(x, y); // We create 'p' point of x,y coordinates
- if (PointInBox(p, RS07_GameActionBx) and RS07_LoggedIn) then // We check that point is inside main screen AND that we are logged in, before we continue.
- begin
- a := ['Chop down Tree', 'Chop down Oak', 'Chop down Willow', 'Chop down Maple', 'Chop down Yew', 'Chop down Magic tree'];
- t := GetSystemTime; // Timer reset
- repeat
- case MSSL_MouseNearPt(p, 2) of // With this step we case the next action of.. If mouse is not near our point, we will move it to it.
- True: // ..and else we will check for result.
- if ((GetSystemTime - t) > 35) then // If time since mouse movement has been over 35 ms. then we can check for result...
- begin
- Result := RS07_IsUpTextCustomEx(a, [16777215, 65535], RS07_UpTextTol); // Is uptext with white and yellow as "Chop down *"? Result will be set as true, if it is...
- if not Result then // OK, so result wasn't true, lets check for other texts...
- b := (RS07_IsUpTextCustomEx(a, [16777215, 16776960], RS07_UpTextTol) or RS07_IsUpText('Walk here')); // If uptext is normal tree-text OR "Walk here", then variable 'b' will be set as true
- end;
- False:
- begin
- case RS07_QuickObjectCheck of // If this MSSL variable is set as true, then...
- True: SetMousePos(p.X, p.Y); // SetMousePos() will be used and else...
- False: RS07_MoveMouse(p.X, p.Y); // Normal RS07_MoveMouse() movement!
- end;
- t := GetSystemTime; // We mark the timer as current time (after movement)
- end;
- end;
- MSSL_Wait(0); // MSSL_Wait with hotkey check!
- until (Result or b or ((GetSystemTime - t) > 250)); // If this or this or this, then we are ready to break out!
- end;
- end;
- procedure GetBanking;
- var
- x, y: Integer;
- c: TPoint;
- begin
- if (forceBanking or RS07_InventoryFull) then // bag full
- begin
- forceBanking := False; // resets the force.
- c := BoxCenter(RS07_GameActionBx); // Stores center point from RS07_GameActionBx (main screen) to 'c' variable (TPoint).
- SetCompassAngleAndHeight(Dir_North, True);
- if MSSL_FindColorSpiralTolCS(227, 159, x, y, 4969197, 558, 8, 730, 164, 8, MSSL_ColorSettings2(2, 0.19, 2.34)) then
- begin
- Mouse(x, y, 0, 0, True); // left click position and run to bank
- MSSL_WaitRange(5000, 8999);
- if RS07_OpenBank(RS07_BANK_DRAYNOR) then //find bank
- begin
- MSSL_WaitRange(990, 2100);
- RS07_DepositEverythingEx([0]);
- MMouse(577, 231, 0, 0);
- MSSL_WaitRange(250, 750);
- MSSL_WaitRange(500, 1400);
- MSSL_WaitRange(550, 1250);
- SetCompassAngleAndHeight(Dir_North, True);
- Mouse(626, 134, 1, 1, True);
- MSSL_WaitRange(8000, 9999);
- end;
- end;
- end;
- end;
- procedure GetChopping;
- var
- x, y: Integer;
- c: TPoint;
- begin
- c := BoxCenter(RS07_GameActionBx);
- if RS07_FindObject(x, y, 'Chop down Willow', um_IsUpTextCustom, MSSL_ColorSettings2(2, 0.23, 0.72), 2581337, 3, 40, RS07_GameActionBx.X1, RS07_GameActionBx.Y1, RS07_GameActionBx.X2, RS07_GameActionBx.Y2) then
- begin
- WriteLn(MSSL_TheTime + ': Found a tree...');
- Mouse(x, y, 0, 0, True);
- repeat
- GetBanking;
- c := BoxCenter(RS07_GameActionBx);
- if MSSL_FindColorSpiralTolCS(227, 159, x, y, 610633, 1, 1, 510, 334, 2, MSSL_ColorSettings2(2, 0.06, 0.03)) then //check for nests
- begin
- MMouse(x, y, 0, 0);
- WriteLn('found a nest or root random');
- MSSL_WaitRange(40, 50);
- if (RS07_UpTextContains('Take') or RS07_UpTextContains('Pick')) then
- begin
- Mouse(x, y, 0, 0, True);
- MSSL_WaitRange(3000, 5000);
- end;
- end;
- if FindColorTol(x, y, 3240548, 39, 363, 90, 405, 2) then //lvl up check
- Mouse(292, 447, 0, 0, True);
- //OSIFindRandoms; //wip
- if RS07_IsUpText('Chop down') then // Just to check that we still have mouse inside the tree.
- begin
- GetMousePos(x, y);
- forceBanking := EvilTreeAt(x, y);
- if forceBanking then
- GetBanking;
- end;
- until not RS07_IsUpText('Chop down');
- if not FindColorTol(x, y, 14474496, 12, 12, 90, 19, 99) then
- begin
- GetMousePos(x, y);
- MMouse(x, y, 45, 90);
- MSSL_Wait(50 + Random(100));
- MMouse(x, y, 90, 45);
- MSSL_Wait(50 + Random(100));
- MMouse(x, y, 30, 30);
- MSSL_Wait(50 + Random(100));
- end;
- end;
- end;
- begin
- SetUpOSI;
- MSSL_Setup;
- RS07_UpTextCustomColors := [16777215, 16776960]; // Used for detecting only normal Willow tree's with RS07_FindObject()
- DeclarePlayers;
- Login;
- SetCompassAngleAndHeight(Dir_North, True);
- RS07_SetMoveSpeed(1);
- RS07_OpenGameTab(3);
- repeat
- case RS07_LoggedIn of
- False:
- if RS07_LogInPlayer then // Logins with currently active player's details.
- begin
- SetCompassAngleAndHeight(Dir_North, True);
- RS07_SetMoveSpeed(1);
- RS07_OpenGameTab(3);
- end;
- True: GetChopping;
- end;
- MSSL_Wait(0);
- until False;
- end.
Advertisement
Add Comment
Please, Sign In to add comment