Oaks
2012-01-26 13:41:52
Ever grow tired of those pesky moss giants?
Have you got an unquenchable thirst for peach juice?
well then this is the script for you!
Welcome, this is my first ever attempt at script, there really is very little benefit to using my script over any other autofighter. However as this is my first time I am posting my code here in the hopes that some amazing person can give me some constructive criticism.
To get this script to work all you need to do is go to the moss giants found in the chaos tunnels the entrance is in level 9-10 wildy just north of varrock and edge with bones to peach tabs and a full invent of either peaches or big bones.
many thanks and I hope you enjoy your peaches :-)
EDIT: just included a whole mess of antibans and randomisers to reduce chance of ban :-D also tidied up the main loop and added comments to make it easier to understand.
Have you got an unquenchable thirst for peach juice?
well then this is the script for you!
Welcome, this is my first ever attempt at script, there really is very little benefit to using my script over any other autofighter. However as this is my first time I am posting my code here in the hopes that some amazing person can give me some constructive criticism.
To get this script to work all you need to do is go to the moss giants found in the chaos tunnels the entrance is in level 9-10 wildy just north of varrock and edge with bones to peach tabs and a full invent of either peaches or big bones.
many thanks and I hope you enjoy your peaches :-)
EDIT: just included a whole mess of antibans and randomisers to reduce chance of ban :-D also tidied up the main loop and added comments to make it easier to understand.
program mossmangler;
{$define srl5}
{$loadlib sps}
{$define smart}
{$i srl/srl.simba}
{$i sps/sps.simba}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
//Major credit to YoHoJo his tutorials showed me how to make most of it
with Players[0] do // script still being produced please leave me feedback and suggestions :-D
begin // fill these 2 in and also down at the bottom there is a place to insert the world you want :-)
Name := ''; // username here
Pass := ''; // pass here
Pin := ''; // not really needed for this script
Active := true;
end;
end;
var foodnumber, attempts, linetime: integer;
/////////////////// this procedure handles the finding and attacking of the moss
/////////////////// giant
procedure AttackMoss;
var Mossx, Mossy: Integer;
begin
wait(50+random(100));
If FindObjEx(Mossx, Mossy, ['Att','ack'], [3034986,4548456,5269599], 5, 70, MSX1, MSY1, MSX2, MSY2) Then
begin
Case Random(3) Of
0: Mouse(Mossx, Mossy, 10, 20, True);
1: Mouse(Mossx, Mossy, 10, 20, True);
2: Begin
Mouse(Mossx, Mossy, 10, 20, false);
Wait(500+random(75))
ChooseOption('Attack');
End;
End;
Flag;
wait(300+random(100));
End else
begin
MakeCompass('random') ;
wait (500+random(200));
attempts:= 1+ attempts ;
writeln (attempts)
writeln ('attempts to find a moss giant')
If (attempts > 20) then
begin ///ends script if it cant find a moss giant change line above to
logout; // change number of attemps
writeln('tried to find a moss giant, no sign of one')
TerminateScript;
end;
end;
End;
//////////////// this procedure handles the looting of the bones
procedure Lootbones;
var Bonex, Boney, loottimer, plusone : Integer;
begin
Bonex:=MSCX
Boney:=MSCY
If (InvCount <24+random(4)) Then
begin
wait (50+random(100));
If FindObjEx(Bonex, Boney, ['Ta','ke'], [14342884,13948382,13356245], 5, 70, MSX1, MSY1, MSX2, MSY2) Then
begin
plusone:= InvCount +1
MarkTime(loottimer);
repeat
Mouse(Bonex, Boney, 5, 5, False);
Wait(400+random(50));
WaitOptionMulti(['Take Big', 'e Big', 'orstol', 'dragon', 'ol seed'], 200);
Wait(600+random(200));
until(InvCount = plusone) or (TimeFromMark(loottimer) > 5000-random(600))
end;
End;
end;
/////////////////// this procedure handles all eating stuffs :-)
procedure eat;
var peachx, peachy, peachDTM: Integer;
begin
peachDTM := DTMFromString('m1gAAAHicjcyxCYAwAAXRn5QOEcRCwbQGHchhBC0EIaQQlMzggF5naQ5ee5WkaKUVB07cyLiQsGODN1KHGg1a9AiYMGLAs8xc7S+nskyhrxd0TAmk');
if findDTM (peachDTM, peachx, peachy, MIX1, MIY1, MIX2, MIY2) then
begin
writeln(foodnumber);
Mouse (peachx, peachy, 15, 15, true);
writeln('mm.. tasty peach');
foodnumber:= CountItems('dtm', peachDTM, []);
writeln(foodnumber)
wait(300+random(200))
if (foodnumber < 5) then
begin
lootbones;
lootbones;
end;
end else
begin /////should logout when you run out of tabs
writeln('out of tabs!')
logout;
terminatescript;
end;
end;
/////////////////////// this procedure handles the b2p support
///////////////////////(turns bigbones into peaches using tabs)
procedure makefood;
var b2px, b2py, b2pDTM: Integer;
begin
b2pDTM := DTMFromString('m1gAAAHicjclNCkBQGIXhcw2twfYswMQmGFnKLcUARZQb1uQl/yOnnq/ePl9S50k1KkxY4JDDHtrtb6QSDSwGOIzoURw9h4GyNNlJ3iWOolf73NNz3zY/3VsBFhcVYw==');
if findDTM (b2pDTM,b2px,b2py, MIX1, MIY1, MIX2, MIY2) then
begin
if (foodnumber <5) then
begin
Mouse(b2px, b2py, 9, 15, true);
wait (250);
end;
if (HPPercent >60) then
begin
wait(200)
eat;
end;
end;
end;
////////////////////// this is just a failsafe incase it
//////////////////////clicks on the rope, it causes the script to log you out
procedure wildy;
var wildyx, wildyy, wildyDTM: integer;
begin
wildyDTM := DTMFromString('mQwAAAHicY2ZgYDjLCMEXgVgdyDeA4oczZOEYBliBmBEJAwEATZcHww==');
if findDTM (wildyDTM,wildyx,wildyy, MSX1, MSY1, MSX2, MSY2) then
begin
logout;
writeln('oops clicked the rope!')
TerminateScript;
end;
end;
/////////////////////antiban stuffs
/////////////////////
procedure antiban;
begin
case random(950)of
0: begin
HoverSkill('Attack', False);
wait (random(3000));
Gametab(Tab_inv);
end;
1: begin
HoverSkill('strength', False);
wait (random(3000));
Gametab(Tab_inv);
end;
2: begin
HoverSkill('defence', False);
wait (random(3000));
Gametab(Tab_inv);
end;
3: begin
HoverSkill('Hitpoints', False);
wait (random(3000));
Gametab(Tab_inv);
end;
10:randomRclick;
20:BoredHuman;
30:randomMovement;
40:begin
Gametab(21+random(16));
wait(1000+random(3000));
Gametab(Tab_inv);
end;
50:lootbones;
60:makefood;
70:if (HPpercent <RandomRange(75, 85)) and LoggedIn then
begin
eat;
end;
end;
end;
/////////// this procedure handles the looting and peach making
/////////// just to clean up the main loop :-)
procedure fightwon;
begin
writeln('we won!');
Lootbones;
wait(400);
Lootbones;
if (HPpercent < RandomRange(45, 75)) and LoggedIn then
begin
eat;
end;
if (foodnumber <5+random(2)) then
begin
makefood;
end;
begin
wait(200+random(50));
end;
end;
////////////// this just handles all of the startup stuffs :-)
procedure startup;
begin
Smart_Server := 23;//world here
Smart_Members := true;
Smart_Signed := false;
Smart_SuperDetail := false;
SetupSRL;
DeclarePlayers;
LoginPlayer;
linetime := 3001;
Writeln('starting up looking for mossies');
Gametab(Tab_inv);
SetAngle(0);
attempts := 0;
end;
////////////// main loop starts here :-)
begin
startup;
repeat;
if (not(srl_InFight)) then
begin
AttackMoss;
if (TimeFromMark(linetime)> 3000) then
begin
writeln('looking for a target');
marktime(linetime);
end;
end;
if srl_InFight then
begin
writeln('found some moss, destroying it');
repeat
wait(400 + random(50));
antiban;
if (HPpercent < RandomRange(45, 65)) and LoggedIn then
begin
eat;
end;
if (foodnumber < 3) and LoggedIn then
begin
lootbones;
lootbones;
makefood;
end;
until (not (srl_InFight));
fightwon;
end;
FindNormalRandoms;
Gametab(Tab_inv);
wildy;
writeln(TimeRunning + ' is how long you have been killing mossies')
Until(False);
end.