Results 1 to 5 of 5

Thread: My first script.... HELP!

  1. #1
    Join Date
    Dec 2006
    Location
    San Jo, Cali
    Posts
    45
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default My first script.... HELP!

    My first script... might seem a little advance for a first script but I like to aim high.

    All it does is log in then sit there..... what the hell am I doing wrong?



    Program Autoplayer;
    {.include SRL\SRL.SCAR}

    // Color of ore below

    Const
    Color1 = 5476070;

    Procedure Options;
    Begin
    BenMouse := False;
    MouseSpeed := 15;
    End;

    // ----------------------------------

    Procedure DeclarePlayers;
    Begin
    HowManyPlayers := 1;
    NumberOfPlayers(HowManyPlayers);
    CurrentPlayer := 0;

    Players[0].Name :='';
    Players[0].Pass :='';
    Players[0].Nick := '';
    Players[0].Active := True;

    WriteLn('Autoing - '+Players[0].name+'');
    End;

    // ----------------------------------

    Const
    RockWait = 15000;

    Var a,b : Integer;

    Procedure OreFinding;
    Begin
    If(LoggedIn) Then
    begin
    if(Findcolor(a,b,Color1,5,5,515,340))then
    Mouse(a,b,5,5,true);
    Flag;
    FTWait(RockWait+Random(1000));
    end;
    End;

    // ----------------------------------

    Procedure dropores;
    Begin
    MouseSpeed:=1
    DropTo(2,28)
    End;

    // ----------------------------------

    Procedure PlayerReport;

    Var Active : String;

    Begin
    begin
    If Players[0].Active=True Then Active := 'Autoing' Else Active := 'Error';
    WriteLn(' User - '+Players[0].name+' was '+Active);
    WriteLn('');
    WriteLn(' Mined '+IntToStr(Players[0].Integer2)+' Ores');
    WriteLn(' Mining Level - '+IntToStr(Players[0].Level[15]));
    WriteLn('');
    end;
    End;

    // ----------------------------------

    Begin
    SetupSRL;
    Declareplayers;
    loginplayer;
    HighestAngle;
    Options;
    Repeat
    OreFinding;
    until(InvFull)
    If(InvFull) Then
    DropOres;
    PlayerReport;
    End.
    http://img141.imageshack.us/img141/6...ats2jk5fx8.png
    There are currently 10.0 blackmarks out of 10 on this account
    You are permanently banned --- Rest In Peace

  2. #2
    Join Date
    Nov 2006
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    if(Findcolor(a,b,Color1,5,5,515,340))then
    that finds the exact colour you need to add toerance otehrwise it will take alot of time to find that exact colour if we add tolerance it takes less time and it can mine more randomly the procedure for the torance it findcolorspiraltolerance that is a bit complicated since i dont understand it either and im askin for help
    hope iv helped ya
    im back----took a long break away but im back and im gonna get into scripting

  3. #3
    Join Date
    Dec 2006
    Location
    San Jo, Cali
    Posts
    45
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok well that makes sense. I'lltry it out.
    http://img141.imageshack.us/img141/6...ats2jk5fx8.png
    There are currently 10.0 blackmarks out of 10 on this account
    You are permanently banned --- Rest In Peace

  4. #4
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Findcolor works MUCH faster than FindColorTolerance does, since it only searches for 1 color. But as the other poster said, if you're only looking for 1 single color you will almost never find it, unless it is a special fixed color.

    If you want to add tolerance you can use FindColorTolerance instead of FindColor. All you have to do is add one extra spot to the command.

    Findcolor(a,b,Color1,5,5,515,340)
    FindColorTolerance(a,b,Color1,5,5,515,340,10) <-- 10 or 20 or whatever.

    Those both search from the top-left of the screen to the bottom-right. If you want to search from the center out, you can use FindColorSpiralTolerance. This looks exactly the same as FindColorTolerance, but you have to set a and b before using it.

    FindColorTolerance(a,b,Color1,5,5,515,340) becomes

    a:=MSCX;
    b:=MSCY;
    FindColorSpiralTolerance(a,b,Color1,5,5,515,340,10 );

    Good luck!

  5. #5
    Join Date
    Nov 2006
    Posts
    173
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Was working with Wtf I Sp4ank's treespanker this morning. It was using findcolorspiraltolerance. It was really slow on my PC here at work, and was just barely clicking enough to stay logged in.

    Switche to findcolorspiral, and it made a HUGE difference in speed. As opposed to tolerance I set three treecolor vars, then used a if/or for the other two colors and then finally the "then" for the last.

    So I learned alot by just trying the various FindColor procedures. I would say that by using more var's for the possible colors you are able to achieve the effect of tolerance without such lag.

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
  •