SRL Archive - First Scripts

Simple Herb Cleaner


zyxw121

2012-02-24 19:08:29

This is my first ever script, a simple herb cleaner. It should work with all herbs except spiritweed, as long as they're in the first 4 rows of the main bank tab. I haven't tried it with a bank PIN, so that may be a bit buggy. It features Antiban, Antirandoms, numerous Failsafes, as well as SRLStats. I'm planning to add breaking, but it's a bit tricky, help would be appreciated with that. Please download and test this script, and give me some advice/tips/criticism/whatever. I'm new here, and I really want to learn to script.
Thanks!
EDIT: Newest version attached here.

zyxw121

2012-02-24 19:18:33

Left login in file, deleting.
EDIT: Seems I can't…
Could a mod remove the attachment for me?
I've changed my password anyways, but still.
EDIT2:
Turns out I can.:redface:
Sorry for all this, I'm new to this.
I've attached the script to this post.

Caotom

2012-02-24 20:44:46

This looks like a very good effort for a first script.
Here are a couple of suggestions for things to work on in the future:

- you cannot name your procedure the same as a command (ie. your procedure TerminateScript give the duplicate identifier error)

- For your proggy you could add this
  StartExp:= 0;
ToggleXPBar(True);
StartExp:= GetXPBarTotal;
at the start of the code then for the xp/hour and the exp gained use
+ IntToStr(((GetXpBarTotal - StartExp) * 3600) / (GetTimeRunning / 1000)) +
and
+ IntToStr(GetXpBarTotal - StartExp) +
this would give a more accurate exp gain in case the script could not clean some of the herbs.

- When cleaning all the herbs, the default is for the dtm search to go from the top left to the bottom right so you would end up using some weird pattern to clean the herbs (makes it look bot-like) using Something like InvMouse or TPAs would allow a better cleaning pattern.

- One other suggestion would be to add a mouse speed randomiser to the antiban as (especially in bots that primarily function on clicking in repetative sequence) having the exact same mouse speed for hours could get you flagged far easier.


Good for work on your first script and good luck in the future :)
~Caotom

zyxw121

2012-02-25 04:49:53

Thanks for your suggestions, I've implemented most of them, but I can't get InvMouse to work. I did

for I:=1 to 28 do
begin
Invmouse(I, mouse_left);
wait(100+random(100));
Antirandom;
Antiban;
end
but it does the same thing as the FindDTM, all left to right. There must be some way to get it to alternate in the direction of clicking, but I'm stumped. And also, what's the function to change mouse speed? I saw it somewhere, but I can't remember.
Thanks

EDIT:
This works

for I:=1 to 4 do
begin
Invmouse(I, mouse_left);
wait(100+random(100));
Inc(HerbsCleaned);
Antirandom;
Antiban;
end;
for I:=8 to 8 do
begin
Invmouse(I, mouse_left);
wait(100+random(100));
Inc(HerbsCleaned);
Antirandom;
Antiban;
end;
for I:=7 to 7 do
begin
Invmouse(I, mouse_left);
wait(100+random(100));
Inc(HerbsCleaned);
Antirandom;
Antiban;
end;
for I:=6 to 6 do
begin
Invmouse(I, mouse_left);
wait(100+random(100));
Inc(HerbsCleaned);
Antirandom;
Antiban;
end;
for I:=5 to 5 do
begin
Invmouse(I, mouse_left);
wait(100+random(100));
Inc(HerbsCleaned);
Antirandom;
Antiban;
end;
But it's really long, and looks ugly. Is there anyway to shorten it? I've tried

for I:= 8 to 5 do
, which doesn't work.
Essentially, what I'm asking is, if there is any way to make I 1-4, then 8-5, then 9-12, then 16-13, etc.
Thanks again.

Killerdou

2012-02-25 05:22:41


for x := 1 to 4 do
for y := 0 to 7 do
i := x + 4*y
You could try this. You can also try x := 4 downto 1 to reverse. To make it do left to right again switch the first line with the second. Make it writeln i and try to figure out the logic.

zyxw121

2012-02-25 05:55:14

I tried that, and couldn't get it to work, but

i := 8
repeat
Invmouse(I, mouse_left);
wait(100+random(100));
Inc(HerbsCleaned);
Antirandom;
Antiban;
Dec(i);
until(i=4);
did, for reversing the click direction.
I'm uploading the newest version now.