SRL Archive - Help and Support

TPA help


FreakyMonkey

2008-05-01 22:54:39

hey just became a member a few days ago =).

and i dont know if this is the appropriate way i would use this TPA function.

BTW wat it does is that it opens the magic gametab and checks if the high alch colors are "lighted up" suggesting that it has runes

here it is (not sure if i got the right gametab)

function GetAlchColor: Boolean;

var
AlColor,NoAlColor: Tpointarray;
i,col,Nocol: integer;

begin
GetArrayLength(alcolor):=Col;
if not GetCurrentGameTab=6 then
Gametab(6);
if not GetColorToleranceSpeed=2 then
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(x,y,Alcolor,849658,582,369,561,352,5);
for i:=0 to High(Alcolor)do
if col>=3 then
begin
Writeln('High Alch Found!');
Result:=True;
end;
FindCOlorsSprialTOlerance(x,y,Noalcolor,71705,582,369,561,352,150);
GetArrayLength(NoAlColor):=NoCol;
for i:=0 to High(Noalcolor)do
if nocol>=4 then
begin
Writeln('You dont have the sufficent runes to do this spell.');
end;
end;

n3ss3s

2008-05-02 02:49:00

1. GameTab already does the check if it is in the wanted tab.
2. Place the Col := GetArra… After the FindColorsSpiralTolerance that stores the points to the ALColor array so your Col might even become more than 0 ;)

3. Don't do If GetColorToleranceSpeed = 1/2/3 Then, do
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1/2/3)

then in the end of the procedure do ColorToleranceSpeed(CTS) so it gets returned back to the old one, because not everything is degined for HSL even though it is suitable for almost every case…

4. GetArrayLength(NoAlColor):=NoCol; …what? That means you'd be trying to define the result of GetArrayLength, you need to do it visa versa.

FreakyMonkey

2008-05-02 18:30:09

haha srry, about the last number 4, i shoulda seen that one. thanks for the help

R0b0t1

2008-05-03 08:42:33

You've made it too complicated…


program New;
{.include SRL/SRL.scar}
var x, y: Integer;
begin
MouseSpeed:= 12;
repeat
if not FindColorTolerance(x, y, 3195184, 705, 325, 725, 340, 10) then //this
begin
WriteLn('Did not find potion color, stopping!');
WriteLn('Please relocate your mouse and switch to the correct screen.');
repeat
Wait(1);
until(FindColorTolerance(x, y, 3195184, 705, 325, 725, 340, 10))
end;
Mouse(710, 338, Random(5), Random(5), True);
Wait(20+Random(10));
Mouse(710, 338, 0, 0, True);
Wait(2500+Random(1200));
until(IsFKeyDown(12))
end.

http://delphi.pastebin.com/f44b4e6c

ShowerThoughts

2008-05-03 08:44:54


program New;
{.include SRL/SRL.scar}
var x, y: Integer;
begin
MouseSpeed:= 12;
repeat
if not FindColorTolerance(x, y, 3195184, 705, 325, 725, 340, 10) then //this
begin
WriteLn('Did not find potion color, stopping!');
WriteLn('Please relocate your mouse and switch to the correct screen.');
repeat
GameTab(MagicGameTab);//???????????????????????
Wait(1);
until(FindColorTolerance(x, y, 3195184, 705, 325, 725, 340, 10))//endless?
end;
Mouse(710, 338, Random(5), Random(5), True);
Wait(20+Random(10));
Mouse(710, 338, 0, 0, True);
Wait(2500+Random(1200));
until(IsFKeyDown(12))
end.

R0b0t1

2008-05-03 16:32:10

It's not supposed to run w/o a human, thats why I don't have it switch gametabs or anything; if I want to just 'pause' the script, I just switch away from the mage gametab and then go back later.


You really don't think I'm that stupid, do you? Besides, you've gone off topic.


I was trying to show that you could just use a findcolor for what he wanted. The line of code with '//this' by it shows him what to do: look in a little box for the greenish color.



EDIT: Works best if you go into a clanchat and then run this thing… :)