Results 1 to 5 of 5

Thread: Autocoloring procedures help

  1. #1
    Join Date
    Jun 2007
    Location
    I'm not sure...
    Posts
    581
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Autocoloring procedures help

    Hiya, I have some autocoloring procedures that I need help with. They are for my banana autoquester and when I get these done and tested, it'll be a finished script!! Yay!

    Here they are:

    SCAR Code:
    Function GetFeildColor:Integer;
      Var q:TPoint;
          i:Integer;
      Begin
        LoginCheck;
        MakeCompass('n');
        Result:=2596502;
        ddtmarea:=1;
        ddtmtol:=20;
        LoadDTMs;
        For i:=0 to 5 do
        Begin
          IF (FindDTM(BFeild,q.x,q.y,MMX1,MMY1,MMX2,MMY2)) Then
            Begin
              MMouse(q.x+30,q.y+30,2,2);
              Result:=GetColor(q.x,q.y);
              FreeDTMs;
              Exit;
            End;
          Inc(ddtmarea);
          ddtmtol:=ddtmtol+5;
        End;
        Writeln('Trouble autocoloring the feild...');
        FreeDTMs;
      End;

    Function GetLuthasMMColor:Integer;
       Var q:TPoint;
          i:Integer;
      Begin
        LoginCheck;
        MakeCompass('n');
        Result:=195836;
        ddtmarea:=1;
        ddtmtol:=20;
        LoadDTMs;
        For i:=0 to 5 do
        Begin
          IF (FindDTM(LuthasMM,q.x,q.y,MMX1,MMY1,MMX2,MMY2)) Then
            Begin
              MMouse(q.x+30,q.y+30,2,2);
              Result:=GetColor(q.x,q.y);
              FreeDTMs;
              Exit;
            End;
          Inc(ddtmarea);
          ddtmtol:=ddtmtol+5;
        End;
        Writeln('Trouble autocoloring luthas on the minimap...');
        FreeDTMs;
      End;

    Function GetOutsideHouseColor:Integer;
      Var q:TPoint;
          i:Integer;
      Begin
        LoginCheck;
        MakeCompass('n');
        Result:=FindRoadColor;
        ddtmarea:=1;
        ddtmtol:=20;
        LoadDTMs;
        For i:=0 to 5 do
        Begin
          IF (FindDTM(OutHouse,q.x,q.y,MMX1,MMY1,MMX2,MMY2)) Then
            Begin
              MMouse(q.x+30,q.y+30,2,2);
              Result:=GetColor(q.x,q.y);
              FreeDTMs;
              Exit;
            End;
          Inc(ddtmarea);
          ddtmtol:=ddtmtol+5;
        End;
        Writeln('Trouble autocoloring the outside of the house...');
        FreeDTMs;
      End;

    Here are the DDTM's used in those proc's:

    SCAR Code:
    Procedure LoadDTMs;
      Begin
        BFMP.x:=622;//Bananafeild
        BFMP.y:=433;
        BFMP.areasize:=1;
        BFMP.areashape:=0;
        BFMP.color:= 346978;
        BFMP.tolerance:= ddtmtol;

        BFSP[0].x:= 632;
        BFSP[0].y:= 433;
        BFSP[0].areasize:=ddtmarea;
        BFSP[0].areashape:=0;
        BFSP[0].color:= 933217;
        BFSP[0].tolerance:= ddtmtol;

        BFSP[1].x:= 617;
        BFSP[1].y:= 449;
        BFSP[1].areasize:=ddtmarea;
        BFSP[1].areashape:=0;
        BFSP[1].color:= 3630145;
        BFSP[1].tolerance:= ddtmtol;

        BFSP[2].x:= 634;
        BFSP[2].y:= 431;
        BFSP[2].areasize:=ddtmarea;
        BFSP[2].areashape:=0;
        BFSP[2].color:= 15462116;
        BFSP[2].tolerance:= ddtmtol;

        BFSP[3].x:= 634;
        BFSP[3].y:= 439;
        BFSP[3].areasize:=ddtmarea;
        BFSP[3].areashape:=0;
        BFSP[3].color:= 15462116;
        BFSP[3].tolerance:= ddtmtol;

        BFSkel.MainPoint:=BFMP;
        BFSkel.SubPoints:=BFSP;
        //end defining bananafeild

        LMMP.x:=537;//LuthasMM
        LMMP.y:=365;
        LMMP.areasize:=1;
        LMMP.areashape:=0;
        LMMP.color:= 60909;
        LMMP.tolerance:= ddtmtol;

        LMSP[0].x:= 535;
        LMSP[0].y:= 365;
        LMSP[0].areasize:=ddtmarea;
        LMSP[0].areashape:=0;
        LMSP[0].color:= 195836;
        LMSP[0].tolerance:= ddtmtol;

        LMSP[1].x:= 617;
        LMSP[1].y:= 449;
        LMSP[1].areasize:=ddtmarea;
        LMSP[1].areashape:=0;
        LMSP[1].color:= 3630145;
        LMSP[1].tolerance:= ddtmtol;

        LMSkel.MainPoint:=LMMP;
        LMSkel.SubPoints:=LMSP;
        //end defining LuthasMM

        OHMP.x:=529;//OutHouse
        OHMP.y:=382;
        OHMP.areasize:=ddtmarea;
        OHMP.areashape:=0;
        OHMP.color:= 344686;
        OHMP.tolerance:= ddtmtol;

        OHSP[0].x:= 522;
        OHSP[0].y:= 380;
        OHSP[0].areasize:=ddtmarea;
        OHSP[0].areashape:=0;
        OHSP[0].color:= 15462116;
        OHSP[0].tolerance:= ddtmtol;

        OHSP[1].x:= 536;
        OHSP[1].y:= 380;
        OHSP[1].areasize:=ddtmarea;
        OHSP[1].areashape:=0;
        OHSP[1].color:= 15462116;
        OHSP[1].tolerance:= ddtmtol;

        OHSP[2].x:= 548;
        OHSP[2].y:= 379;
        OHSP[2].areasize:=ddtmarea;
        OHSP[2].areashape:=0;
        OHSP[2].color:= 15462116;
        OHSP[2].tolerance:= ddtmtol;

        OHSP[3].x:= 510;
        OHSP[3].y:= 380;
        OHSP[3].areasize:=ddtmarea;
        OHSP[3].areashape:=0;
        OHSP[3].color:= 15462116;
        OHSP[3].tolerance:= ddtmtol;

        OHSkel.MainPoint:=OHMP;
        OHSkel.SubPoints:=OHSP;
        //end defining OutHouse

        BFeild:=AddDTM(BFSkel);
        LuthasMM:= AddDTM(LMSkel);
        OutHouse:= AddDTM(OHSkel);
      End;

    The rest of my script seemed to be working ok, but when I tested these procedures, they gave me their error messages XP Please help.
    ---------------------------------------------------------


    Pm me if you need any math functions made. Me = l0ving t3h mathz

    ---------------------------------------------------------

  2. #2
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you need help? i think this wrong topic...
    ~Hermen

  3. #3
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hermpie what the heck are you talking about? He needs help, so he's in the Scripting Help Forum... As for your problem, do none of them work? Or does one work and not the other three? Also, it could be that your tolerance isn't high enough, i know its already at 20, but i normally use 40 for my DDTM's...

  4. #4
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    yes, there should be something wrong with your DDTMs.
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  5. #5
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Plus, if it finds one of them its going to free all of the DTMS so, it wont find any of the other ones, since it frees all of them.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Autocoloring with RGB,HSL and XYZ!
    By Cazax in forum OSR Advanced Scripting Tutorials
    Replies: 67
    Last Post: 09-03-2008, 09:19 PM
  2. autocoloring
    By Shuttleu in forum OSR Help
    Replies: 0
    Last Post: 04-19-2008, 10:42 PM
  3. Help with autocoloring...
    By rockman in forum OSR Help
    Replies: 5
    Last Post: 01-24-2008, 11:30 PM
  4. Autocoloring
    By Jackrawl in forum OSR Help
    Replies: 7
    Last Post: 11-11-2007, 03:11 AM

Posting Permissions

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