Results 1 to 15 of 15

Thread: Invalid number of parameters

  1. #1
    Join Date
    Mar 2007
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Invalid number of parameters

    Hi, I made this script and now im checking it for bugs, but now i get the error:
    Line 134: [Error] (14801:26):Invalid number of parameters
    Can anyone help me out?
    Here's my full script:
    SCAR Code:
    Program PortPhasmatysSmelter;
    //by EL_TYCHO
    {.include SRL/SRL.scar}
    {.include SRL/SRL/extended/xbank.scar}

    ///////////Change this if needed///////////////////
    Const Bars = 100 ;//Number of loads to do
          Furnace = 3684413;//Furnace color
          FurnaceMM = 2851583;//Furnace color on the minimap
          BankSymbol =  5890811;//color of the bank symbol
          BankBooth = 1984064;//bankbooth color


    ///////////////////Dont touch this/////////////////

    var BarsDone : integer;
        Iron : integer;
        Coal : integer;
        Steel : integer;
    Procedure FreeBitmaps;
     begin
       Iron := BitmapFromString(13, 10, 'z78DA75D25B0E83201005D02D' +
           '316FFC44C4FD2FA9D84BD369B49ADC4C081E0747DBB58938EB29E' +
           '166241575B92E92C2F346CD414E45820B6D72B051D76BADE79DCB' +
           'D94CA57937971DF583D6A993408383848C3D4B3B6DBE2FE75D13A' +
           '641FED39BF34E2327FA09B65D4BB4696BA81D4A0F1A9CDC5BE3CE' +
           '25273A89C355BD8A6F5A613E68E95BAD7EE00C1ECCC8082F2A709' +
           '6F696EF5AFE56776DCE6F4676AAF99C30EAACE9A64556B7FF9C1F' +
           '0D4EF5433BF29FB6CC74BAA59908C772B2D6FCD4919F45DA75D68' +
           'EA97D56BE0E567227F75412BBF6ABF2C0BF9D279E13A77801392D' +
           'A15F');

        Coal := BitmapFromString(14, 9, 'z78DA7592510EC4200844AF243' +
           '0A07EAA75EF7FA4B5E207CD6E359934545F19A6F932C0D2BD4812' +
           'AFEDCF3C78D0741516E6245994559A34CE0FDD75BFE55AC42A4A6' +
           '4A222094E25D25E987E928C2C5D34D69652ECC278639E7AA44D99' +
           '5C5D1FB4ADBC165969F6C18C0457252CFF36D4A41F7260C6930F6' +
           '6E54A8FB7A0BB1F5580A7A92E13197A817EBF18271F5D47E66275' +
           '1AA7B74DF30E4B32438E9CA827CDEDD7693E25EE77052685B3558' +
           '534A765D68EF496609CF9F9371E39F2E474FC6E9A7DB4CAE5AE8B' +
           '5A477B63FEA67966D8A4738DBD392D674B9098E01F665989896B9' +
           'CC91776469AA3');

        Steel := DTMFromString('78DA630C626060706040011505F90CFF81342' +
           '310FF0702C64820C393010D302291403A1848F811501300247C09' +
           'A87107125E44A87126A0C60BD35F186A40EEB521A006143E9604D' +
           '480C2C79A809A5820614B404D02116E8E01126E04D4C4010917FC' +
           '6A006F840EBA');
     end;

    Function FindFastRandoms: Boolean;
    var
      i: Integer;
    begin
      for i:=1 to 12 do
      begin
        case I of
         1:  If FindDead then
               Result := True;
         2:  If FindMod then
               Result := True;
         3:  If FindMime then
               Result := True;
         4:  If FindMaze then
               Result := True;
         5:  If FindQuiz then
               Result := True;
         6:  If FindDemon then
               Result := True;
         7: begin
               if NoGameTab then
               begin
                 Result := True;
                 Logout;
                 Exit;
               end;
             end;
         8: begin
               if InBlack then
               begin
                 Result := True;
                 Logout;
                 Exit;
               end;
             end;
         9: begin
                 if(DetectFrogCave) then SolveFrogSwamp;
            end;
         10: begin
                  if(FindFight) then
                  begin
                       RunAwayDirection('W');
                       Wait(10000 + Random(2000));
                       RunBack;
                  end;
             end;
         11: begin
                  FindLamp('Prayer');
             end;
         12: begin
                  if findname or findtalk then
                  begin
                   FindNormalRandoms;
                  end
             end;
        end;
        Wait(1);
      end;
    end;
    ///////////////////////opens the bank and withdraws the ores only for the first time//////////////////
    Procedure WithdrawOres;//based it on the bank opening proces by ThickAsBlood
    var i:integer;

      Begin
       i:=0
       if not (BankScreen) then
        repeat
         i:= + 1;
         if(FindColorTolerance(x, y, BankBooth,MSX1, MSY1, MSX2, MSY2,5))and
         (IsUpText('bank')) then
          Mouse(x,y,0,0,false);
          Wait(1000+random(500));
          ClickOption('ickl', 1);
          Wait(3000+random(1000));
        until (GetColor(229, 41) = 2070783) or (i >= 10) or (BankScreen);
        if (i >= 10) then
          TerminateScript;
          QuickFixBank;
        If(FindBitmap(Iron,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('x', 1);
          TypeSend('18');
        end;
        If(FindBitmap(Coal,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('All', 1);
         end;
        MouseBox(478, 33, 494, 49, 1);
        FindFastRandoms;
     end;

    ///////////////////////Walks to the furnace/////////////////
    Procedure GoToFurnace;
     Begin
      FindColor(x,y,FurnaceMM,mmx1,mmy1,mmx2,mmy2)
      Wait(1000+random(500));
      Mouse(x,y,1,1,true);
      Wait(5000+random(1000));
      FindFastRandoms;
     end;

    /////////////////////Smelt the ores/////////////////////
    Procedure SmeltOres;
    var mins: Integer;
        skill: string;

     Begin
      if(FindColorTolerance(x, y, Furnace,MSX1, MSY1, MSX2, MSY2,5))
      and(IsUpText('elt furn'))then
       begin
        MMouse(x,y,0,0);
        Mouse(x,y,0,0,true);
        Wait(2000+random(1000));
        MouseBox(258, 712, 286, 738, 2);
        ClickOption('x', 1);
        Wait(1000+random(3000))
        HitKeys(true);
        FindFastRandoms;
        Wait(10000+random(5000));
        FindFastRandoms;
        begin
         if ((TimeFromMark(HoverMark) / 1000) / 60 >= mins) then //Used the one out of the xAntiBan by Dankness
         begin
           MarkTime(HoverMark);
           HoverSkill(Skill, False);
         end;
        end;
        wait(20000+random(2000));
        Barsdone:= Barsdone + 19;
       end;
     end;

    //////////////////////back to the bank////////////////////
    Procedure GoToBank;
     begin
      FindColor(x,y,BankSymbol,mmx1,mmy1,mmx2,mmy2)
      Wait(500+random(500));
      Mouse(x,y,1,1,true);
      Wait(3000+random(2000));
      FindFastRandoms;
     end;

    ////////////////////////deposit the ores///////////////////
    Procedure ChangeBarsForOres;
    var i : integer;
     Begin
      MakeCompass('s');
      Lowestangle;
      1:=0;
      repeat
         i:= + 1;
         if (FondObj(x,y,'ank boot',BankBooth,10))then
          Mouse(x,y,0,0,false);
          Wait(1000+random(500));
          ClickOption('ickl', 1);
          Wait(3000+random(1000));
      until (GetColor(229, 41) = 2070783) or (i >= 10) or (BankScreen);
          if (i >= 10) then
          TerminateScript;
          end;
        if FindDTM(Steel, x, y, 568, 216, 715, 325)then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('All', 2);
          QuickFixBank;
        end;
         If(FindBitmap(Iron,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('x', 1);
          TypeSend('18');
        end;
        If(FindBitmap(Coal,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('All', 1);
         end;
        MouseBox(478, 33, 494, 49, 1);
        FindFastRandoms;
        HighestAngle;
     end;
    //////////////////////Main Loop////////////////////////
    Begin
      SetupSRL;
      FreeBitmaps;
      BarsDone:=0
      MakeCompass('s');
      WithdrawOres;
        Repeat
          MakeCompass('n');
          GoToFurnace;
          SmeltOres;
          GoToBank;
          ChangeBarsForOres;
        Until (BarsDone >= Bars)
    end.

    Thanks

  2. #2
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    ChooseOption('ithdraw x');

    Should be:

    SCAR Code:
    ChooseOption(x, y, 'ithdraw x');

    One more thing, ClickOption is better than ChooseOption.

    SCAR Code:
    ClickOption('x', 1);

    x is only because you can't have 2 words, and 1 means it clicks the option on the mainscreen. 2 is for inventory and 3 for chat if I remember correctly.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  3. #3
    Join Date
    Mar 2007
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ah thanks, ill change it and see if i get any more errors

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

    Default

    Next error I cant solve:
    Line 204: [Error] (14871:1): Identifier expected in script

    Anyone got help?

  5. #5
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    1:=0;

    1 = 0? I think you meant i := 0.

    Line 206: You had FondObj, should be FindObj.

    SCAR Code:
    Procedure ChangeBarsForOres;
    var i : integer;
     Begin
      MakeCompass('s');
      Lowestangle;
      i:=0;
      repeat
         i:= 1;
         if (FindObj(x,y,'ank boot',BankBooth,10))then
          Mouse(x,y,0,0,false);
          Wait(1000+random(500));
          ClickOption('ickl', 1);
          Wait(3000+random(1000));
      until (GetColor(229, 41) = 2070783) or (i >= 10) or (BankScreen);
          if (i >= 10) then
          TerminateScript;
          end;
        if FindDTM(Steel, x, y, 568, 216, 715, 325)then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('All', 2);
          QuickFixBank;
        end;
         If(FindBitmap(Iron,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('x', 1);
          TypeSend('18');
        end;
        If(FindBitmap(Coal,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('All', 1);
         end;
        MouseBox(478, 33, 494, 49, 1);
        FindFastRandoms;
        HighestAngle;
     end;

    You have too many 'Ends' so I added a 'Begin' at the beginning.

    Here's the script, which I even standardised for you:

    SCAR Code:
    Program PortPhasmatysSmelter;
    //by EL_TYCHO
    {.include SRL/SRL.scar}
    {.include SRL/SRL/extended/xbank.scar}

    ///////////Change this if needed///////////////////
    Const
          Bars = 100 ;//Number of loads to do
          Furnace = 3684413;//Furnace color
          FurnaceMM = 2851583;//Furnace color on the minimap
          BankSymbol =  5890811;//color of the bank symbol
          BankBooth = 1984064;//bankbooth color


    ///////////////////Dont touch this/////////////////

    var BarsDone : integer;
        Iron : integer;
        Coal : integer;
        Steel : integer;
    Procedure FreeBitmaps;
     begin
       Iron := BitmapFromString(13, 10, 'z78DA75D25B0E83201005D02D' +
           '316FFC44C4FD2FA9D84BD369B49ADC4C081E0747DBB58938EB29E' +
           '166241575B92E92C2F346CD414E45820B6D72B051D76BADE79DCB' +
           'D94CA57937971DF583D6A993408383848C3D4B3B6DBE2FE75D13A' +
           '641FED39BF34E2327FA09B65D4BB4696BA81D4A0F1A9CDC5BE3CE' +
           '25273A89C355BD8A6F5A613E68E95BAD7EE00C1ECCC8082F2A709' +
           '6F696EF5AFE56776DCE6F4676AAF99C30EAACE9A64556B7FF9C1F' +
           '0D4EF5433BF29FB6CC74BAA59908C772B2D6FCD4919F45DA75D68' +
           'EA97D56BE0E567227F75412BBF6ABF2C0BF9D279E13A77801392D' +
           'A15F');

        Coal := BitmapFromString(14, 9, 'z78DA7592510EC4200844AF243' +
           '0A07EAA75EF7FA4B5E207CD6E359934545F19A6F932C0D2BD4812' +
           'AFEDCF3C78D0741516E6245994559A34CE0FDD75BFE55AC42A4A6' +
           '4A222094E25D25E987E928C2C5D34D69652ECC278639E7AA44D99' +
           '5C5D1FB4ADBC165969F6C18C0457252CFF36D4A41F7260C6930F6' +
           '6E54A8FB7A0BB1F5580A7A92E13197A817EBF18271F5D47E66275' +
           '1AA7B74DF30E4B32438E9CA827CDEDD7693E25EE77052685B3558' +
           '534A765D68EF496609CF9F9371E39F2E474FC6E9A7DB4CAE5AE8B' +
           '5A477B63FEA67966D8A4738DBD392D674B9098E01F665989896B9' +
           'CC91776469AA3');

        Steel := DTMFromString('78DA630C626060706040011505F90CFF81342' +
           '310FF0702C64820C393010D302291403A1848F811501300247C09' +
           'A87107125E44A87126A0C60BD35F186A40EEB521A006143E9604D' +
           '480C2C79A809A5820614B404D02116E8E01126E04D4C4010917FC' +
           '6A006F840EBA');
     end;

    Function FindFastRandoms: Boolean;
    var
      i: Integer;
    begin
      for i:=1 to 12 do
      begin
        case I of
         1:  If FindDead then
               Result := True;
         2:  If FindMod then
               Result := True;
         3:  If FindMime then
               Result := True;
         4:  If FindMaze then
               Result := True;
         5:  If FindQuiz then
               Result := True;
         6:  If FindDemon then
               Result := True;
         7: begin
               if NoGameTab then
               begin
                 Result := True;
                 Logout;
                 Exit;
               end;
             end;
         8: begin
               if InBlack then
               begin
                 Result := True;
                 Logout;
                 Exit;
               end;
             end;
         9: begin
                 if(DetectFrogCave) then SolveFrogSwamp;
            end;
         10: begin
                  if(FindFight) then
                  begin
                       RunAwayDirection('W');
                       Wait(10000 + Random(2000));
                       RunBack;
                  end;
             end;
         11: begin
                  FindLamp('Prayer');
             end;
         12: begin
                  if findname or findtalk then
                  begin
                   FindNormalRandoms;
                  end
             end;
        end;
        Wait(1);
      end;
    end;
    ///////////////////////opens the bank and withdraws the ores only for the first time//////////////////
    Procedure WithdrawOres;//based it on the bank opening proces by ThickAsBlood
    var i:integer;

      Begin
       i:=0
       if not (BankScreen) then
        repeat
         i:= + 1;
         if(FindColorTolerance(x, y, BankBooth,MSX1, MSY1, MSX2, MSY2,5))and
         (IsUpText('bank')) then
          Mouse(x,y,0,0,false);
          Wait(1000+random(500));
          ClickOption('ickl', 1);
          Wait(3000+random(1000));
        until (GetColor(229, 41) = 2070783) or (i >= 10) or (BankScreen);
        if (i >= 10) then
          TerminateScript;
          QuickFixBank;
        If(FindBitmap(Iron,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('x', 1);
          TypeSend('18');
        end;
        If(FindBitmap(Coal,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('All', 1);
         end;
        MouseBox(478, 33, 494, 49, 1);
        FindFastRandoms;
     end;

    ///////////////////////Walks to the furnace/////////////////
    Procedure GoToFurnace;
     Begin
      FindColor(x,y,FurnaceMM,mmx1,mmy1,mmx2,mmy2)
      Wait(1000+random(500));
      Mouse(x,y,1,1,true);
      Wait(5000+random(1000));
      FindFastRandoms;
     end;

    /////////////////////Smelt the ores/////////////////////
    Procedure SmeltOres;
    var mins: Integer;
        skill: string;

     Begin
      if(FindColorTolerance(x, y, Furnace,MSX1, MSY1, MSX2, MSY2,5))
      and(IsUpText('elt furn'))then
       begin
        MMouse(x,y,0,0);
        Mouse(x,y,0,0,true);
        Wait(2000+random(1000));
        MouseBox(258, 712, 286, 738, 2);
        ClickOption('x', 1);
        Wait(1000+random(3000))
        HitKeys(true);
        FindFastRandoms;
        Wait(10000+random(5000));
        FindFastRandoms;
        begin
         if ((TimeFromMark(HoverMark) / 1000) / 60 >= mins) then //Used the one out of the xAntiBan by Dankness
         begin
           MarkTime(HoverMark);
           HoverSkill(Skill, False);
         end;
        end;
        wait(20000+random(2000));
        Barsdone:= Barsdone + 19;
       end;
     end;

    //////////////////////back to the bank////////////////////
    Procedure GoToBank;
     begin
      FindColor(x,y,BankSymbol,mmx1,mmy1,mmx2,mmy2)
      Wait(500+random(500));
      Mouse(x,y,1,1,true);
      Wait(3000+random(2000));
      FindFastRandoms;
     end;

    ////////////////////////deposit the ores///////////////////
    Procedure ChangeBarsForOres;
    var i : integer;
     Begin
      begin
      MakeCompass('s');
      Lowestangle;
      i:=0;
      repeat
         i:= 1;
         if (FindObj(x,y,'ank boot',BankBooth,10))then
          Mouse(x,y,0,0,false);
          Wait(1000+random(500));
          ClickOption('ickl', 1);
          Wait(3000+random(1000));
      until (GetColor(229, 41) = 2070783) or (i >= 10) or (BankScreen);
          if (i >= 10) then
          TerminateScript;
          end;
        if FindDTM(Steel, x, y, 568, 216, 715, 325)then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('All', 2);
          QuickFixBank;
        end;
         If(FindBitmap(Iron,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('x', 1);
          TypeSend('18');
        end;
        If(FindBitmap(Coal,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('All', 1);
         end;
        MouseBox(478, 33, 494, 49, 1);
        FindFastRandoms;
        HighestAngle;
     end;
    //////////////////////Main Loop////////////////////////
    Begin
      SetupSRL;
      FreeBitmaps;
      BarsDone:=0
      MakeCompass('s');
      WithdrawOres;
        Repeat
          MakeCompass('n');
          GoToFurnace;
          SmeltOres;
          GoToBank;
          ChangeBarsForOres;
        Until (BarsDone >= Bars)
    end.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  6. #6
    Join Date
    Mar 2007
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ow damn, its supposed to say i not 1, dumb typo
    Thanks for all your help santaclause, it compiles now But the last question is: why doesnt it turn my screen to the south when i ask it to?
    Im sorry but your edited one doesnt work failed to compile, but this version of me compiles:
    SCAR Code:
    Program PortPhasmatysSmelter;
    //by EL_TYCHO
    {.include SRL/SRL.scar}
    {.include SRL/SRL/extended/xbank.scar}

    ///////////Change this if needed///////////////////
    Const Bars = 100 ;//Number of loads to do
          Furnace = 3684413;//Furnace color
          FurnaceMM = 2851583;//Furnace color on the minimap
          BankSymbol =  5890811;//color of the bank symbol
          BankBooth = 923672;//bankbooth color


    ///////////////////Dont touch this/////////////////

    var BarsDone : integer;
        Iron : integer;
        Coal : integer;
        Steel : integer;
    Procedure FreeBitmaps;
     begin
       Iron := BitmapFromString(13, 10, 'z78DA75D25B0E83201005D02D' +
           '316FFC44C4FD2FA9D84BD369B49ADC4C081E0747DBB58938EB29E' +
           '166241575B92E92C2F346CD414E45820B6D72B051D76BADE79DCB' +
           'D94CA57937971DF583D6A993408383848C3D4B3B6DBE2FE75D13A' +
           '641FED39BF34E2327FA09B65D4BB4696BA81D4A0F1A9CDC5BE3CE' +
           '25273A89C355BD8A6F5A613E68E95BAD7EE00C1ECCC8082F2A709' +
           '6F696EF5AFE56776DCE6F4676AAF99C30EAACE9A64556B7FF9C1F' +
           '0D4EF5433BF29FB6CC74BAA59908C772B2D6FCD4919F45DA75D68' +
           'EA97D56BE0E567227F75412BBF6ABF2C0BF9D279E13A77801392D' +
           'A15F');

        Coal := BitmapFromString(14, 9, 'z78DA7592510EC4200844AF243' +
           '0A07EAA75EF7FA4B5E207CD6E359934545F19A6F932C0D2BD4812' +
           'AFEDCF3C78D0741516E6245994559A34CE0FDD75BFE55AC42A4A6' +
           '4A222094E25D25E987E928C2C5D34D69652ECC278639E7AA44D99' +
           '5C5D1FB4ADBC165969F6C18C0457252CFF36D4A41F7260C6930F6' +
           '6E54A8FB7A0BB1F5580A7A92E13197A817EBF18271F5D47E66275' +
           '1AA7B74DF30E4B32438E9CA827CDEDD7693E25EE77052685B3558' +
           '534A765D68EF496609CF9F9371E39F2E474FC6E9A7DB4CAE5AE8B' +
           '5A477B63FEA67966D8A4738DBD392D674B9098E01F665989896B9' +
           'CC91776469AA3');

        Steel := DTMFromString('78DA630C626060706040011505F90CFF81342' +
           '310FF0702C64820C393010D302291403A1848F811501300247C09' +
           'A87107125E44A87126A0C60BD35F186A40EEB521A006143E9604D' +
           '480C2C79A809A5820614B404D02116E8E01126E04D4C4010917FC' +
           '6A006F840EBA');
     end;

    Function FindFastRandoms: Boolean;
    var
      i: Integer;
    begin
      for i:=1 to 12 do
      begin
        case I of
         1:  If FindDead then
               Result := True;
         2:  If FindMod then
               Result := True;
         3:  If FindMime then
               Result := True;
         4:  If FindMaze then
               Result := True;
         5:  If FindQuiz then
               Result := True;
         6:  If FindDemon then
               Result := True;
         7: begin
               if NoGameTab then
               begin
                 Result := True;
                 Logout;
                 Exit;
               end;
             end;
         8: begin
               if InBlack then
               begin
                 Result := True;
                 Logout;
                 Exit;
               end;
             end;
         9: begin
                 if(DetectFrogCave) then SolveFrogSwamp;
            end;
         10: begin
                  if(FindFight) then
                  begin
                       RunAwayDirection('W');
                       Wait(10000 + Random(2000));
                       RunBack;
                  end;
             end;
         11: begin
                  FindLamp('Prayer');
             end;
         12: begin
                  if findname or findtalk then
                  begin
                   FindNormalRandoms;
                  end
             end;
        end;
        Wait(1);
      end;
    end;
    ///////////////////////opens the bank and withdraws the ores only for the first time//////////////////
    Procedure WithdrawOres;//based it on the bank opening proces by ThickAsBlood
    var i:integer;

      Begin
       i:=0
       if not (BankScreen) then
        repeat
         i:= + 1;
         if (FindObj(x,y,'ank boot',BankBooth,10))then
          Mouse(x,y,0,0,false);
          Wait(1000+random(500));
          ClickOption('ickl', 1);
          Wait(3000+random(1000));
        until (GetColor(229, 41) = 2070783) or (i >= 10) or (BankScreen);
        if (i >= 10) then
          TerminateScript;
          QuickFixBank;
        If(FindBitmap(Iron,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('x', 1);
          TypeSend('18');
        end;
        If(FindBitmap(Coal,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('All', 1);
         end;
        MouseBox(478, 33, 494, 49, 1);
        FindFastRandoms;
     end;

    ///////////////////////Walks to the furnace/////////////////
    Procedure GoToFurnace;
     Begin
      FindColor(x,y,FurnaceMM,mmx1,mmy1,mmx2,mmy2)
      Wait(1000+random(500));
      Mouse(x,y,1,1,true);
      Wait(5000+random(1000));
      FindFastRandoms;
     end;

    /////////////////////Smelt the ores/////////////////////
    Procedure SmeltOres;
    var mins: Integer;
        skill: string;

     Begin
      if(FindColorTolerance(x, y, Furnace,MSX1, MSY1, MSX2, MSY2,5))
      and(IsUpText('elt furn'))then
       begin
        MMouse(x,y,0,0);
        Mouse(x,y,0,0,true);
        Wait(2000+random(1000));
        MouseBox(258, 712, 286, 738, 2);
        ClickOption('x', 1);
        Wait(1000+random(3000))
        HitKeys(true);
        FindFastRandoms;
        Wait(10000+random(5000));
        FindFastRandoms;
        begin
         if ((TimeFromMark(HoverMark) / 1000) / 60 >= mins) then //Used the one out of the xAntiBan by Dankness
         begin
           MarkTime(HoverMark);
           HoverSkill(Skill, False);
         end;
        end;
        wait(20000+random(2000));
        Barsdone:= Barsdone + 19;
       end;
     end;

    //////////////////////back to the bank////////////////////
    Procedure GoToBank;
     begin
      FindColor(x,y,BankSymbol,mmx1,mmy1,mmx2,mmy2)
      Wait(500+random(500));
      Mouse(x,y,1,1,true);
      Wait(3000+random(2000));
      FindFastRandoms;
     end;

    ////////////////////////deposit the ores///////////////////
    Procedure ChangeBarsForOres;
    var i : integer;
     Begin
      MakeCompass('s');
      Lowestangle;
      i:=0;
      repeat
         i:= + 1;
         if (FindObj(x,y,'ank boot',BankBooth,10))then
          Mouse(x,y,0,0,false);
          Wait(1000+random(500));
          ClickOption('ickl', 1);
          Wait(3000+random(1000));
      until (GetColor(229, 41) = 2070783) or (i >= 10) or (BankScreen);
          if (i >= 10) then
          TerminateScript;
        if FindDTM(Steel, x, y, 568, 216, 715, 325)then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('All', 2);
          QuickFixBank;
        end;
         If(FindBitmap(Iron,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('x', 1);
          TypeSend('18');
        end;
        If(FindBitmap(Coal,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('All', 1);
         end;
        MouseBox(478, 33, 494, 49, 1);
        FindFastRandoms;
        HighestAngle;
     end;
    //////////////////////Main Loop////////////////////////
    Begin
      SetupSRL;
      FreeBitmaps;
      BarsDone:=0
      MakeCompass('s');
      WithdrawOres;
        Repeat
          MakeCompass('n');
          GoToFurnace;
          SmeltOres;
          GoToBank;
          ChangeBarsForOres;
        Until (BarsDone >= Bars)
    end.

  7. #7
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Hmm, make sure it isn't already on South...it should work fine other than that.
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  8. #8
    Join Date
    Mar 2007
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Jup works now, thanks
    But it doesnt find my iron and coal bitmaps, it just closes the bank.
    I also added a player so it can log in and do the AntiRandoms better
    SCAR Code:
    Program PortPhasmatysSmelter;
    //by EL_TYCHO
    {.include SRL/SRL.scar}
    {.include SRL/SRL/extended/xbank.scar}

    ///////////Change this if needed///////////////////
    Const Bars = 100 ;//Number of loads to do
          Furnace = 3684413;//Furnace color
          FurnaceMM = 2851583;//Furnace color on the minimap
          BankSymbol =  5890811;//color of the bank symbol
          BankBooth = 923672;//bankbooth color


    ///////////////////Dont touch this/////////////////

    var BarsDone : integer;
        Iron : integer;
        Coal : integer;
        Steel : integer;

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

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

    Procedure FreeBitmaps;
     begin
       Iron := BitmapFromString(13, 10, 'z78DA75D25B0E83201005D02D' +
           '316FFC44C4FD2FA9D84BD369B49ADC4C081E0747DBB58938EB29E' +
           '166241575B92E92C2F346CD414E45820B6D72B051D76BADE79DCB' +
           'D94CA57937971DF583D6A993408383848C3D4B3B6DBE2FE75D13A' +
           '641FED39BF34E2327FA09B65D4BB4696BA81D4A0F1A9CDC5BE3CE' +
           '25273A89C355BD8A6F5A613E68E95BAD7EE00C1ECCC8082F2A709' +
           '6F696EF5AFE56776DCE6F4676AAF99C30EAACE9A64556B7FF9C1F' +
           '0D4EF5433BF29FB6CC74BAA59908C772B2D6FCD4919F45DA75D68' +
           'EA97D56BE0E567227F75412BBF6ABF2C0BF9D279E13A77801392D' +
           'A15F');

        Coal := BitmapFromString(14, 9, 'z78DA7592510EC4200844AF243' +
           '0A07EAA75EF7FA4B5E207CD6E359934545F19A6F932C0D2BD4812' +
           'AFEDCF3C78D0741516E6245994559A34CE0FDD75BFE55AC42A4A6' +
           '4A222094E25D25E987E928C2C5D34D69652ECC278639E7AA44D99' +
           '5C5D1FB4ADBC165969F6C18C0457252CFF36D4A41F7260C6930F6' +
           '6E54A8FB7A0BB1F5580A7A92E13197A817EBF18271F5D47E66275' +
           '1AA7B74DF30E4B32438E9CA827CDEDD7693E25EE77052685B3558' +
           '534A765D68EF496609CF9F9371E39F2E474FC6E9A7DB4CAE5AE8B' +
           '5A477B63FEA67966D8A4738DBD392D674B9098E01F665989896B9' +
           'CC91776469AA3');

        Steel := DTMFromString('78DA630C626060706040011505F90CFF81342' +
           '310FF0702C64820C393010D302291403A1848F811501300247C09' +
           'A87107125E44A87126A0C60BD35F186A40EEB521A006143E9604D' +
           '480C2C79A809A5820614B404D02116E8E01126E04D4C4010917FC' +
           '6A006F840EBA');
     end;

    Function FindFastRandoms: Boolean;
    var
      i: Integer;
    begin
      for i:=1 to 12 do
      begin
        case I of
         1:  If FindDead then
               Result := True;
         2:  If FindMod then
               Result := True;
         3:  If FindMime then
               Result := True;
         4:  If FindMaze then
               Result := True;
         5:  If FindQuiz then
               Result := True;
         6:  If FindDemon then
               Result := True;
         7: begin
               if NoGameTab then
               begin
                 Result := True;
                 Logout;
                 Exit;
               end;
             end;
         8: begin
               if InBlack then
               begin
                 Result := True;
                 Logout;
                 Exit;
               end;
             end;
         9: begin
                 if(DetectFrogCave) then SolveFrogSwamp;
            end;
         10: begin
                  if(FindFight) then
                  begin
                       RunAwayDirection('W');
                       Wait(10000 + Random(2000));
                       RunBack;
                  end;
             end;
         11: begin
                  FindLamp('Prayer');
             end;
         12: begin
                  if findname or findtalk then
                  begin
                   FindNormalRandoms;
                  end
             end;
        end;
        Wait(1);
      end;
    end;
    ///////////////////////opens the bank and withdraws the ores only for the first time//////////////////
    Procedure WithdrawOres;//based it on the bank opening proces by ThickAsBlood
    var i:integer;

      Begin
       i:=0
       if not (BankScreen) then
        repeat
         i:= + 1;
         if (FindObj(x,y,'ank boot',BankBooth,10))then
          Mouse(x,y,0,0,false);
          Wait(1000+random(500));
          ClickOption('ickl', 1);
          Wait(3000+random(1000));
        until (GetColor(229, 41) = 2070783) or (i >= 10) or (BankScreen);
        if (i >= 10) then
          TerminateScript;
          QuickFixBank;
        If(FindBitmap(Iron,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('x', 1);
          TypeSend('18');
        end;
        If(FindBitmap(Coal,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('All', 1);
         end;
        MouseBox(478, 33, 494, 49, 1);
        FindFastRandoms;
     end;

    ///////////////////////Walks to the furnace/////////////////
    Procedure GoToFurnace;
     Begin
      FindColor(x,y,FurnaceMM,mmx1,mmy1,mmx2,mmy2)
      Wait(1000+random(500));
      Mouse(x,y,1,1,true);
      Wait(5000+random(1000));
      FindFastRandoms;
     end;

    /////////////////////Smelt the ores/////////////////////
    Procedure SmeltOres;
    var mins: Integer;
        skill: string;

     Begin
      if(FindColorTolerance(x, y, Furnace,MSX1, MSY1, MSX2, MSY2,5))
      and(IsUpText('elt furn'))then
       begin
        MMouse(x,y,0,0);
        Mouse(x,y,0,0,true);
        Wait(2000+random(1000));
        MouseBox(258, 712, 286, 738, 2);
        ClickOption('x', 1);
        Wait(1000+random(3000))
        HitKeys(true);
        FindFastRandoms;
        Wait(10000+random(5000));
        FindFastRandoms;
        begin
         if ((TimeFromMark(HoverMark) / 1000) / 60 >= mins) then //Used the one out of the xAntiBan by Dankness
         begin
           MarkTime(HoverMark);
           HoverSkill(Skill, False);
         end;
        end;
        wait(20000+random(2000));
        Barsdone:= Barsdone + 19;
       end;
     end;

    //////////////////////back to the bank////////////////////
    Procedure GoToBank;
     begin
      FindColor(x,y,BankSymbol,mmx1,mmy1,mmx2,mmy2)
      Wait(500+random(500));
      Mouse(x,y,1,1,true);
      Wait(3000+random(2000));
      FindFastRandoms;
     end;

    ////////////////////////deposit the ores///////////////////
    Procedure ChangeBarsForOres;
    var i : integer;
     Begin
      MakeCompass('s');
      Lowestangle;
      i:=0;
      repeat
         i:= + 1;
         if (FindObj(x,y,'ank boot',BankBooth,10))then
          Mouse(x,y,0,0,false);
          Wait(1000+random(500));
          ClickOption('ickl', 1);
          Wait(3000+random(1000));
      until (GetColor(229, 41) = 2070783) or (i >= 10) or (BankScreen);
          if (i >= 10) then
          TerminateScript;
        if FindDTM(Steel, x, y, 568, 216, 715, 325)then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('All', 2);
          QuickFixBank;
        end;
         If(FindBitmap(Iron,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('x', 1);
          TypeSend('18');
        end;
        If(FindBitmap(Coal,x,y)) then
         begin
          Wait(1000+random(500));
          Mouse(x,y,2,2,false);
          ClickOption('All', 1);
         end;
        MouseBox(478, 33, 494, 49, 1);
        FindFastRandoms;
        HighestAngle;
     end;
    //////////////////////Main Loop////////////////////////
    Begin
      SetupSRL;
      DeclarePlayers;
     if (not(LoggedIn)) then
      LoginPlayer;
      FreeBitmaps;
      BarsDone:=0
      MakeCompass('s');
      WithdrawOres;
        Repeat
          MakeCompass('n');
          GoToFurnace;
          SmeltOres;
          GoToBank;
          ChangeBarsForOres;
        Until (BarsDone >= Bars)
    end.

  9. #9
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    It probably just isn't a good bitmap. Did you save as 24-bit and make sure that the background is black?
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  10. #10
    Join Date
    Mar 2007
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nope lol, thats prob why its bad
    But i made DTM's of them so that theyr smaller, gonna test those now

  11. #11
    Join Date
    Mar 2007
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    DTM's work but the click option doesnt work, it doesnt click the option

  12. #12
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    ClickOption('All', 1);

    Make it :

    SCAR Code:
    ClickOption('ll', 1);
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  13. #13
    Join Date
    Mar 2007
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    But the click option x doesnt work either, it click examin in stead of withdraw x

  14. #14
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh. Make it:

    SCAR Code:
    ClickOption('X', 1);
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  15. #15
    Join Date
    Mar 2007
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    BTW how do i make it jump the screen from scar to rs automaticly when i press play?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Invalid Number Of Parameters
    By decide in forum OSR Help
    Replies: 3
    Last Post: 07-28-2008, 06:11 AM
  2. Invalid number of parameters
    By kristahlyn in forum OSR Help
    Replies: 2
    Last Post: 06-16-2007, 02:39 PM
  3. Invalid Number of Parameters
    By richyyrich09 in forum OSR Help
    Replies: 6
    Last Post: 06-12-2007, 10:48 PM
  4. invalid number of parameters
    By stuckman in forum OSR Help
    Replies: 4
    Last Post: 05-27-2007, 01:32 PM
  5. Invalid Number Of Parameters
    By Any-key in forum OSR Help
    Replies: 12
    Last Post: 04-21-2007, 12:11 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
  •