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)
————————————————————————
procedure Cop_mouse(x, y: integer; leftclick: boolean)
————————————————————————
procedure Cop_antiban(skill: string; randomtalker: boolean)
————————————————————————
procedure Cop_dropload(itemcolor: integer)
————————————————————————
function Cop_findtree(treetype: string; leftclick: boolean): boolean
————————————————————————
Yay!
Enjoy them, I have found them to be quite useful making different kinds of scripts!
-Runaway
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