Results 1 to 12 of 12

Thread: Having hard time

  1. #1
    Join Date
    Jan 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Having hard time

    ive been trying different things for a couple of days and i am like super stuck/lost still...everything i try that i get off forums doesnt work....i guess im doing it wrong.....i really need some help...guides arent doing so well...

    also want to know how do i get old UpText/rstext? or how can i make?

    what im tryin to do is::
    walk to shop
    Find NPC
    Talk/Open NPC
    Find(object)
    Buy Object
    walk to banker
    Find NPC
    Talk/Bank NPC
    Deposit Object
    repeat

    Code:
    program BuyDstone;
    {.include SRL/SRL.scar}
    
    var
    x,y:Integer;
    Dommik:Integer;
    
    function LoadBitmaps:Integer;
    begin
     Dommik:=BitmapFromString(16, 13, 'beNpzlDZTE1aS5HE1kASiUj' +
           'c5ICpwlgaiYhdZOIKIJFlLApGcGDcQoalHUwlH8ZbiQPOBiLrqcxy' +
           'hKMpM3EpTBIhwqYdogasHImT1mA5AM5/q6pFVIqt31BPHVI+pGIhs' +
           'tcWAiHj1+ooCcPUEHQMMf09tYazq0VSm2UhBkK8eUeqhCAA/xpYS');
     GameTab(tab_Inv);
     if FindBitmapToleranceIn(Dommik,x,y, MSX1,MSY1,MSX2,MSY2,15)then
     begin
      Writeln('Found Dommik!');
      MMouse(x,y,4,4);
      if IsUpText('ommik')then
      begin
       Wait(200+random(100));
       Mouse(x,y,0,0,False);
       Result:=True;
      end else
       Writeln('Could not find Dommik')
      FreeBitmap(Dommik);
     end;
    Last edited by scured; 01-17-2010 at 12:41 AM.

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

    Default

    It would be better to use ACA (Auto Color Aid) to find an NPC, bitmaps to find things on the mainscreen are hard. Look in your SRL/Scripting Tools folder (I think). And open up Auto Color Aid.

    Have that program open, and runescape open, press F2 on auto color aid. Then click on some unique colors on the NPC on auto color aid (Make sure they are all appx the same color, dont just click randomly all over the NPC get like all brown/purple/yellow or whatever only don't 'mix' colors), press F2 again, get some more colors, move around the compass on runescape, press F2 on ACA, get some more colors . After you have 15+ colors. Then press F2 on ACA again, and click a button near bottom that says 'mark best color'. You should now see some stuff on the picture of runescape on ACA turn red! That means all of those colors were found!

    (After you are done with this, let me know, and I'll tell you what to do next) Feel free to ask any more questions if you don't understand my instructions above, good luck!

  3. #3
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ACA would be best. I've only had bitmaps of something on the main screen work once and that was with magic tree sparkles; they're pretty distinct.

  4. #4
    Join Date
    Nov 2009
    Location
    Seattle, WA
    Posts
    589
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Read this
    Recommended Tut #1
    Get the Basics

    Then Read this, Which teaches all you want to know about.
    Recommended Tut #2

    I dont think this is something your just supposed to snap your fingers and get it in one day, When I learned it I practiced and Practiced, eventually it clicks like a mouse.
    Don't Troll, Don't Fight, Just keep the Respect
    Status : Offline

    Feel free to re-make my scripts ;D
    Community Member

  5. #5
    Join Date
    Jan 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    It would be better to use ACA (Auto Color Aid) to find an NPC, bitmaps to find things on the mainscreen are hard. Look in your SRL/Scripting Tools folder (I think). And open up Auto Color Aid.

    Have that program open, and runescape open, press F2 on auto color aid. Then click on some unique colors on the NPC on auto color aid (Make sure they are all appx the same color, dont just click randomly all over the NPC get like all brown/purple/yellow or whatever only don't 'mix' colors), press F2 again, get some more colors, move around the compass on runescape, press F2 on ACA, get some more colors . After you have 15+ colors. Then press F2 on ACA again, and click a button near bottom that says 'mark best color'. You should now see some stuff on the picture of runescape on ACA turn red! That means all of those colors were found!

    (After you are done with this, let me know, and I'll tell you what to do next) Feel free to ask any more questions if you don't understand my instructions above, good luck!
    okay ill try
    Last edited by scured; 01-16-2010 at 11:02 PM. Reason: found the ACA on the forums

  6. #6
    Join Date
    Jan 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok i did it, and i guess its locating the color that i set up, how do i use this code in my script?

    Code:
    program AutoColor;
    {.include SRL\SRL.scar}
    
    function AutoColor: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.05, 0.42);
    
      FindColorsSpiralTolerance(MSCX, MSCY, arP, 1786478, MSX1, MSY1, MSX2, MSY2, 3);
      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 >= 6.76) and (X <= 10.46) and (Y >= 5.78) and (Y <= 8.81) and (Z >= 1.66) and (Z <= 2.40) 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;
    
    begin
      SetupSRL;
      AutoColor;
    end.

  7. #7
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Notice how it returns an integer? The integer that it returns is the color of whatever you were looking for. So just set a variable to that or put it directly into your function/procedure.

    Code:
    //your autocolor
    Function AutoColor: Integer;
    begin
    end;
    
    Function DoSomething: Boolean;
    var
      x, y, a: integer;
    
    begin
      FindColor(x, y, AutoColor, MSx1, MSy1, MSx2, MSy2);
    //or
      a := AutoColor;
      FindColor(x, y, a, MSx1, MSy1, MSx2, MSy2);
    end;

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

    Default

    SCAR Code:
    program AutoColor;
    {.include SRL\SRL.scar}

    function AutoColor: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.05, 0.42);
      FindColorsSpiralTolerance(MSCX, MSCY, arP, 1786478, MSX1, MSY1, MSX2, MSY2, 3);
      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);
    ////
      For I:=0 To High(arP) Do
      Begin
        MMouse(x,y,0,0)
        If IsUpText('NPC NAME') THen
        Mouse(x,y,0,0,True);
      End;
    end;

    Firstly, you can shorten it to just that. Also, good job picking similar colors tolerance of 3 is very low, that's good! I hope you picked enough though.
    Every time I ACA I just shorten the code to just that much, its all I normally need.
    As for the next steps, you could do something like what's under the ////s

    Ill edit this/post again a bit later on with better/safer code to use though. That's just a quick example.
    For now you should read up on Naum's 'A low down on wizzy plugin' tutorial, that will help you out a lot with TPA stuff.

  9. #9
    Join Date
    Jan 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i cant figure out how to use the code that you just gave me...i always get errors and stuff

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

    Default

    Oh sorry, it was just a quick example, not sure if you know TPAs and stuff yet also, that's not exactly the code you need, just an example. Still busy Sorry, i will explain it a bit more later.
    Reading this tutorial will be very beneficial for you though for now:
    http://www.villavu.com/forum/showthr...t=wizzy+plugin

  11. #11
    Join Date
    Jan 2010
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Oh sorry, it was just a quick example, not sure if you know TPAs and stuff yet also, that's not exactly the code you need, just an example. Still busy Sorry, i will explain it a bit more later.
    Reading this tutorial will be very beneficial for you though for now:
    http://www.villavu.com/forum/showthr...t=wizzy+plugin
    ok, please explain a lil bit more

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

    Default

    :/ Well I'm not super at explain this right now, but Ill try! I've taught lots of people, but right now I'm all blargh.
    Anyways, here is a function from some ghetto script I nevever finished, of course yours will probably be simpler.



    Function AttackGuard2:Boolean;
    var tAta,x,y,i:Integer;
    Begin
    If Not(LoggedIn) Then Exit;
    StatsGuise('Searching For Guard');//dont worry about this/remove
    ColorToleranceSpeed(2); //ACA color settings stuff
    SetColorSpeed2Modifiers(0.03, 1.08);//ACA color settings stuff
    For I:=0 To 10 Do // Loop 10 times
    Begin
    StatsGuise('Search'+IntToStr(I)); //dont worry about this/remove
    Wait(1000+Random(150)); //Waits between each try, so it doenst look too computery
    X:=Random(MSCX); //sets x and y to middle of mainscreen so the search searches from the mainscreen outwards
    Y:=Random(MSCY);
    If FindColorSpiralTolerance(x,y,7165230,MSX1,MSY1,MSX 2,MSY2,12) //get the color/tolerance from ACA
    Then
    If CheckAndClick(x,y) Then //This is basically just a combination of Mmouse and IsUpText (MMouse(x,y,0,0) If IsUpText('orik') Then)
    Begin
    Mouse(x,y,0,0True)
    End;
    SetColorSpeed2Modifiers(0.2,0.2);
    ColorToleranceSpeed(1);
    End;
    Sorry I'm in a huge rush and stuff right now , the code is more of an example code/outline but its fine, sorry for my rush, Ive got to go!

    (I feel so sloppy sorry!)

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
  •