Results 1 to 4 of 4

Thread: better procedures?

  1. #1
    Join Date
    Apr 2007
    Posts
    65
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default better procedures?

    hi, i was just wondering if anybody had some advice about this script that would make the procedures work better or to simplify them.

    //////////////////////////////////////////////////////////////////////////
    // Setup VERsion 2.0 //
    // -------- //
    // Instructions: //
    // 1} Start near the items you want to pickup. //
    // //
    // 2} Use Eyedropper above to pick a distinctive color on item. //
    /// //
    /// 3}pick up to 3 colors. add to constants below. //
    //// //
    ///// 4}Drag crosshair onto runescape screen, hit green run arow. //
    //// //
    /// 5}Watch the script pickup the items =p //
    /// //
    // VERSION HISTORY //
    // 1.0)successful! no antiban or random wait times no randoms. //
    // 1.5)added random w8s for antiban and getmouse position. //
    // succesful!! //
    // 2.0)added 1 player login! version not tested.... //
    // Leave All Feedback on scar-scripts.com or srl-forums.com //
    /////////////////////////////////////////////////////////////////////////

    Program AutoPickup;
    {.include SRL/SRL.scar}

    const
    Color1 =000000;//
    Color2 =000000;// >pick colors
    Color3 =000000;//

    ///////////If Login doesnt work tell me on srl or scar-scripts////////////
    /////////until then delete it if it doesnt work or you dont want it////
    ///////remember to remove declare players from the last loop(line 82)//
    Procedure DeclarePlayers;
    begin
    HowManyPlayers := 1;
    NumberOfPlayers(HowManyPlayers);
    CurrentPlayer:= 0;
    Players[0].Name := 'Username';
    Players[0].Pass := 'Password';
    Players[0].Nick := 'Nickname';
    Players[0].Active := True;
    NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    end;

    procedure Signature;
    begin
    ClearDebug;
    Writeln('My First Working Script!!!');
    Writeln('Pickup Whatever item u set it to!');
    Writeln(' Uses Colors and mouse commands');
    Writeln(' By:Lilboy543');
    Wait(2000 + random(550));
    end;

    procedure ClickColors;
    begin
    repeat
    if(FindColor(x,y,Color1,MSX1,MSY1,MSY2,MSY2))then
    begin
    Mouse(x,y,1,1,true);
    wait(575+random(167));

    end;
    if(FindColor(x,y,Color2,MSX1,MSY1,MSY2,MSY2))then
    begin
    Mouse(x,y,1,1,true);
    wait(600+random(170));

    end;
    if(FindColor(x,y,Color3,MSX1,MSY1,MSY2,MSY2))then
    begin
    Mouse(x,y,1,1,true);
    wait(550+random(160));

    end;
    until(False);
    end;

    begin
    SetupSRL;
    Signature;
    DeclarePlayers;
    ClickColors;
    end.

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You could simplify it without looking for the different colors, at all different times like so:

    SCAR Code:
    if(FindColor(x,y,Color1,MSX1,MSY1,MSX2,MSY2))or
    (FindColor(x,y,Color2,MSX1,MSY1,MSX2,MSY2))or
    (FindColor(x,y,Color3,MSX1,MSY1,MSX2,MSY2))then
    begin
      Mouse(x,y,2,2,true)

    //.....................etc..................
    get it? Notice that I fixed your coords too. You have MSY2 twice. Make sure you have it as MSX1,MSY1,MSX2,MSY2

    Good try for your first script (Probably) though, keep it up!

    P.S. You should add a procedure to drop using DropAll; or DropTo(2,28). To learn about those, check out my tut (Links in sig) Things the beginner tuts don't teach you

    Also, I'd suggest looking for the color with tolerance using the same thing, just change it to

    FindColorTolerance

    And then after the coordinates, put a ",5" or whatever you want the tolerance to be.

    Edit: Lol, didn't notice this wasn't a power miner It could be though if you added a dropping procedure like I said

  3. #3
    Join Date
    Apr 2007
    Posts
    65
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    tyvm i overlooked the procedures i didnt see i had y2 twice lol
    tyhis should help me out. ty

  4. #4
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No problem I'd also suggest looking for the up text. Maybe a constant, then do like this:

    SCAR Code:
    if(FindColorTolerance(x,y,......etc))or
    (FindColorTolerance(x,y,.......etc))then
    begin
      MMouse(x,y,2,2);
      if(IsUpText(TextConstant))then
      begin
        Mouse(x,y,2,2,true);
        Wait(Whatever);
      end;
    end;
    You should know how to fill in the blanks with that

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Using Procedures in Procedures?
    By Geebly in forum OSR Help
    Replies: 4
    Last Post: 03-14-2008, 07:33 AM
  2. Help with procedures :s
    By Macro_FTW in forum OSR Help
    Replies: 1
    Last Post: 05-02-2007, 02:15 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
  •