Results 1 to 11 of 11

Thread: Help w/ first Script, procedures, findcolor

  1. #1
    Join Date
    Jan 2008
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help w/ first Script, procedures, findcolor

    I've just begun to learn about scripting, and i know only a few things. im trying to make a really simple script, so i can get a feel for Scar and move on to more advance stuff. im trying to make a script that takes ores out of the bank, walks to the smith, and smiths them. i can get the ores out of my a bank and walk to the place, but i cant find the smith. heres what it looks like.

    program autosmith;

    const
    SmithColor=1121934;

    var
    x, y : Integer;

    begin
    MoveMouseSplineEx(193,154,1,1,5,40,50);
    Wait(50+random(10))
    ClickMouse(193,154,false);
    Wait(70+random(10))
    MouseBox(113,223,197,228);
    ClickMouseBox(113,223,197,228,true) ////all this is getting the ores and
    Wait(50+random(10)) and walking to smith.
    MouseBox(691,112,695,124);
    Wait(50+random(10))
    ClickMouseBox(688,107,696,119,true);
    Wait(13000+random(50))

    begin
    if(FindColorTolerance(x,y,SmithColor,191,9,509,172 ,10)) then
    begin
    MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
    Wait(100+random(10));
    ClickMouse(x,y,true);
    Wait(50+random(10));
    end else
    end;
    end.

    i know the findcolor works because i tried it just alone, but when i do this one, it does everything, but the find color. any suggestions?
    thanks

  2. #2
    Join Date
    Aug 2007
    Location
    Georgia, U.S.
    Posts
    890
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    is this for varrock West?

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

    Default

    yea i have a BIG suggestion use SRL not just scar functions...clickmouse is detectable and will get you banned use MMouse to move the mouse and Mouse to move and click the mouse

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


  4. #4
    Join Date
    Jan 2008
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    wow, my bad, change every "smith" word to "smelt" i wanted the script to smelt ores at al kharid. and thanks for the heads up HyperSecret.

  5. #5
    Join Date
    Aug 2007
    Location
    Georgia, U.S.
    Posts
    890
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You should read some tuts on SRL, just using scar functions is VERY detectable.

  6. #6
    Join Date
    Jan 2008
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    does anyone know where i can find some good srl tutorials?

  7. #7
    Join Date
    Aug 2007
    Location
    Georgia, U.S.
    Posts
    890
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Tutorial island section

  8. #8
    Join Date
    Jan 2008
    Location
    Alberta
    Posts
    727
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Try not to use coords, and not use clickmouse. To use MMouse and Mouse, you need to put in:
    SCAR Code:
    SetupSRL;

    Or
    SCAR Code:
    MouseSpeed := 15;

    If it doesn't do the FindColor i'm not sure but i think this will work. Make your things procedures, so like this:
    SCAR Code:
    program autosmith;
    {.include SRL/SRL.scar}

    const
    SmithColor=1121934;

    var
    x, y : Integer;

    Procedure ThisThing;
    begin
    MoveMouseSplineEx(193,154,1,1,5,40,50);
    Wait(50+random(10))
    ClickMouse(193,154,false);
    Wait(70+random(10))
    MouseBox(113,223,197,228);
    ClickMouseBox(113,223,197,228,true) ////all this is getting the ores and
    Wait(50+random(10)) and walking to smith.
    MouseBox(691,112,695,124);
    Wait(50+random(10))
    ClickMouseBox(688,107,696,119,true);
    Wait(13000+random(50))
    end;

    Procedure BlahBlah;
    begin
    if(FindColorTolerance(x,y,SmithColor,191,9,509,172 ,10)) then
    begin
    MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
    Wait(100+random(10));
    ClickMouse(x,y,true);
    Wait(50+random(10));
    end else
    end;

    begin
    SetupSRL;
    ThisThing;
    BlahBlah;
    end.

    I think that will work but i haven't tested it since i don't know where to try and i'm not going to use a coordinate clicker.

    BTW, use [scar] tags, and i know your getting started but maybe try using standards ( in tut island).

  9. #9
    Join Date
    Jun 2007
    Posts
    785
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program autosmith;
    {.include srl/srl.scar}

    const
    SmithColor=1121934;

    var
    x, y : Integer;

    Procedure Whatever;
    begin
      MoveMouseSplineEx(193,154,1,1,5,40,50);
      Wait(50+random(10))
      MMouse(193,154, 1, 1);
      Wait(70+random(10))
      MouseBox(113,223,197,228, 1);
      If FindObjCustom(x, y,['iro', 'ore'], [SmithColor], 10) then  // fill it in with your uptext / colors.
      begin
        Wait(50+random(10)) and walking to smith.
        MouseBox(691,112,695,124, 1);
        Wait(50+random(10))
        MouseBox(688,107,696,119,1);
        Wait(13000+random(50))
      end;
    end;

    procedure whatever2;
    begin
      if(FindColorTolerance(x,y,SmithColor,191,9,509,172 ,10)) then
      begin
        MoveMouseSmoothEx(x,y +random(0),20,40,45,25,20);
        Wait(100+random(10));
        Mouse(x,y,1, 1, true);
        Wait(50+random(10));
      end else
      Exit;
    end;

    begin
    SetupSRL;
    Whatever;
    Whatever2;
    end.


    did some quick work on it. it doesn't compile yet because its not Correct what you are trying to do.

    [22:20] <[-jesus-]> freddy, go uninstall yourself

  10. #10
    Join Date
    Jan 2008
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks iron man ftw, it walked to the smelter and found the color. i had the "wait" command at the end of the one of the procedures, and it didnt work, so i put Wait(3000+random(50)) between the "ThisThing;" and "BlahBlah;" but i wont really use it anymore because of the clickmouse thing haha. but thanks, it workd. im trying to smelt ores in al kharid. so, i want it to start at the bank, take out the ores needed, walk to the smelter, smelt them, then bank them and start all over again.

  11. #11
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    When it is walking you don't need to use a wait. Just put Flag;. That automatically waits until the flag on the minimap is gone .

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. FindColor
    By Sp0rky in forum OSR Help
    Replies: 26
    Last Post: 08-01-2007, 08:46 PM
  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
  •