Results 1 to 15 of 15

Thread: I'm STUCK!!! :(

  1. #1
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default I'm STUCK!!! :(

    OK

    I've made a script that does all of tutorial island pretty well, except this one stupid door. The problem is, the door stays open or closed depending on if someone has clicked on it or not. I made a tpa function that doesn't return true until it opens the door (if it was closed, it would open it and return true. if it was open, it would close it, return false, open it, then return true.) BUT the tpa would take like 20 minutes to find the door and it even when it right clicked, the chooseoption would return false most of the time when the open and close options were actually there! So does anyone have any idea how i can get through this door so I can end this nightmare and submit my SRL application...

    Here's some information that may help...

    Door closed:


    Door open:


    My function
    SCAR Code:
    function OpenDoor() : boolean;
    var
       MyTPA : TPointArray;
       x,y,i : Integer;
    begin
         writeln('Looking for door...');
         writeln('Trying first color');
         FindColorsSpiralTolerance(234,153,MyTPA, 3293259, 0, 20, 500, 270, 10);
         if Length(MyTPA) = 0 then
         begin
              writeln('Trying second color');
              FindColorsSpiralTolerance(234,153,MyTPA, 3754069, 0, 20, 500, 270, 10);
              if Length(MyTPA)=0 then
              begin
                   writeln('Trying thrid color');
                   FindColorsSpiralTolerance(234,153,MyTPA, 5532284, 0, 20, 500, 270, 10);
                   if Length(MyTPA)=0 then
                      begin
                           writeln('Trying fourth color');
                           FindColorsSpiralTolerance(234,153,MyTPA, 2963779, 0, 20, 500, 270, 10);
                      end;
              end;
         end;
         writeln('Color found!');
         for i:= 0 to High(MyTPA)do
         begin
              MMouse(MyTPA[i].x, MyTPA[i].y,3,3);
              if(IsUpTextMultiCustom(['Church']))then
              begin
                   GetMousePos(x,y);
                   Mouse(x,y,3,3,False);
                   wait(1000+random(300));
                   if (chooseOption('Close Church door'))then
                   begin
                        writeln('The door is open and I closed it');
                        Result := False;
                        Exit;
                   end
                   else
                   begin
                        if (chooseOption('Open Church door')) then
                        begin
                              writeln('The door is closed and i opened it');
                              Result := True;
                              Exit;
                        end
                        else
                        begin
                             writeln('Cant find Open or close, trying again...');
                        end;
                   end;
              end
              else
              begin
                   writeln('bad point');
                   Wait(350+random(350));
              end;
         end;
    end;

    And my call to the function:
    SCAR Code:
    while not (OpenDoor) do
         begin
              writeln('Trying again...');
         end;

    PLEASE help! I am very willing to abandon this function and try something else...
    Last edited by scuz 10; 08-28-2009 at 08:56 AM.

  2. #2
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SpiralMouse() could be the answer to your problems, depending on how exact your walking is.
    “Ignorance, the root and the stem of every evil.”

  3. #3
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    Maybe try using ATPA's and adding a small wait into the while loop.

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  4. #4
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Is there any way to fix my function? it takes FOREVER to find the door

  5. #5
    Join Date
    Feb 2007
    Location
    Alberta, Canada
    Posts
    4,615
    Mentioned
    50 Post(s)
    Quoted
    429 Post(s)

    Default

    maybe calling the function High over and over slows it? I cant help right now, bed time. Look into my tutorial, or other tutorials and learn ATPA's, they are much faster and more accurate.

    Scripts: Edgeville Chop & Bank, GE Merchanting Aid
    Tutorials: How to Dominate the Grand Exchange

    Quote Originally Posted by YoHoJo View Post
    I like hentai.

  6. #6
    Join Date
    Mar 2007
    Posts
    1,700
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Take a look at my tut runner. What my script does is click inside the church, walks, then gets your position and determines whether it is to the left or right of the door using the door on the minimap. If its not inside the church, then the script will find the door on your mainscreen and open it.
    Last edited by lordsaturn; 08-28-2009 at 10:23 AM.

  7. #7
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by lordsaturn View Post
    Take a look at my tut runner. What my script does is click inside the church, walks, then gets your position and determines whether it is to the left or right of the door using the door on the minimap. If its not inside the church, then the script will find the door on your mainscreen and open it.
    Sounds like a good idea, what do you use to get the position? I searched position in the SRL manual and couldn't find anything...

  8. #8
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    try putting
    colortolerancespeed(3);

    before you try to find your color, and reduce the tolerance down to 5-7.

    make sure to put

    colortolerancespeed(1);
    before you try to find text though

    and for finding position, try making a (d)dtm of the walls of the map, then try to decide if the dtm is on the left, or right side of the minimap. you can find some awesome dtm, and ddtm tuts in the intermediate tutorial section
    Last edited by Awkwardsaw; 08-28-2009 at 11:43 AM.
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

  9. #9
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Or if you just cannot do it. Reflection.
    I do visit every 2-6 months

  10. #10
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by 3Garrett3 View Post
    Maybe try using ATPA's and adding a small wait into the while loop.
    Turning the TPA into a ATPA via SplitTPA or TPAtoATPA with a size ~15 or so. Then looping through each TPA in the ATPA would help...

    Also depending on how good your walking is and how close it gets you to the door, you could filter out any points that are further than a certain distance from your character...

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  11. #11
    Join Date
    Mar 2007
    Posts
    1,700
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by scuz 10 View Post
    Sounds like a good idea, what do you use to get the position? I searched position in the SRL manual and couldn't find anything...
    DoorProfiles.scar, your position on the minimap is always MMCX, MMCY

  12. #12
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    2,240
    Mentioned
    3 Post(s)
    Quoted
    11 Post(s)

    Default

    Check the uptext, if its ('close') then the door is open and if its ('open') then the door is closed
    Click here to find out how to get full screen without members! | Click here to check out my Ultimate Bitmap Tutorial! Edited to work with Simba! |

  13. #13
    Join Date
    Sep 2007
    Location
    British Columbia, Canada
    Posts
    4,047
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by cycrosism View Post
    Check the uptext, if its ('close') then the door is open and if its ('open') then the door is closed
    Lol awsome Idea!

    Also, you can try gettext, if can't reach brother, then find door color and open door. If you can, then exit.
    Oh Hai Dar

  14. #14
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by cycrosism View Post
    Check the uptext, if its ('close') then the door is open and if its ('open') then the door is closed
    I did that, the function is REALLY unreliable...

    Most of the time it returns false when the door is actually closed...

  15. #15
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Look at my tut runner, I made it click the arrow first, and then it Gets the church inside colour which is FindRoadColor, then i make it search about 2-3 pixels right of the MM centre and if the roadcolour is not there = not inside church, therfore setangle(true) then find door function.

    Its quite reliable, and if you want an extra failsafe, make it click the Red door colour on MM before searching if in the church.

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
  •