SRL Archive - First Scripts

PowerOak


Waltzing Mouse

2008-07-06 14:51:21

This is my first script… I hope you guys like it!

{========================================================================]
[ PowerOak 0.1 Alpha ]
[========================================================================]
[ By Waltzing Mouse ]
[ ]
[ Edit lines 18 - 21. ]
[ ]
[ If you experience any problems, please feel free to visit ]
[ my thread on the SRL forums: ]
[ ]
[ SRL-Forums.com/forum/poweroak-t35050.html ]
[========================================================================}

program PowerCutterAlpha;
{.include srl/srl.scar}
{.include srl/srl/skill/WoodCutting.scar}
const
Username = ''; // Your username
Password = ''; // Your password
TreeColour = 1390382; // Colour of Oak Tree
LoadsWanted = 10; // Amount of loads you want PowerChopping
// DO NOT EDIT BELOW HERE
MainX = 379;
MainY = 172;
PasswordX = 321;
PasswordY = 328;
LoginX = 379;
LoginY = 367;
LogoutX = 753;
LogoutY = 11;
ClickX = 636;
ClickY = 377;
var x, y, LoadsDone : Integer;
procedure Login;
begin
writeLn('Logging in...');
Mouse(MainX, MainY, 1, 1, true);
Wait(1000 + Random(100));
ClickMouse(MainX, MainY, True);
Wait(500 + Random(100));
TypeSend(Username);
Wait(Random(1000));
TypeSend(Password);
Wait(1500 + Random(100));
Mouse(LoginX, LoginY, 1, 1, true);
Wait(1000 + Random(100));
ClickMouse(LoginX, LoginY, True);
Wait(3500 + Random(100));
ClickMouse(LoginX, LoginY, True);
Wait(2000 + Random(100));
writeLn('Successfully logged in.');
end;
procedure AntiBan;
begin
Mouse(Random(516), Random(337), 10, 10, True);
Wait(3000);
ChopOak;
end;
procedure AntiRandom;
begin
FindBirdsNest;
FindEnt(x, y, True);
end;
procedure ChopOak;
begin
writeLn('Finding Oak...');
FindObj(x, y, 'ak', TreeColour, 30)
repeat
Mouse(x, y, 0, 0, true);
Wait(3000 + Random(1000));
AntiRandom;
writeLn('Oak found.');
until (FindObj(x, y, 'ak', TreeColour, 30) = false) or (InvFull)
end;
procedure Drop;
begin
if (InvFull) then
begin
DropItem(2);
DropItem(3);
DropItem(4);
DropItem(5);
DropItem(6);
DropItem(7);
DropItem(8);
DropItem(9);
DropItem(10);
DropItem(11);
DropItem(12);
DropItem(13);
DropItem(14);
DropItem(15);
DropItem(16);
DropItem(17);
DropItem(18);
DropItem(19);
DropItem(20);
DropItem(21);
DropItem(22);
DropItem(23);
DropItem(24);
DropItem(25);
DropItem(26);
DropItem(27);
DropItem(28);
end;
end;
begin
SetupSRL;
ActivateClient;
Login;
SendArrowWait(0, 250 + Random(50));
repeat
repeat
ChopOak;
until(InvFull);
Drop;
AntiBan;
LoadsDone := LoadsDone + 1;
writeLn('Chopped and dropped a load.');
until (LoadsDone >= LoadsWanted)
Logout;
end.

I tested it and it worked okay for me :)

Bobzilla69

2008-07-06 14:57:59

ClickMouse(MainX, MainY, True);

needs to change to Mouse as its less detectable.


procedure Drop;
begin
if (InvFull) then
begin
DropItem(2);
DropItem(3);
DropItem(4);
DropItem(5);
DropItem(6);
DropItem(7);
DropItem(8);
DropItem(9);
DropItem(10);
DropItem(11);
DropItem(12);
DropItem(13);
DropItem(14);
DropItem(15);
DropItem(16);
DropItem(17);
DropItem(18);
DropItem(19);
DropItem(20);
DropItem(21);
DropItem(22);
DropItem(23);
DropItem(24);
DropItem(25);
DropItem(26);
DropItem(27);
DropItem(28);
end;
end;

this could be improved by using a single procedure that drops everything.

also you click cordonates alot which aint good.

use the srl login procedure.

also you need failsafes, add anti randoms and also anti-ban
and your standards need improvement, but not bad for your first go

Waltzing Mouse

2008-07-07 12:29:31

It has SOME anti-randoms… but thanks anyway.

Claymore

2008-07-07 14:09:20

Well if you hope to go to SRL Members, than a few pointers.

Standards


procedure ChopOak;
begin
writeLn('Finding Oak...');
FindObj(x, y, 'ak', TreeColour, 30)
repeat
Mouse(x, y, 0, 0, true);
Wait(3000 + Random(1000));
AntiRandom;
writeLn('Oak found.');
until (FindObj(x, y, 'ak', TreeColour, 30) = false) or (InvFull)
end;

That would be wrong.


procedure ChopOak;
begin
WriteLn('Finding Oak...');
FindObj(x, y, 'ak', TreeColour, 30)
repeat
Mouse(x, y, 0, 0, true);
Wait(3000 + Random(1000));
AntiRandom;
writeLn('Oak found.');
until (FindObj(x, y, 'ak', TreeColour, 30) = false) or (InvFull)
end;

This would be right.

Organizing Your Procedures



procedure AntiBan;
begin
Mouse(Random(516), Random(337), 10, 10, True);
Wait(3000);
ChopOak;
end;
procedure AntiRandom;
begin
FindBirdsNest;
FindEnt(x, y, True);
end;

procedure ChopOak;
begin
//Codes//
end;

This would be wrong because when you tried to use the ChopOak; on AntiBans, you would have an error of

[Error] (12840:1): Unknown identifier 'ChopOak' in script

Switch the ChopOak; over the AntiBan;

Using SRL
If you think there aren't any SRL Logins, there is. Check in Public Test Corner.
The reason you use SRL is because it gives more features. Like the log in.
All you need to do is use procedure DeclarePlayers; etc…

AntiRandoms

I know you added SOME, but that was not enough.

procedure AntiRandom;
begin
FindBirdsNest;
FindEnt(x, y, True);
end;

First of all, FindEnt isn't reliable, try making your own. Second of all where is FindNormalRandoms; Because the moment you get one of them, your dead.

AntiBan
AntiBan is second most important in scripting. Try doing

case (Random(6)) of
1: begin
Mouse(Random(516), Random(337), 10, 10, True);
Wait(3000);
ChopOak;
end;
2: HoverSkill('Woodcutting', False);
3: RandomMovement;
4: BoredHuman;
5: AlmostLogout;
6: DoEmote(400 +Random(90));
end;

This way it will provide best Anti Ban and it also looks cool :spot:

Thats it from me, any questions?

mariofan12

2008-07-14 20:34:45

nice, worked very well in till I got the old man, but it's good for your first script.

killr280

2008-07-15 21:48:29

Pretty nice, ran untill i got a random 5 mins later but i only needed it for 5 mins lol

H20Effect

2008-07-26 00:49:06

Looks good! But like everyone else said, it needs more AntiRandoms. 4/5 For a first though!

Ghostman

2008-07-27 21:26:15

procedure Drop;
begin
if (InvFull) then
begin
DropItem(2);
DropItem(3);
DropItem(4);
DropItem(5);
DropItem(6);
DropItem(7);
DropItem(8);
DropItem(9);
DropItem(10);
DropItem(11);
DropItem(12);
DropItem(13);
DropItem(14);
DropItem(15);
DropItem(16);
DropItem(17);
DropItem(18);
DropItem(19);
DropItem(20);
DropItem(21);
DropItem(22);
DropItem(23);
DropItem(24);
DropItem(25);
DropItem(26);
DropItem(27);
DropItem(28);
end;
end;


This could be way shorter and take up only about 4 lines

but all in all not bad


This is the shorter way

procedure Droplog;
begin
for item:=2 to 28 do
dropitem(item)
end;

P1nky

2008-07-27 23:39:06

lol the x y coords to login/logout already been made in srl..

Logout;
LoginPlayer;