Would anyone mind hopping on MSN and helping me with script I'm writing?
My MSN = rolyatcire2@aol.com
Would anyone mind hopping on MSN and helping me with script I'm writing?
My MSN = rolyatcire2@aol.com
Although MSN is a great way to get some 1 on 1 help with scripts and be a bit more personal, It's also a lot faster to just post your problem here on the Help Board so ALL of the members of SRL can see it.
That way you can possibly get faster help (if your MSN buddy isn't online), and lots of different viewpoints from all different types of scripters, that way you can see which method is actually the best.
Ok, well here goes then.
program New;
{.include SRL/SRL.scar}
function AutoColorCow1: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 0.15);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 3294297, MSX1, MSY1, MSX2, MSY2, 6);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 4.35) and (X <= 9.82) and (Y >= 4.15) and (Y <= 9.35) and (Z >= 2.56) and (Z <= 5.44) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
function AttackCow: Boolean;
var
TPALength, x, y, i, Cow1, centerX, centerY : Integer;
MyTPA : TPointArray;
MyPoint : TPoint;
begin
TPALength := Length(MyTPA);
Cow1 := AutoColorCow1;
centerX := MSCX;
centerY := MSCY;
FindColorsSpiralTolerance(centerX, centerY, MyTPA, Cow1, MSx1, MSy1, MSx2, MSy2, 10);
if Length(MyTPA) > 0 then
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i]
MMouse (MyPoint.x, MyPoint.y, 3, 3);
if WaitUpText('ttack ow', 400) then
begin
Mouse(Mypoint.x, MyPoint.y, 0, 0, True);
Result := True;
Wait(5000 + Random(1000));
end;
end;
end;
begin
AttackCow;
end.
Please ignore standards and the fact that this isn't doing much atm. I am trying to make a autofighter that will bank at Beefy Bill. As you can see I have not gotten very far, but I'm working on it. So my problem is that for whatever reason when I run this script it will attempt to move my mouse to the cow I'm targeting, but it moves VERY slow! Now I'm not sure what is causing this but any help would be appreciated. Also any tips on how to make a good autofighter would be nice as I'm just looking through tuts, but not finding any that would help to much.
E: When I copied my script it was somewhat formatted correctly, but in post it's lined along the left. Any way to change this?
Yes, use [SCAR.][/SCAR] Tags (without that period I put in there)
And to fix your problem, your forgot SetupSRL.
SCAR Code:begin
SetupSRL
AttackCow;
end.
<3 GoodLuck, Semi-Tough script to make, but dont give up!
It's just hard beacuse the area you are working with is quite large, hard to walk from cow to cow, and then bill, but it's going to be a fun script to make!
MakeCompass('N');
N S E W are the possible parameters, you can also you decimal degree things I think, like 90
E:![]()
Ok, thanks a bunch! Hopefully I will start to get proficient with this stuff soon.
There are currently 1 users browsing this thread. (0 members and 1 guests)