SRL Archive - SRL Suggestions

Runespan Siphon Function


Vinyl Scratch

2012-07-31 22:32:37

function Siphon(EsslingUpText:TStringArray; Color, Tol:integer; Hue, Sat:extended): Boolean;
var
Data:TIntegerArray;
TPA: TPointArray;
ATPA: Array of TPointArray;
Box:Tbox;
x,y: Integer;
begin
SetLength(Data, 4);
Data[3]:=GetColorToleranceSpeed;
ColorToleranceSpeed(2);
ColorToleranceSpeed(Data[3]);
ATPA:= TPAToATPAEx(TPA, 15, 15);
Data[1]:=High(ATPA);
for Data[0] := 0 to Data[1] do
begin
MiddleTPAEx(ATPA[Data[0]], x, y);
Box.X1:=x;
Box.Y1:=y;
Box.X2:=x+2;
Box.Y2:=y+2;
MouseTBox(Box, Move);
if WaitUpTextMulti(EsslingUptext, 300) then
begin
case Random(2) of
0: begin
ClickMouse2(True);
if(DidRedClick())then
Wait(RandomRange(28000, 32000));
Break;
end;
1: begin
ClickMouse2(False);
Wait(Randomrange(28000, 30000))
else
FindRandoms;
Break;
end;
end;
begin
Result:= True;
end;
end;
end;
end;

My function that I made, wanted to see if you guys wanted to add it to the SRL include, for Runecrafting, idk. I just wanted to contribute to SRL, along with the community. I'm going to make more functions. ;)

NKN

2012-07-31 22:33:20

I don't think things that skill-defined are in the SRL Include? o.O

SetLength(Data, 4);
Data[3]:=GetColorToleranceSpeed;
ColorToleranceSpeed(2);
ColorToleranceSpeed(Data[3]);
Correct me if I'm wrong, but doesn't that just change it back to what it was previously?

Mat

2012-08-01 08:07:06

I agree with NKN I'm sure its not skill defined.

CephaXz

2012-08-01 08:26:48

From: NKN
I don't think things that skill-defined are in the SRL Include? o.O

SetLength(Data, 4);
Data[3]:=GetColorToleranceSpeed;
ColorToleranceSpeed(2);
ColorToleranceSpeed(Data[3]);
Correct me if I'm wrong, but doesn't that just change it back to what it was previously?


Yes it does LOL.

Btw, what are these for? Just wondering, cuz I don't quite understand everything :p
 Color, Tol:integer; Hue, Sat:extended

You're waiting from 28 to 32 seconds, but what if its gone in just 5 seconds? You're doing nothing for 23 to 27 seconds? I think maybe use a better function than simply just waits :D

In the case statement, the second case, you're trying to right click and wait, choosing no options. With the else there, I don't think it compiles.

P1ng

2012-08-01 08:33:27

There is indeed a skill specific section.
Simba > Includes > SRL > SRL > Skill > Runecrafting.simba

Not against the idea, just have a few queries about your TPA function I'd like you to clear up
function Siphon(EsslingUpText:TStringArray; Color, Tol:integer; Hue, Sat:extended): Boolean;
var
Data:TIntegerArray;
TPA: TPointArray;
ATPA: Array of TPointArray;
Box:Tbox;
x,y: Integer;
begin
SetLength(Data, 4); // why u no use Data[2]? :(
Data[3]:=GetColorToleranceSpeed;
ColorToleranceSpeed(2); // changes to 2
ColorToleranceSpeed(Data[3]); // then immediately changed it back?
ATPA:= TPAToATPAEx(TPA, 15, 15); //no finding color anywhere to make TPA?
Data[1]:=High(ATPA);
for Data[0] := 0 to Data[1] do
begin
MiddleTPAEx(ATPA[Data[0]], x, y);
Box.X1:=x; //Lots of code
Box.Y1:=y; // that could be replaced with
Box.X2:=x+2; // MMouse(x,y,2,2);
Box.Y2:=y+2; //
MouseTBox(Box, Move); //
if WaitUpTextMulti(EsslingUptext, 300) then
begin
case Random(2) of
0: begin
ClickMouse2(True);
if(DidRedClick())then
Wait(RandomRange(28000, 32000));
Break;
end;
1: begin
ClickMouse2(False); // right click then just wait 28sec?
Wait(Randomrange(28000, 30000))
else // no if..then?
FindRandoms;
Break;
end;
end;
begin // un-neccessary begin
Result:= True;
end; // and end
end;
end;
end;


Got kind of bored so I filled in what I think the blanks should be.
function Siphon(UpText: TStringArray; Color, Tol: Integer; HMod, SMod: Extended): Boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
CTS, i, x, y: Integer;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(HMod, SMod);
if FindColorsSpiralTolerance(x, y, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tol) then
begin
SortTPAFrom(TPA, Point(MSCx, MSCy));
ATPA := TPAToATPAEx(TPA, 15, 15);
for i := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, RandomRange( - 2, 2), RandomRange( - 2, 2));
if WaitUpTextMulti(UpText, 1500) then
begin
case Random(2) of
0:
begin
ClickMouse2(True);
if (DidRedClick()) then
begin
Result := True;
Wait(RandomRange(28000, 32000));
Break;
end
else
begin
FindNormalRandoms;
Result := False;
end;
end;
1:
begin
ClickMouse2(False);
if WaitOption('ipho', 1500) then
begin
Result := True;
Wait(Randomrange(28000, 30000));
Break;
end
else
begin
FindNormalRandoms;
Result := False;
end;
end;
end;
end;
end;
end;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

Joe

2012-08-01 09:30:41

It could go in the animation section… there is infight which is combat specific.
We should seriously think about adding animation detection for each skill

Kyle Undefined

2012-08-01 10:22:43

Is it a generic function? If it is, might want to change the names of some the the variables and parameters.

I rather see it go into SRL Snippits.