SRL Archive - Help and Support

TPA Help please :0


P1nky

2008-10-27 21:06:13

CODE:
Procedure CurseItUp;
var
Lesser : array [0..4] of integer;
man1: TPointArray;
Lessers: TNPC;
TLesser: TNPC;
P, L: Tpoint;
MSx,MSY, NPC, CTS, I: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
TypeProggie;
Cursed := 0;
begin
CastSpell(12);
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 1.19);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 727117 , MSX1, MSY1, MSX2, MSY2, 15);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MouseSpeed := 9;
MMouse(x, y, 2, 2);
If(IsUpTextMultiCustom(['Lesser','demon'])) then
begin
Mouse(x,y,1,1,False);
ChooseOption('ast')
AlreadyWeakened;
FindRandoms;
end;
end;
end;
end;
end;

Procedure WhileCurse;
var
Lesser : array [0..4] of integer;
man1: TPointArray;
Lessers: TNPC;
TLesser: TNPC;
P, L: Tpoint;
MSx,MSY, NPC, CTS, I: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
repeat
CurseItUp;
RunningFromFights;
case Random(2) of
0: DontBanmeplease;
1: RandomCompass;
end;
FireWorks;
wait(TimeEaCurse + random(1235));
Cursed := Cursed + 1;
ReportVars[1] := ReportVars[1] + 1;
TypeProggie;
CurseItUp;
begin
while (not FindNPC('Lesser', TLesser)) do
Status('Waiting for Lesser to Appear');
repeat
FindRandoms;
DontBanmePlease;
until (FindNPC('Lesser', TLesser));
end;
until(false);
end;

guys sorry for the standards i fix them in the end :)

lol well guys the problem is:

it will cast the curse than it will do antiban or w/e and than keep hovering mouse over and right clicking Lesser multiple times w/o it casting the curse.
and after like 4-5 times it has right clicked it will cast curse and cast it :O?

any idea guys please help, otherwise ill have to use a diffrent style to find monster thanks.

Narcle

2008-10-27 21:12:39

I think you need to call GetMousePos like this:

Edit:
oh I also noticed u use Global x, y? I'd try putting x, y in CurseItUp vars

function CurseItUp: boolean;
var
Lesser: array [0..4] of integer;
man1: TPointArray;
Lessers: TNPC;
TLesser: TNPC;
P, L: Tpoint;
MSx, MSY, NPC, CTS, I: Integer;
TPA: TPointArray;
ATPA: array of TPointArray;
begin
TypeProggie;
Cursed := 0;
begin
CastSpell(12);
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 1.19);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 727117, MSX1, MSY1, MSX2, MSY2, 15);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);
for I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MouseSpeed := 9;
MMouse(x, y, 2, 2);
if (IsUpTextMultiCustom(['Lesser', 'demon'])) then
begin
GetMousePos(x, y);//Added this
Mouse(x, y, 0, 0, False);//changed to 0 randomness
Result := ChooseOption('ast');
AlreadyWeakened;//eh?
FindRandoms;
if Result then
Exit;
end;
end;
end;
end;
end;

procedure WhileCurse;
var
Lesser: array [0..4] of integer;
man1: TPointArray;
Lessers: TNPC;
TLesser: TNPC;
P, L: Tpoint;
MSx, MSY, NPC, CTS, I: Integer;
TPA: TPointArray;
ATPA: array of TPointArray;
begin
repeat
CurseItUp;
RunningFromFights;
case Random(2) of
0: DontBanmeplease;
1: RandomCompass;
end;
FireWorks;
wait(TimeEaCurse + random(1235));
Cursed := Cursed + 1;
ReportVars[1] := ReportVars[1] + 1;
TypeProggie;
CurseItUp;
begin
while (not FindNPC('Lesser', TLesser)) do
Status('Waiting for Lesser to Appear');
repeat
FindRandoms;
DontBanmePlease;
until (FindNPC('Lesser', TLesser));
end;
until (false);
end;

P1nky

2008-10-27 21:15:51

Thanks Narcle, let me give it a test :)

and AlreadyWeaken is a different proc.

though let me give a test and than ill edit.
and thanks for the standarized version :P

Narcle

2008-10-27 21:18:02

Oh and I'd do this to help confirm the attack:

function CurseItUp: boolean;
Result := ChooseOption('ast');

Actually that's why it keeps clicking, you don't break out the loop.

so add
if Result then Exit;
as well

Edited my first post.

P1nky

2008-10-27 21:27:42

Narcle Thanks very much m8 Rep++

before you edited it worked, though it sounds more reasonable of the results so ill add that and make those 2 procs into 1 :)
thanks alot once again :P

EvilChicken!

2008-10-28 02:37:12

{.include SRL/SRL.scar}

function CurseItUp: Boolean;
var
Lessers, TLesser: TNPC;
ATPA: T2DPointArray;
TPA, Man1: TPointArray;
P, L: TPoint;
Lesser: array [0..4] of Integer;
MSx, MSY, NPC, CTS, I: Integer;
MouseSpeed: Byte;

begin
TypeProggie;
Cursed := 0;
begin
CastSpell(12);
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 1.19);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 727117, MSX1, MSY1, MSX2, MSY2, 15);
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2); // <-
ATPA := TPAToATPAEx(TPA, 15, 15); // Aren't lesser demons bigger ..?
MouseSp := MouseSpeed;
MouseSpeed := 30; // Better.
for I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], X, Y);
MMouse(X, Y, 2, 2); // Should inc andomness
Wait(170 + Random(175)) // Always needs a wait.
if Pos('esser', RS_GetUpText) > 0 then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
Result := ChooseOption('ast');
AlreadyWeakened; //eh?
FindRandoms;
if Result then
Exit;
end;
end;
end;
end;
end;

procedure WhileCurse;
var
Lessers, TLesser: TNPC;
ATPA: T2DPointArray;
TPA, Man1: TPointArray;
P, L: Tpoint;
Lesser: array [0..4] of integer;
MSx, MSY, NPC, CTS, I: Integer;

begin
repeat
CurseItUp;
RunningFromFights;
if Random(2) = 0 then
DontBanmeplease
else RandomCompass;
FireWorks;
Wait(TimeEaCurse + random(1235));
Inc(Cursed);
Inc(ReportVars[1]);
TypeProggie;
CurseItUp;
if not FindNPC('Lesser', TLesser) then // Flaw here, fixed.
begin
Status('Waiting for Lesser to Appear');
repeat
FindRandoms;
DontBanmePlease;
until FindNPC('Lesser', TLesser);
end;
until False;
end;

begin
end.


Found some flaws, this should work a tiny bit better. :)

Claymore

2008-10-28 20:51:42


ATPA := TPAToATPAEx(TPA, 15, 15); // Aren't lesser demons bigger ..?

Should be atleast 25, 40. Anyways who cares, ;p


MouseSpeed := RandomRange(30, 35); // Better-er ;p.

P1nky

2008-10-28 23:20:29

Appreciate it guys :)
now ill give it a test and give the results 2mooro lol, sleepy atm.

Naum

2008-10-29 03:36:41

Shouldn't it be

Result := (ChooseOption('ast') = True);

?

EvilChicken!

2008-10-29 05:17:01

From: NaumanAkhlaQ
Shouldn't it be

Result := (ChooseOption('ast') = True);

?


No ..?
If if fails to ChoseOption('Cast'), then the result is false.
If it succeeds, then the result is true.

Naum

2008-10-29 05:40:28

Ahh okay. My bad.

n3ss3s

2008-10-29 09:16:16

Don't do the ColorToleranceSpeed retrieval routines if you haven't changed it anywhere earlier, just do ColorToleranceSpeed(2) and in the end, ColorToleranceSpeed(1). Makes it look a lot cleaner.

Also, I sure hope this will also be fixed when you fix your standards -


begin
CastSpell(12);
begin


;)

Claymore

2008-10-29 18:51:07

so the CTS is always 1?

Cazax

2008-10-30 16:44:09

From: Deathscytex
so the CTS is always 1?


SCAR starts with CTS 1.