SRL Archive - First Scripts

Edgeville Man killer W/ Bone pickup


agentkid15

2009-02-26 11:05:12

Hello this is my first script, i have yet to add login or antiban please do not use unsupervised, i just wish for my script to be rated for a first script, any suggestions would be nice.

Version History :
Version 0.01 - Noob version with nothing.

Aser

2009-02-27 12:27:23

Nice Job. You did banking. That's really promising in a first script.


procedure FindMan;
begin
FindObjCustom(x, y, ['att', 'ack'], [ManColor1, ManColor2,ManColor3], 5);
begin
Mouse(x,y,5,5,false);
wait(300);
end;
end;

procedure Attack;
begin
ChooseOption('ttack');
Wait(15000);
end;

should be


procedure FindMan;
begin
FindObjCustom(x, y, ['att', 'ack'], [ManColor1, ManColor2,ManColor3], 5);
begin
Mouse(x,y,5,5,false);
wait(300);
ChooseOption('ttack');
Wait(15000);
end;
end;

The extra procedure was unnessisary, but you had the idea right.


i:= i + 1;
//is the same as
Inc(i);

Inc(integer) is just faster and easier.

I would add a constant for how many times you want the script to run for a player. Obviously multiplayer is always good and very easy, just search for 'incorporating multiplayer in a script' or something of the sort.

Add some comments in there. What is Combat1 and 2? You should explain those.

Lastly, but probably most important, add failsafes.


procedure FindMan;
if not LoggedIn then
Exit;
begin
if FindObjCustom(x, y, ['att', 'ack'], [ManColor1, ManColor2,ManColor3], 5) then
begin
Mouse(x,y,5,5,false);
wait(300 + Random(100));
ChooseOption('ttack');
repeat
Wait(100 + random(100));
until not (Infight); //not 100% on this one might be off a little bit
end;
end;

That will make it not go if the character is logged out. That way you don't get caught up clicking on the login screen randomly.

If then's allow it to not do something if it isn't found. Otherwise if it doesn't find the object then the x and y will have 0 values causing a click in the top left.

The repeat will wait while you are fighting the people so you aren't constantly clicking them.

Good job for a first script. Keep it up.

Torrent of Flame

2009-02-27 12:50:18

Inc is a fraction of a millisecond faster. It doesnt matter.

Smarter Child

2009-02-27 19:43:00

procedure Bank1;
begin
RadialWalk(8291463,160 , 200, 65, -1, 0);
If (FindSymbol(x, y, 'bank')) then
Mouse(x,y,5,5,true);
Wait(3900);
end;

You cannot use normal colors in a normal RadialWalk because minimap colors change all the time!..Now i don't know if your clicking a road etc…but if it is a road then it should be..
procedure Bank1;
begin
RadialWalk(FindVarrockRoadColor,160 , 200, 65, -1, 0);
If (FindSymbol(x, y, 'bank')) then
Mouse(x,y,5,5,true);
Wait(3900);
end;
Since edgeville, is closest to Varrock, it uses the same AutoColor.

Now, the banking:
procedure Banking;
begin
FindObjCustom(x, y, ['bank', 'anker'], [1469101, 5322561], 5);
Mouse(x,y,5,5,false);
ChooseOption('ank');
Wait(600);
DepositAll;
end;

In the SRL, there is a function that finds the banker already. it is called….
[PHP]function OpenBank(WhichBank: String, ChangeCompass, ChangeAngle: Boolean): Boolean;[/PHP]]

Which bank, is which bank your opening..so it would be so far…
OpenBank('eb'
since bank is a string and edgeville bank is 'eb'/
Next is if you wanna change compass to find the banker..
OpenBank('eb, true, true);

This will change the compass and angle to find the banker:duh:

DepositAll; deposits everything, so thats good:)
and
CloseBank;
closes the bank screen::redface:

You could combine a lot of procedures you have into one procedure such as…
procedure FindMan;
begin
FindObjCustom(x, y, ['att', 'ack'], [ManColor1, ManColor2,ManColor3], 5);
begin
Mouse(x,y,5,5,false);
wait(300);
end;
end;

procedure Attack;
begin
ChooseOption('ttack');
Wait(15000);
end;

which could be in one procedure…
procedure FindMan;
begin
FindObjCustom(x, y, ['att', 'ack'], [ManColor1, ManColor2,ManColor3], 5);
begin
Mouse(x,y,5,5,false);
wait(300);
ChooseOption('ttack')l
Wait(15000);
end;
end;


And instead of putting 15000 mili-seconds you could add randomness like…
Wait(750 + Random(750)); // or w\e you get the point


A nice first script, with a bit more improvement it could be a really good one.:p

Edit: BTW!
For ..
Coin1 = 1610675;
Coins = 0000lol;
Bone1 = 12171714;
Bone2 = 9013651;
Bank = 7503752;
You can use Bitmaps or DTMs.

I'd check the tutorial section, they have lots of dtm/bitmap tutorials :)

ian.

2009-02-28 00:12:36

OpenBank( ); is slow.. use OpenBankFast( );

like.. OpenBankFast('eb');

you guys are basically writing the script for him.. it's not bad to do that sometimes but try not to do it so much.. you could say something like

"for your finding and attacking procedures, you can make them one procedure.. and for finding the bank you need FindVarrockRoadColor, the valid arguments can be found in /SRL/SRL/core/AutoColor :) nice work for a first ;D"

:)

godspower55

2009-02-28 00:36:42

lol ty for the compliments, and sorry because this is my script but i accidentally was logged in on my brothers account since he is a dope and clicks remember me but anyway, ty for the tips and everything, i just finished up a second script which i will post. I will update this script tomorrow or maybe tonight.