Results 1 to 7 of 7

Thread: What Am I doing wrong with script?

  1. #1
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default What Am I doing wrong with script?


    // Start at Varrok West bank, with hammer in first slot inventory. Color,VBright
    // The bar must be in within the first 50 slots of the bank.
    //
    // By default, this script smiths steel bars. You can change it to suit others.

    { TELL ME HOW THIS WENT!!!!}

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

    Const
    Loads = 25;
    StartPlayer = 0;
    //Change this to the color of your bar to smith. Eg, Bar:=3355447 is iron.
    //------------½ This one is Steel
    Bar=4868944;
    //-------------½
    //-------------½

    Var
    Mithril, Banker1, Banker2, Hammer, Anvil, BankSymbol,
    WordBank, AnvilMap,x, y: Integer;

    NoHammer:Boolean;
    //Setup your players
    Procedure DeclarePlayers;
    Begin
    HowManyPlayers := 1;
    NumberOfPlayers(HowManyPlayers);
    CurrentPlayer := 0;

    Players[0].Name := '';
    Players[0].Pass := '';
    Players[0].Nick := '';
    end;
    //Dont touch past here, except for the Bar color
    procedure BankToAnvil;
    begin
    Hammer:=736600
    Banker1:=5782599
    Banker2:=4860471
    WordBank:= 65535
    //Change this to the color of your bar to smith. Eg, Bar:=3355447 is iron.
    //------------½ This one is Steel

    //-------------½
    //-------------½
    If(Not FindColor(x,y,Hammer,573,213,596,231))Then
    begin
    Writeln('No Hammer');
    end else
    WriteLn('Found Hammer');
    begin;
    If(FindColor(x,y,Banker1,250,4,491,279))Then
    begin
    FindColor(x,y,Banker2,250,4,491,279);
    MoveMouseSmoothex(x,y+random(9),20,40,45,25,20);
    ClickMouse(x,y,false);
    end;
    begin
    FindColor(x,y,WordBank,250,4,491,279);
    MoveMouseSmoothex(x,y+random(11),20,40,45,25,20);
    ClickMouse(x,y,true);
    end;
    begin
    FindColor(x,y,Bar,28,88,479,292);
    MoveMouseSmoothex(x,y+random(7),20,40,45,25,20);
    ClickMouse(x,y,false);
    end;
    begin
    FindColor(x,y,0,31,89,506,468);
    MovemouseSmoothex(x,y+random(7),20,40,45,25,20);
    ClickMouse(x,y,true);
    end;
    end;
    end;

    Procedure AnvilRadialWalk;
    begin
    AnvilMap:= 12434166
    RadialWalk(AnvilMap, 136, 224, 15, 3, 4);
    Until(findSymbol(x,y, 'anvil');
    else
    logout;
    Writeln('Cannot find Anvil')
    end;
    end;
    end;

    Procedure Smithing;
    Anvil:=3355447
    Hammer:=736600
    If (FindColor(x,y,Bar,562,255,729,343))then;
    begin
    MoveMouseSmoothEx(x,y,+random(3),20,40,45,25,20);
    ClickMouse(x,y,True);
    end;
    else
    Writeln('Something Happened to Our bar... Not in inventory');
    Logout
    end;
    begin
    If (FindColor(x,y,Anvil,114,5,342,322))then:
    begin
    MoveMouseSmoothEx(x,y,+random(3),20,40,45,25,20);
    ClickMouse(x,y,True)
    MoveMouseSmoothEx(498,316,+random(2),20,40,45,25,2 0);
    HoldMouse(498,316,true);
    Wait(2943+random(234);
    ReleaseMouse(498,316,true);
    MoveMouseSmoothEx(261,280,+random(13),20,40,45,25, 20);
    ClickMouse(261,280,False);
    MoveMouseSmoothEx(266,359,+random(4),20,40,45,25,2 0);
    ClickMouse(266,359,True);
    Sleep(20000);
    end;
    else;
    WriteLn('Cant Find Anvil')
    Logout;
    end;
    end;
    end;

    Procedure RadialWalkToBank;
    BankSymbol:=117712
    begin
    RadialWalk(BankSymbol, 136, 224, 15, 3, 4);
    Until(findSymbol(x,y, 'Bank');
    else
    WriteLn('Cant Find Bank');
    Logout;
    end;

    Procedure Loop;
    repeat
    DeclarePlayers
    BankToAnvil
    AnvilRadialWalk
    Smithing
    RadialWalkToBank
    until false;
    end;
    end.
    I'm working on this new script to apply what i have learned around here. And I just can't make this work. (I've read through half of the intermediate tuts before starting! xD).

    Going offline today...

  2. #2
    Join Date
    Oct 2007
    Location
    If (Online) then Loc := ('On comp') else Loc := ('Somewhere else!');
    Posts
    2,020
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    // Start at Varrok West bank, with hammer in first slot inventory. Color,VBright
    // The bar must be in within the first 50 slots of the bank.
    //
    // By default, this script smiths steel bars. You can change it to suit others.

    { TELL ME HOW THIS WENT!!!!}

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

    Const
      Loads = 25;
      StartPlayer = 0;
      //Change this to the color of your bar to smith. Eg, Bar:=3355447 is iron.
      //------------½ This one is Steel
      Bar=4868944;
      //-------------½
      //-------------½

    Var
      Mithril, Banker1, Banker2, Hammer, Anvil, BankSymbol,
      WordBank, AnvilMap,x, y: Integer;

      NoHammer:Boolean;
    //Setup your players
    Procedure DeclarePlayers;
    Begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name  := '';
      Players[0].Pass  := '';
      Players[0].Nick  := '';
    end;
    //Dont touch past here, except for the Bar color
    procedure BankToAnvil;
    begin
      Hammer:=736600
      Banker1:=5782599
      Banker2:=4860471
      WordBank:= 65535
      //Change this to the color of your bar to smith. Eg, Bar:=3355447 is iron.
      //------------½ This one is Steel

      //-------------½
      //-------------½
      If(Not FindColor(x,y,Hammer,573,213,596,231))Then
        begin
          Writeln('No Hammer');
        end else
          WriteLn('Found Hammer');
        begin;
          If(FindColor(x,y,Banker1,250,4,491,279))Then
            begin
              FindColor(x,y,Banker2,250,4,491,279);
              MoveMouseSmoothex(x,y+random(9),20,40,45,25,20);
              ClickMouse(x,y,false);
            end;
            begin
              FindColor(x,y,WordBank,250,4,491,279);
              MoveMouseSmoothex(x,y+random(11),20,40,45,25,20);
              ClickMouse(x,y,true);
            end;
            begin
              FindColor(x,y,Bar,28,88,479,292);
              MoveMouseSmoothex(x,y+random(7),20,40,45,25,20);
              ClickMouse(x,y,false);
            end;
            begin
              FindColor(x,y,0,31,89,506,468);
              MovemouseSmoothex(x,y+random(7),20,40,45,25,20);
              ClickMouse(x,y,true);
            end;
          end;
        end;
       
    Procedure AnvilRadialWalk;
    begin
    AnvilMap:= 12434166
      RadialWalk(AnvilMap, 136, 224, 15, 3, 4);
      Until(findSymbol(x,y, 'anvil');
        else
          logout;
          Writeln('Cannot find Anvil')
        end;
      end;
    end;

    Procedure Smithing;
    Anvil:=3355447
    Hammer:=736600
    If (FindColor(x,y,Bar,562,255,729,343))then;
      begin
        MoveMouseSmoothEx(x,y,+random(3),20,40,45,25,20);
        ClickMouse(x,y,True);
      end;
    else
      Writeln('Something Happened to Our bar... Not in inventory');
      Logout
    end;
      begin
        If (FindColor(x,y,Anvil,114,5,342,322))then:
          begin
            MoveMouseSmoothEx(x,y,+random(3),20,40,45,25,20);
            ClickMouse(x,y,True)
            MoveMouseSmoothEx(498,316,+random(2),20,40,45,25,2  0);
            HoldMouse(498,316,true);
            Wait(2943+random(234);
            ReleaseMouse(498,316,true);
            MoveMouseSmoothEx(261,280,+random(13),20,40,45,25,  20);
            ClickMouse(261,280,False);
            MoveMouseSmoothEx(266,359,+random(4),20,40,45,25,2  0);
            ClickMouse(266,359,True);
            Sleep(20000);
          end;
        else;
          WriteLn('Cant Find Anvil')
          Logout;
        end;
      end;
    end;

    Procedure RadialWalkToBank;
    BankSymbol:=117712
    begin
      RadialWalk(BankSymbol, 136, 224, 15, 3, 4);
      Until(findSymbol(x,y, 'Bank');
    else
      WriteLn('Cant Find Bank');
      Logout;
    end;

    Procedure Loop;
      repeat
        DeclarePlayers
        BankToAnvil
        AnvilRadialWalk
        Smithing
        RadialWalkToBank
      until false;
      end;
    end.

  3. #3
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  4. #4
    Join Date
    Mar 2007
    Posts
    151
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just for your safety; MoveMouseSmooth, CickMouse, etc, are all very easily detected.
    You should use MMouse and Mouse.
    Also, when you're finding the color of things, using FindColorTolerance will be more accurate and easier to use.. colors are often changed slightly while you are in-game to check for bots.

    FindColor(x,y,WordBank,250,4,491,279); ... wth?
    try "ChooseOption('Bank');

  5. #5
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Ok. The real problem is how the scar client says the delare player isn't working.
    And thanks, Although I use MovemouseSmoothEx because i've heard countless times that MovemouseSmooth is bad. I think MMouse will work better. Thanks guys.

  6. #6
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  7. #7
    Join Date
    May 2008
    Location
    Canada
    Posts
    665
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Ah! Ok thanks much =). and all the help guys that made my first script here look better and made much room for improvement. Will add stuff to it as i learn more.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. What's wrong with this script?
    By daniiboy69 in forum OSR Help
    Replies: 1
    Last Post: 10-09-2008, 06:25 AM
  2. What's wrong with this script.
    By igotgrapes in forum OSR Help
    Replies: 4
    Last Post: 04-06-2008, 12:44 AM
  3. Replies: 3
    Last Post: 01-20-2008, 05:29 PM
  4. What's wrong with my script?
    By Zeta in forum OSR Help
    Replies: 2
    Last Post: 08-01-2007, 08:19 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
  •