SRL Archive - OSR Help

Help with script


Spotify

2014-07-11 02:41:05

Hey guys, so I'm trying to combine some of my code into smaller procedure(and fewer) so it doesn't look so messy and unprofessional. I'm currently using things like this and it's repetitive and incredibly messy. If it helps, I'm using an input query to to determine whether a guard or hero is going to be thieved. Is there a way to combine these two procedures?

Procedure PickPocketGuard;
var
x, y:Integer;
Begin
Mouse(615, 21, 3, 3, true);
KeyDown(38);
Wait(1500);
KeyUp(38);
repeat
repeat
KeyDown(37);
until(FindColorTolerance(X, y, 2248736, msx1, msy1, msx2, msy2, 5));

Begin
KeyUp(37);
if FindObjEx(X, y, ['1IIac4'], [2248736], 5, 50, 155, 126, 546, 350) then
Begin
MoveMouse(X, y);
Wait(50);
ClickMouse(X, y, 0);
Wait(100);
ClickPickPocket;
Wait(100);
Stunned;
Status := 'stealin geepee';
ProggyGuard;
Wait(1000);
End;
End;
until(Iskeydown(113));
End;

Procedure PickPocketHero;
var
x, y:Integer;
Begin
Mouse(615, 21, 3, 3, true);
KeyDown(38);
Wait(1500);
KeyUp(38);
repeat
repeat
KeyDown(37);
until(FindColorTolerance(X, y, 12293239, msx1, msy1, msx2, msy2, 5));

Begin
KeyUp(37);
if FindObjEx(X, y, ['1IIac4'], [12293239], 5, 50, 155, 126, 546, 350) then
Begin
MoveMouse(X, y);
Wait(50);
ClickMouse(X, y, 0);
Wait(100);
ClickPickPocket;
Wait(100);
Stunned;
Status := 'Stealin Stuff';
ProggyHero;
Wait(1000);
End;
End;
until(Iskeydown(113));
End;

KeepBotting

2014-07-11 08:01:30

You could use a case statement for your input query, like case(keydown) of 113:, 114: or w/e

Wire

2014-07-11 08:43:23

Maybe something like that, couldn't really test it as i'm typing this in the browser. None the less its for a general idea and may or may not be useful in this occasion.
program new;
var
X, Y, ColorCode: Integer;
Guard, Hero:String

procedure SetUp;
begin
PickTarget:='Hero'; //TargetName in this case either Guard or Hero
end;

procedure Loads;
begin
case PickTarget of
'Guard':
ColorCode:=2248736
'Hero':
ColorCode:=12293239

end;


procedure FindTarget;
begin
Mouse(615, 21, 3, 3, true);
KeyDown(38);
Wait(1500);
KeyUp(38);
repeat
KeyDown(37);
until(FindColorTolerance(X, y, ColorCode, msx1, msy1, msx2, msy2, 5));
end;

procedure PickPocket;
begin
FindTarget;
KeyUp(37);
if FindObjEx(X, y, ['1IIac4'], [ColorCode], 5, 50, 155, 126, 546, 350) then
begin
MoveMouse(X, y);
Wait(50);
ClickMouse(X, y, 0);
Wait(100);
ClickPickPocket;
Wait(100);
Stunned;
Status := 'stealin geepee';
ProggyGuard;
Wait(1000);
end;
until(Iskeydown(113));
end;


begin
end.

Spotify

2014-07-11 16:36:39

Thanks @Wire

That was just the answer I was looking for :)

The Mayor

2014-07-11 17:40:51

From: Spotify
Thanks @Wire

That was just the answer I was looking for :)


Mention like so:

[.MENTION] name [./MENTION]

KeepBotting

2014-07-13 21:03:35

From: The Mayor
Mention like so:

[.MENTION] name [./MENTION]
that's the slow way,

easiest way is

(at) their name (semicolon)

@ The Mayor ;

@The Mayor;