Results 1 to 8 of 8

Thread: why is findcolor and findbitmap malfunctioning

  1. #1
    Join Date
    Sep 2006
    Location
    Scripter's Heaven
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default why is findcolor and findbitmap malfunctioning

    not that they produce an error, but look at this script, it is supposed to find the arrow in the tutorial island after creating a random character. but, it just wont find those colors. if i pause the screen in the middle of it running and put the color picker over some of the colors in the arrow, they match up exactly with the ones in my program. plz help

    (includes a gaussian distribution generator, and a modified login procedure, so put them in your includes folder.

  2. #2
    Join Date
    Aug 2006
    Location
    London
    Posts
    2,021
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    the find color functions have parimiters which you choose a square to search the color in, make sure the color is in that square

    "FindColor(var x,y:integer;color,Xs,Ys,Xe,Ye:integer)"

    also make sure you drag the crosshair over the window
    Join the Official SRL IRC channel. Learn how to Here.

  3. #3
    Join Date
    Sep 2006
    Location
    Scripter's Heaven
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i did, the square was the runescape window, do x1 and y1 have to be smaller than x2 and y2, respectively?

  4. #4
    Join Date
    Aug 2006
    Location
    London
    Posts
    2,021
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    no, x2 and y2 are bigger
    PHP Code:
    x1,y1-------------
    [                  ]
    [                  ]
    [                  ]
    ---------------
    x2,y2 
    also, is your screen settings on 32-bit True color?
    Join the Official SRL IRC channel. Learn how to Here.

  5. #5
    Join Date
    Feb 2006
    Location
    Under a rock.
    Posts
    1,351
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    You left your password in the script, I changed it, and PM'ed you the new one.
    SRL Developer
    ◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘◘

  6. #6
    Join Date
    Sep 2006
    Location
    Scripter's Heaven
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok, so do y2 and x2 HAVE to be bigger?

    ps thnks cheesehunk

  7. #7
    Join Date
    Aug 2006
    Location
    London
    Posts
    2,021
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default

    yes they do, but i dont think thats the problem, is your screen set on 32-bit true color

    find that out by going to start > control panal > display > settings

    scar only works on 32-bit
    Join the Official SRL IRC channel. Learn how to Here.

  8. #8
    Join Date
    Sep 2006
    Location
    Scripter's Heaven
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yup, it is 32 bit color, and i updated it to use global constants for the main screen. why isnt it working? for some reason it finds the color, but thinks its at 0,0.
    WARNING: this will make the mouse click in the upper left hand corner 10 time AND THEN GO INSANE!. IT WILL BE GLUED TO ONE SPOT, benmouse has about a 50-50 percent chance of making an error report. even when the script is finished, the mouse will still be insane. YOU HAVE TO EXIT SCAR TO MAKE IT STOP.
    Code:
    {=========================================================================]
    [                   SRL Empty Template.                                   ]
    [                                                                         ]
    [           NAME        : Lardmaster's tutorial master.                   ]
    [           WRITER      : Lardmaster                                      ]
    [           CATEGORY    : Tutorial                                        ]
    [           DESCRIPTION : Does the tutorial for you                       ]
    [           USAGE       : Guess                                           ]
    [           AUTOCOLOR   : Yes                                             ]
    [           NOTES       : I dont know if it will work                     ]
    [           CONTACT     : WTFakawi@hotmail.com                            ]
    [                                                                         ]
    [                                                                         ]
    [=========================================================================]
    [         This is a not empty Template for a Collecting Script            ]
    [=========================================================================]
    [                           Instructions.                                 ]
    [=========================================================================]
    [ 1. USE Runescape with Low Detail, Very Bright.                          ]
    [ 2. Set your Screen to 32 bit TRUE color.                                ]
    [ 3. Set Playernames and Passwords in DeclarePlayers.                     ]
    [ 4. SET HOWMANYPLAYERS inside DeclarePlayers                             ]
    [ 5. Start script Logged Out!                                             ]
    [=========================================================================}
    
    program Tutorial;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/core/LardLogin.scar}
    
    
    //******************** Set These Constants if Needed  *******************//
    
    const StartPlayer         = 0;     // Determines who will play first
    
    //**********************RuneScape Constants*******************************//
    
    
    //************************************************************************//
    const VersionNumber       = '2';      // Compliant with Rev 568+
    //************************************************************************//
    
    Procedure DeclarePlayers;
    begin
         HowManyPlayers  :=6;               // Set Number of Players here.
         NumberOfPlayers(HowManyPlayers);   // Sets the Players Array Length;
         CurrentPlayer:=StartPlayer;        // CurrentPlayer = Array Index
    
         Players[0].Name :='lardfriend55';
         Players[0].Pass :='dontyouwishyouknewthepasstoalvl3atthebeginingofthetutorial?';
         Players[0].Nick :='Lard';
         Players[0].Loc  :='tutorial island';
         Players[0].Skill:='tut';
         Players[0].Active:=True;
    
         Players[1].Name :='';
         Players[1].Pass :='';
         Players[1].Nick :='';
         Players[1].Loc  :='Tutorial island';
         Players[1].Skill:='';
         Players[1].Active:=True;
    
         Players[2].Name :='';
         Players[2].Pass :='';
         Players[2].Nick :='';
         Players[2].Loc  :='Tutorial island';
         Players[2].Skill:='';
         Players[2].Active:=True;
    
         Players[3].Name :='';
         Players[3].Pass :='';
         Players[3].Nick :='';
         Players[3].Loc  :='Loc1';
         Players[3].Skill:='';
         Players[3].Active:=True;
    
         Players[4].Name :='';
         Players[4].Pass :='';
         Players[4].Nick :='';
         Players[4].Loc  :='Loc1';
         Players[4].Skill:='';
         Players[4].Active:=True;
    
         Players[5].Name :='';
         Players[5].Pass :='';
         Players[5].Nick :='';
         Players[5].Loc  :='Loc1';
         Players[5].Skill:='';
         Players[5].Active:=True;
    
         writeln(inttostr(HowManyPlayers)+' Players');
    
    end;
    
    //************************************************************************//
    
    procedure PlayerStats;
    
    var Active: string;
    var i: Integer;
    begin
    writeln('**********************************************');
    writeln('Name         : '+ Players[CurrentPlayer].Name);
    writeln('Number       : '+ inttostr(CurrentPlayer));
    writeln('Worked for   : '+ inttostr(Players[CurrentPlayer].Worked)+' minutes.');
    if Players[CurrentPlayer].Active=True then Active:='True' else Active:='False';
    writeln('Active       : '+ Active);
    writeln('Location     : '+ Players[CurrentPlayer].loc);
    writeln('**********************************************');
    
    for i := 0 to HowManyPlayers-1 do
       begin
       if Players[i].Active=True then Active:='True' else Active:='False';
          writeln( (inttostr(i))+' : '+Players[i].name+ ' = '+Active+'. - Lvl : '+inttostr(Players[i].Level[15])+
          ' -  : '+IntToStr(Players[i].Worked)+' mins.'+' - Loc: '+Players[i].loc);
        end
       writeln('**********************************************');
    end;
    
    //************************************************************************//
    
    procedure ProgressReport;
    begin
      begin
      WriteLn(' ');
      WriteLn('<============== -'+VersionNumber+'- Progress Report ===============>');
      SRLRandomsReport;
      Writeln('we did tutorial');
      end;
      PlayerStats;
    end;
    
    
    //************************************************************************//
    
    Procedure SetUp;
    begin
         SetupSRL;
         DeclarePlayers;
         AntiBan;
         BoredEvery(3);
    end;
    
    
    //*************************************************************************//
    function makeChar():boolean;
    var i, k : integer;
    begin
      if FindText(x,y, 'Accept', 1, 220,264,299,308) then
         begin
         k := random(15)+3;
         for i:=1 to k do MouseBox(142,73,187,316,1);
         k := random(15)+3;
         for i:=1 to k do MouseBox(443,79,489,252,1);
         if random(2)=1 then Mousebox(424,277,491,313,1);
         Mousebox(218,261,300,310,1);
         Mousebox(218,261,300,310,1);
         Result:=True;
      end
    end;
    //*************************************************************************//
    function findArrow(xf,yf:integer): boolean;
    var i,xtemp,ytemp:integer;
    begin
    for i:=1 to 5 do
    begin
         Result:=False;
         if FindColor(xtemp,ytemp, 11795966, MSX1, MSY1, MSX2, MSY2) then
         begin
         Result:=True;
         xf:=xtemp;
         yf:=ytemp;
         writeln('found it');
         break;
         end
         if FindColor(xtemp,ytemp, 3799547, MSX1, MSY1, MSX2, MSY2) then
         begin
         Result:=True;
         xf:=xtemp;
         yf:=ytemp;
         writeln('found it');
         break;
         end
         if FindColor(xtemp,ytemp, 2291706, MSX1, MSY1, MSX2, MSY2) then
         begin
         Result:=True;
         xf:=xtemp;
         yf:=ytemp;
         writeln('found it');
         break;
         end
         if FindColor(xtemp,ytemp, 6224636, MSX1, MSY1, MSX2, MSY2) then
         begin
         Result:=True;
         xf:=xtemp;
         yf:=ytemp;
         writeln('found it');
         break;
         end
         if FindColor(xtemp,ytemp, 8125181, MSX1, MSY1, MSX2, MSY2) then
         begin
         Result:=True;
         xf:=xtemp;
         yf:=ytemp;
         writeln('found it');
         break;
         end
         writeln(inttostr(i))
         sleep(500+random(200));
    end
    end;
    
    //*************************************************************************//
    procedure underArrow(text:string);
    var i,xf,yf:integer;
    begin
         if findArrow(xf,yf) then
         begin
         i:=1;
         repeat
         writeln(inttostr(xf)+'  '+inttostr(yf));
         mmouse(xf,yf+20,20,20);
         i:=i+1
         until (isuptext(text) )or (i>=10)
         getmousepos(xf,yf);
         writeln(inttostr(xf)+'  '+inttostr(yf)+inttostr(MSX1)+'  '+inttostr(MSX2));
         CMouse(xf,yf,3,3,True);
         sleep(3000);
         While ClickToContinue do sleep(random(2000)+2000);
         writeln(inttostr(i));
    end
    end;
    
    //*************************************************************************//
    //
    //                               Main EventLoop
    //
    //*************************************************************************//
    begin
      Setup;
      if LoggedIn then Logout;
      LoginPlayerNoWelcome;
      sleep(5000);
      if makeChar() then
      begin
      writeln('made a random character');
      end else writeln('the character has already been made');
      sleep(1000+random(2000));
      underArrow('Talk');
      end.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. FindBitmap Problem
    By shadowpwner in forum OSR Help
    Replies: 5
    Last Post: 08-14-2007, 02:26 AM
  2. Need help with If not FindColor
    By philowns in forum OSR Help
    Replies: 3
    Last Post: 08-01-2007, 03:36 PM

Posting Permissions

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