SRL Archive - SRL Archives

Runaway.scar


Runaway

2009-08-22 09:09:47

Mostly for woodcutting (excepting Cop_wait and Cop_mouse, those are just to reduce the amount of typing required), I decided to make a few shortcuts for a few of the widely used procedures and functions.

with some help from:
ian,
noidea,
and marpis,
I have created:

procedure Cop_wait(waittime: integer)
This takes the time and does several different mathematic equations with it. The absolute minimum wait time you can get out of this is the same as the variable you plug into it. for example, Cop_wait(100) can range from 100ms to 240ms wait time. The larger the initial input, the larger the output can be.


procedure Cop_wait(waittime: integer);
var
r1: Integer;
begin
r1 := randomrange(1, 4);
wait((waittime/r1)+random(50));
wait(waittime-random(waittime/2));
wait((waittime/4)+random(20));
end;

————————————————————————

procedure Cop_mouse(x, y: integer; leftclick: boolean)
This is just a shortcut, using a random integer for the rx and ry in the Mouse(x, y, rx, ry, leftclick) procedure.


procedure Cop_mouse(x, y: integer; leftclick: boolean);
var
ranx1, rany1: Integer;
begin
ranx1 := randomrange(2, 5);
rany1 := randomrange(2, 5);
Mouse(x, y, ranx1, rany1, leftclick);
end;

————————————————————————

procedure Cop_antiban(skill: string; randomtalker: boolean)
An antiban that includes all forms of "antibanning". Has an option to use my randomtalker, and choose what skill to say to people around you. Has a 10% chance of using antiban.
Valid arguments for skill: all skills, and you can choose random for extra fun!


procedure Cop_antiban(skill: string; randomtalker: boolean);
var
compassangle1, compassangle2: Integer;
begin
if not (LoggedIn) then Exit;
// inc(AntibansDone);
case random(200) of
0,1: BoredHuman;
2,3: RandomRClick;
4,5: PickUpMouse;
6,7: HoverSkill('random', false);
8,9: ExamineInv;
10,11: begin
compassangle1 := randomrange(1, 55);
compassangle2 := randomrange(120, 250);
MakeCompass(IntToStr(compassangle1));
Cop_wait(50);
MakeCompass(IntToStr(compassangle2));
Cop_wait(50);
MakeCompass('n');
end;
12,13: begin
GetMousePos(x, y);
MMouse(x, y, 15, 15);
Cop_wait(25);
MMouse(x, y, 5, 5);
end;
14: begin
if not (randomtalker) then Exit;
case random(5) of
0: TypeSend('lol');
1: TypeSend('...');
2: TypeSend('bored.');
3: TypeSend('omg this is boring');
4: TypeSend('auayuidy.');
end;
end;
15,16: RandomMovement;
17,18: begin
GameTab(RandomRange(1, 13));
Cop_wait(500);
Gametab(tab_Inv);
end;
19,20: SayCurrentLevels(skill);
end;
end;

————————————————————————

procedure Cop_dropload(itemcolor: integer)
Just a quick little procedure that can make powerminers and cutters that much easier to deal with.


procedure Cop_dropload(itemcolor: integer);
var
b: tbox;
i: Integer;
begin
if not (LoggedIn) then Exit;
for i := 1 to 28 do
begin
b := InvBox(i);
if FindColor(itemcolor, x, y,b.x1, b.y1, b.x2, b.y2) then
DropItem(i);
end;
end;

————————————————————————

function Cop_findtree(treetype: string; leftclick: boolean): boolean
Using the input from the user, this will take the tree type and find and chop that particular tree. For example, Cop_findtree(magic, false) will find a magic tree and then right click it, choosing the chop option from the drop-down menu.
Valid arguments: normal, oak, willow, maple, yew, and magic.


function Cop_findtree(treetype: string; Chop: boolean): boolean;
var
Colors: Array of integer;
UpText: string;
begin
if not (LoggedIn) then Exit;
case Lowercase(treetype) of
'normal': Colors := [1854786, 3567717, 1062703];
'oak': Colors := [1922889, 4624516, 2516570];
'willow': Colors := [6919048, 2441789, 5010788];
'maple': Colors := [3495048, 1451327, 2176088];
'yew': Colors := [2120012, 2648669, 4228986];
'magic': Colors := [10479596, 4623230, 2186320];
end else
begin
writeln('Tree type selected is not supported.');
exit;
end;
UpText := copy(treetype, 2, High(treetype)); // this takes the first letter off from treetype and saves it to variable UpText, willow -> illow
if FindObjCustom(x, y, [UpText], Colors, 5) then
begin
result := true;
if Chop then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, false);
result := WaitOption('p down', 500+random(100));
end;
end;
end;

————————————————————————

Yay!
Enjoy them, I have found them to be quite useful making different kinds of scripts!

-Runaway

noidea

2009-08-22 09:28:03

Nice release ;)
I'm glad we got this sorted out over msn :)

Runaway

2009-08-22 18:53:33

I added you to the list of people who helped out.
To tell you the truth I didn't know your SRL name until you posted on this :P

ALSO:
There are more additions to this include coming!
It would be cool to get feedback too :)

rogeruk

2009-08-22 18:56:04

I beleive the prefix of R_ is being used in Reflection which would cause a bit of confusion?

Not 100% sure :) lol.

Runaway

2009-08-22 18:59:56

Yeah, I saw that after I made them all :O
I guess I could change them, but I don't know what to…

EDIT: I could change them all to: rc_wait and such?

ian.

2009-08-22 19:03:08

Rc = remote control =X

Runaway

2009-08-22 19:04:30

goddamn, what ISN'T taken yet :O

noidea

2009-08-22 19:05:36

Cop_ :p

Runaway

2009-08-22 19:12:46

edited the procedures and function and made the prefix Cop_
thanks again noidea :P

Smarter Child

2009-08-22 19:41:59

I personally use TPA for tree finding, but nevertheless Runaway Cop, a good effort.

Edit : :D

Edit2: But I don't think this will be added to SRL :(

marpis

2009-08-22 19:44:55


procedure Cop_wait(waittime: integer);
var
r1: Integer;
begin
r1 := randomrange(1, 4);
wait((waittime/r1)+random(50));
wait(waittime-random(waittime/2));
wait((waittime/4)+random(20));
end;
You could just do something like wait(100+random(100)), and it would be just as good.


procedure Cop_mouse(x, y: integer; leftclick: boolean);
var
ranx1, rany1: Integer;
begin
ranx1 := randomrange(2, 5);
rany1 := randomrange(2, 5);
Mouse(x, y, ranx1, rany1, leftclick);
end;
???
Mouse(x, y, 4, 4, false); doesn't seem very long to me :p


case random(14) of
0: Gametab(tab_Notes);
1: Gametab(tab_Combat);
2: Gametab(tab_Stats);
3: Gametab(tab_Quest);
4: Gametab(tab_Diary);
5: Gametab(tab_Equip);
6: Gametab(tab_Prayer);
7: Gametab(tab_Magic);
8: Gametab(tab_Friends);
9: Gametab(tab_Ignore);
10: Gametab(tab_Clan);
11: Gametab(tab_Options);
12: Gametab(tab_Emotes);
13: Gametab(tab_Music);
end;
Cop_wait(500);
Gametab(tab_Inv);
shortened:

GameTab(RandomRange(1, 13));
Wait(500+random(100));
GameTab(tab_Inv);


procedure Cop_dropload(itemcolor: integer);
var
i: Integer;
begin
if not (LoggedIn) then Exit;
if FindColor(itemcolor, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
CountItemsIn('inv', 'colour', itemcolor, [5, 1]);
for i := 1 to 28 do
begin
DropAll;
//inc(LoadsDone);
end;
for i := 2 to 28 do
begin
DropItem(i);
//inc(LoadsDone);
end;
end;
end;
shortened:

procedure Cop_dropload(itemcolor: integer);
var
b: tbox;
i: Integer;
begin
if not (LoggedIn) then Exit;
for i := 1 to 28 do
begin
b := InvBox(i);
if FindColor(itemcolor, x, y,b.x1, b.y1, b.x2, b.y2) then
DropItem(i);
end;
end;


function Cop_findtree(treetype: string; leftclick: boolean): boolean;
begin
if not (LoggedIn) then Exit;
case Lowercase(treetype) of
'normal': begin
if FindObjCustom(x, y, ['ree'], [1854786, 3567717, 1062703], 5) then
begin
result := true;
Cop_mouse(x, y, leftclick);
Cop_wait(100);
if (leftclick) then
ChooseOption('hop')
else
end;
end;
'oak': begin
if FindObjCustom(x, y, ['ak'], [1922889, 4624516, 2516570], 5) then
begin
result := true;
Cop_mouse(x, y, leftclick);
Cop_wait(100);
if (leftclick) then
ChooseOption('hop')
else
end;
end;
'willow': begin
if FindObjCustom(x, y, ['illow'], [6919048, 2441789, 5010788], 5) then
begin
result := true;
Cop_mouse(x, y, leftclick);
Cop_wait(100);
if (leftclick) then
ChooseOption('hop')
else
end;
end;
'maple': begin
if FindObjCustom(x, y, ['aple'], [3495048, 1451327, 2176088], 5) then
begin
result := true;
Cop_mouse(x, y, leftclick);
Cop_wait(100);
if (leftclick) then
ChooseOption('hop')
else
end;
end;
'yew': begin
if FindObjCustom(x, y, ['ew'], [2120012, 2648669, 4228986], 5) then
begin
result := true;
Cop_mouse(x, y, leftclick);
Cop_wait(100);
if (leftclick) then
ChooseOption('hop')
else
end;
end;
'magic': begin
if FindObjCustom(x, y, ['agic'], [10479596, 4623230, 2186320], 5) then
begin
result := true;
Cop_mouse(x, y, leftclick);
Cop_wait(100);
if (leftclick) then
ChooseOption('hop')
else
end;
end;

else
writeln('Tree type selected is not supported.');
end;
end;
shortened, also edited it abit

function Cop_findtree(treetype: string; Chop: boolean): boolean;
var
Colors: Array of integer;
UpText: string;
begin
if not (LoggedIn) then Exit;
case Lowercase(treetype) of
'normal': Colors := [1854786, 3567717, 1062703];
'oak': Colors := [1922889, 4624516, 2516570];
'willow': Colors := [6919048, 2441789, 5010788];
'maple': Colors := [3495048, 1451327, 2176088];
'yew': Colors := [2120012, 2648669, 4228986];
'magic': Colors := [10479596, 4623230, 2186320];
end else
begin
writeln('Tree type selected is not supported.');
exit;
end;
UpText := copy(treetype, 2, High(treetype)); // this takes the first letter off from treetype and saves it to variable UpText, willow -> illow
if FindObjCustom(x, y, [UpText], Colors, 5) then
begin
result := true;
if Chop then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, false);
result := WaitOption('p down', 500+random(100));
end;
end;
end;

Keep up the good work, but don't make things too complicated! :)

Runaway

2009-08-22 20:12:34

Thanks so much marpis!

oh, and I use Cop_wait because it is much more random than using wait(100+random(100));.

If you input Cop_wait(1000), the output can be between 1000 and 1820.

Runaway

2009-08-23 21:28:37

From: Smarter Child
I personally use TPA for tree finding, but nevertheless Runaway Cop, a good effort.

Edit : :D

Edit2: But I don't think this will be added to SRL :(


I know it won't be added to SRL :P
just wanted to throw it out there just in case someone wanted to save some time and use my pre-made antiban or somethin like that :)

EDIT: sorry for double post :O

marpis

2009-08-23 22:48:29

From: Runaway Cop
Thanks so much marpis!

oh, and I use Cop_wait because it is much more random than using wait(100+random(100));.

If you input Cop_wait(1000), the output can be between 1000 and 1820.


= wait(1000+random(1820))

noidea

2009-08-23 22:59:24

From: marpis
= wait(1000+random(1820))

= wait(100+random(820));

Torrent of Flame

2009-08-23 23:01:31

Arent people meant to make their own tree finding? Includes are to help you, not do everything FOR you ;)

Baked0420

2009-08-23 23:08:53

=wait(1000+random(821)), he said 1000ms nodiea, and you gotta put the random one number higher. But anyway, good job Runaway, I have a group of procedures/functions also in my includes folder :p.

Tickyy

2009-08-23 23:24:09

Very nice stuff over there… like most of them.

and to be honest, one of them is useless, which is the findtree function. i am sure that most of us use our very own finding procedures and functions, not because yours is slow, but i think people won't use it.

Runaway

2009-08-24 03:15:02

From: Tickyy
Very nice stuff over there… like most of them.

and to be honest, one of them is useless, which is the findtree function. i am sure that most of us use our very own finding procedures and functions, not because yours is slow, but i think people won't use it.


It's fine if people don't use it. I just wanted to put it out there in case someone actually DOES :)