Results 1 to 8 of 8

Thread: Help

  1. #1
    Join Date
    Feb 2010
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help

    Would anyone mind hopping on MSN and helping me with script I'm writing?

    My MSN = rolyatcire2@aol.com

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    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.

  3. #3
    Join Date
    Feb 2010
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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?

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    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!

  5. #5
    Join Date
    Feb 2010
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    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!
    ... Fail! Well that was an embarrassing moment. Also how would I be able to rotate the screen to find a color?

  6. #6
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by keller View Post
    ... Fail! Well that was an embarrassing moment. Also how would I be able to rotate the screen to find a color?
    MakeCompass(Direction: Variant);

    I believe it takes Integer values as well for specific degree rotations. N, E, S, W are all strings though.

  7. #7
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    MakeCompass('N');

    N S E W are the possible parameters, you can also you decimal degree things I think, like 90

    E:

  8. #8
    Join Date
    Feb 2010
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, thanks a bunch! Hopefully I will start to get proficient with this stuff soon.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •