Markus
2011-01-09 16:33:17
This works, but srsly fucked up. I'm just so proud I wrote a semi-working RS script I really had to share. Half is written intoxicated and the other half is debugcode :)
No I wouldn't even trust my lv3 rsdemon guy with it.
Features:
[.]Multiplayer
[.]Autologin
[.]Flawless
[X]Actually banks
[X]Doesn't think it powerskills
[X]Location detection (well, it works when standing both at yews and at bank
[/]Half-working yew switching!
[X]Yew cut timer.
gz, Markus
No I wouldn't even trust my lv3 rsdemon guy with it.
program CHOPdaBOB;
(*******************************************************************************
C H O P D A B O B
A Falador Yew Cutter by Markus
Q: MARKUS WHY DID YOU MAKE THIS?!?!?! HOW ABOUT THE WONDERFUL MSI????
A: I couldn't get MSI to work and in the 20 mins I used it got really fed up
with some bugs: WHY can't it detect my location. WHY does it think I'm
powerskilling? WHY do i have to enter a fckn 0 every time in the form
or else the script will hang? Not even the crappiest RSBot script wants that.
Oh and I really couldn't be bothered to mess the code around good enough to
get it working. And it hated my scriptrecord so much that I was like,
I can do this better and it'll be quicker if I do it from scratch.
TL;DR: I'm a lazy fuck and couldn't get it to work.
Q: So, such a *ahum* nice script, how long did it take to write you?
A: It took me one hour to make it do it's first bank run :) And another hour
to fix some bugs and have it do yewhopping between yew one and two.
*******************************************************************************)
{$i srl/srl/misc/smart.scar}
{$i srl/srl.scar}
{$i reflection/reflection.simba}
//Yew ID: 1309
//Yew STUMP: 7402
//Cutting anim: 867
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do //ripped this from bobzilla without permission
begin
Name := ''; //Username
Pass := ''; //Password
Nick := ''; //3-4 non uppercase, number, or space characters on your username
Pin := ''; //Bank Pin (Blank if none)er
Active := True; //Player Active?
Integers[2] := 10; //how long to work for in minutes
end;
end;
const
id_YEW_TREE = 1309;
id_YEW_STUMP= 7402;
id_ANIM_CUT = 867;
const //To be used in the future
TO_YEWS = 1337;
CUT_YEWS = 1338;
SWITCH_YEWS = 1339;
TO_BANK = 1340;
CLEAR_INV = 1341;
var
YewTimeStamps : array [0..1] of integer;
YewTiles : array [0..1] of TTile;
BankToYews : TTileArray;
YewsToBank : TTileArray;
CurrentYew : Integer;
Breakout : Boolean;
function FindYew : boolean;
var
FoundObjs : TRSObjectArray;
YewPoint : TPoint;
TimeMark : Integer;
Tries : Integer;
begin
Result := False;
FoundObjs := GetObjectsByID(id_YEW_TREE, OBJECT_TYPE_INTERACTABLE, 10); //First try to find a yew
if length(FoundObjs) = 0 then
begin
FoundObjs := GetObjectsByID(id_YEW_STUMP, OBJECT_TYPE_INTERACTABLE, 10);
if length(FoundObjs) = 0 then
begin
writeln('There is no fckn yew, and no fckn stump of a yew!');
BreakOut := True;
exit;
end else
writeln('we found a stump -.-''');
//writeln(FoundObjs);
result := False;
end else
begin
writeln('WE found a yew tree!');
writeln('We found itat : '+ ToStr(FoundObjs[0].Tile)+' to be precise');
writeln('WE are at: '+ToStr(GetMyPos));
if GetAnimation <> id_ANIM_CUT then
begin
While(Tries < 10) do
begin
writeln('and were gonna cut it!');
if InvFull then
begin
writeln('wait we are not, as our inventory is full');
result := True; //to follow main loop logic
Exit;
end;
YewPoint := TileToMS(FoundObjs[random(9)].Tile, random(500));
MMouse(YewPoint.x, YewPoint.y, 5, 5);
if IsUpText('hop') then
begin
GetMousePos(YewPoint.x, YewPoint.y);
if Random(2) = 1 then
Mouse(YewPoint.x, YewPoint.y, 0, 0, true)
else begin
Mouse(YewPoint.x, YewPoint.y, 0, 0, false);
ChooseOption('hop');
end;
R_Flag;
TimeMark := GetSystemTime;
While ((GetSystemTime-TimeMark) < 5000) do
begin
if GetAnimation = id_ANIM_CUT then
begin
writeln('We iz cuttin and we r done');
Result := True;
Exit;
end;
end;
end;
Inc(Tries);
end;
end else
begin
writeln('we are already cutting it');
Result := True;
end;
end;
end;
(*
Typical script-loop:
Walk from bank to yews TO_YEWS
cut a yew CUT_YEWS
switch yew SWITCH_YEWS
Invfull: walk back to bank TO_BANK
at bank: deposit stuff CLEAR_INV
*)
function SwitchYews : boolean;
var
i, j, k : integer;
begin
j := MaxInt;
for i := 0 to high(YewTimeStamps) do //Find out which yew to go
begin
if (YewTimeStamps[i] < j) then
begin
j := YewTimeStamps[i];
k := i;
end;
end;
if i > high(yewtimestamps) then i := random(length(yewtimestamps));
writeln('we are switching to yew: '+inttostr(i)+'@'+ToStr(yewtiles[i]));
if (r_WebWalk(YewTiles[i])) then
begin
writeln('we iz at the right yew!');
writeln('Yew: '+tostr(i)+' @ '+ToStr(yewtiles[i]));
R_Flag;
end;
end;
function ScriptState : integer; //Not used atm, I want to make this script stateless
var
MyPos : TTile;
begin
FindNormalRandoms;
MyPos := GetMyPos;
end;
procedure LoadArrays;
begin
BankToYews := TPointArray([Point(3012, 3355), Point(3006, 3348),
Point(3006, 3334), Point(3006, 3323),
Point(3019, 3318)]);
YewsToBank := TPointArray([Point(3012, 3355), Point(3006, 3348),
Point(3006, 3334), Point(3006, 3323),
Point(3019, 3318)]);
InvertPath(YewsToBank);
YewTiles[0].x := 2995+random(6);
YewTiles[0].y := 3310+random(6);
YewTiles[1].x := 3018+random(6);
YewTiles[1].y := 3314+random(6);
end;
begin
Smart_Members := True;
Smart_Server := 52;
Smart_Signed := True;
Smart_SuperDetail := False;
setupsrl;
SetupReflection;
DeclarePlayers;
LoadArrays;
repeat
{ case ScriptStatus of
TO_YEWS: WalkPath(BankToYews);
TO_BANK: WalkPath(YewsToBank);
CUT_YEWS: FindYew;
SWITCH_YEWS: SwitchYews;
CLEAR_INV: DepositStuff; //c-c-c-c-c-COOOMBO BREAKER =D
end else
begin
writeln('Uhm, IDK wtf ur trying to do, but I can tell you one thing and'+
' that''s that it just doesn''t work');
TerminateScript;
end; }
BreakOut := False;
WalkPath(BankToYews);
CurrentYew := 1; //cus of walkpath
repeat
FindNormalRandoms;
if FindYew then
begin
repeat
if random(500) = 1 then BoredHuman;
wait(50+random(200));
if InvFull then break;
until not FindYew;
YewTimeStamps[currentyew] := GetSystemTime;
end;
if not invfull then SwitchYews;
until InvFull;
WalkPath(YewsToBank);
OpenBankFast('feb');
DepositAll;
until false;
writeln('markus u r s00 leet');
end.
Features:
[.]Multiplayer
[.]Autologin
[.]Flawless
[X]Actually banks
[X]Doesn't think it powerskills
[X]Location detection (well, it works when standing both at yews and at bank
[/]Half-working yew switching!
[X]Yew cut timer.
gz, Markus