Results 1 to 4 of 4

Thread: Type mismatch

  1. #1
    Join Date
    Dec 2011
    Posts
    25
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Type mismatch

    Hey, I'm trying to make my first script(A Alkharid cooker only will cook salmon atm) and I am having some trouble:/ can anyone help me?

    Here is the problem: (its in the UseOnRange procedure)
    Code:
    [Error] (155:20): Type mismatch at line 154
    Compiling failed.
    Here is the script:
    Code:
    program AProCooker;
    
    {$i srl/srl/misc/smart.scar}
    {$i srl/srl.scar}
    {$i SRL/SRL/Misc/stats.simba}
    
    const
      SRLStats_User = ''; // Your SRL Stats ID
      SRLStats_Password = ''; // Your SRL Stats Password
    
    var
      X, Y, x1, y1, rawFish: Integer;
    
    
    
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
      NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
      CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)
    
      Players[0].Name := ''; // Username
      Players[0].Pass := ''; // Password
      Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
      Players[0].Active := True; // Set to true if you want to use Player 0
      Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
      Players[0].BoxRewards := ['Xp', 'mote', 'ostume'];//Set BoxRewards to AntiRandom rewards
    end;
    
    procedure SetupLogin; // Logs Player In
    begin
      // These 4 lines HAVE to be set BEFORE you call SetupSRL;
      Smart_Server := 98;
      Smart_Members := False;
      Smart_Signed := True;
      Smart_SuperDetail := False;
    
      ClearDebug;
      SetupSRL;
      DeclarePlayers; // Calls the procedure, you can't forget this!
      LoginPlayerToLob;
      SelectWorld(7);
      LoginPlayer; // You want your player to login, right?
    end;
    
    function Walking(Color, Tolerance: Integer; SortFrom: tpoint): Boolean;
    var
      i, x, y, rx, ry: Integer;
      TPA: TPointArray;
    begin
      if not LoggedIn then Exit;
      FindNormalRandoms;
      FindColorsSpiralTolerance(MMCX, MMCY, TPA, Color, MMX1, MMY1, MMX2, MMY2, 35);
      SortTPAFrom(TPA, SortFrom);
    
      for i := 0 to High(TPA) do
      begin
        x := TPA[i].x;
        y := TPA[i].y;
    
        rx := RandomRange(-6, 6);
        ry := RandomRange(-6, 6);
        if (not rs_OnMinimap(x + rx, y + ry)) then
          Continue;
    
        Mouse(x + rx, y + ry, 0, 0, true);
        FFlag(0);
        Wait(200 + Random(500));
        Result := True;
        Break;
      end;
    end;
    
    function ContainsRFish:boolean;
    var
    ChosenFish: Integer;
    begin
      GameTab(25);
      ChosenFish := BitmapFromString(30, 26, 'meJzN1MsRhSAMBVBLo5SUklJYWI' +
            'id8SCBgMYPARYvc1c4OSIOCWFZbdu2DjuxCLgcZ/YP5aeuuO4AZtj' +
            'YrnuFHZO5XcuyLrKUiU1xGRchrlDQES7pwbXcgGQyix6pOvd8YgEa' +
            'sJoOPLF++ByqVk1mj34zlJO87vBkVrbTzLv9MCfZR3MNq8wJ9s1k1' +
            'iQTe/OPLhlnn81x9mWfHDubbnqufJvQ3+EDMpnxou0+mZzy+flF8Z' +
            'HpohU5te/Ufi/n2CYwy8y2UTLyzDHJmkU4UsqoMc3zD9k4vl5wXZN' +
            'mrB9tRImn');
      Result := (FindBitmapToleranceIn(ChosenFish, X, Y, 560, 214, 734, 457, 35));
      FreeBitmap(ChosenFish);
    end;
    
    procedure BankCFish;
    begin
      OpenBankFast(Bank_AK);
      wait(1000);
      DepositAll;
      wait(800);
      CloseBank;
      wait(1000);
    end;
    
    function ContainsCFish:boolean;
    var
    ChosenFish: Integer;
    begin
      GameTab(25);
      ChosenFish := BitmapFromString(28, 25, 'meJz7/59SwMTAAEQUG4NioLNPpW' +
            'dQExWNBRrl5lfrHdJGqpm41APFHT1L3f3ryDDQ1iUXUxdEnAyPQzR' +
            'aO2Wi6QJyLexT7d0LXX2rIR6HIyINtHRMN7KMgqiH6xVUrxbW7hDV' +
            'myxmNN8ntANosldwC0E3A2UhBprbJZtYxUCMElApBJompNkkotsra' +
            'jBDwmxNeNLssMRZofEzCLoT2UAz20RT6zgB1VIhjTphrTYR3X5R/W' +
            'lA50lZ70zMXZeQs4ZIXwMNBIYY0EBB9VphrRagq0T0JorqTxEzmAU' +
            '0TdxkibTtAQX3B0QmeIgyoJOAHgSGmIhON9hhCNMkTFdK2+xTcLtH' +
            'ZHSDA78WZBrQj9hMkzRfR6qBQhoNQNOEtbuwmiZluVXaZq+8213iD' +
            'QSGG8izwAjFME3ScjMwRoBhSJqB4KADpTfD2eLGi8RNlqGYZrNPxu' +
            '6IvOttBY8nREYKyLPAaDWYIW68EGqUxUagT+GmyTicJMlAeHqTMF0' +
            'OCjSrbWCj9krbHoSYJut0Xt71loLHY+J9LWY0FxRuZmvADtuNMMrx' +
            'jJzTRTnnqyQZCDEzJG5aRPLc6LRFcZnLgZkCaBrIQIfTIAQ2FuhrR' +
            'e83JJkZEBCcWrQ1OX9jUt4GIJKxOwx0LdD8+OzVwKyXUrCZ1NoBqB' +
            'hiIByBPG53JCZ9CdDxUakLgYzA6Imkmgl0CTKSdTwHREBHQowFhgy' +
            'w2CHDnWnF29JLdmSU7pR3uSHnch0SesSXtJhmZpXvzarYl115IKfq' +
            'oIL7Q6rUrZQ4CSsAAJSdhkI=');
      Result := (FindBitmapToleranceIn(ChosenFish, X, Y, 560, 214, 734, 457, 35));
      FreeBitmap(ChosenFish);
    end;
    
    procedure GetFish;
    begin
      rawFish := DTMFromString('meJzN1MsRhSAMBVBLo5SUklJYWI' +
            'id8SCBgMYPARYvc1c4OSIOCWFZbdu2DjuxCLgcZ/YP5aeuuO4AZtj' +
            'YrnuFHZO5XcuyLrKUiU1xGRchrlDQES7pwbXcgGQyix6pOvd8YgEa' +
            'sJoOPLF++ByqVk1mj34zlJO87vBkVrbTzLv9MCfZR3MNq8wJ9s1k1' +
            'iQTe/OPLhlnn81x9mWfHDubbnqufJvQ3+EDMpnxou0+mZzy+flF8Z' +
            'HpohU5te/Ufi/n2CYwy8y2UTLyzDHJmkU4UsqoMc3zD9k4vl5wXZN' +
            'mrB9tRImn');
      OpenBankFast(Bank_AK);
      wait(1000);
      WithdrawItem( rawFish, 'dtm', 28, 'a', []);
      wait(800);
      CloseBank;
      wait(1000);
    end;
    
    procedure WalkToBank;
    begin
      Walking(5995943, 23, Point(612, 135))
    end;
    
    procedure WalkToRange;
    begin
      Walking(8230074, 23, Point(680, 82))
    end;
    
    procedure UseOnRange;
    begin
      InvMouse(0, 'se');
      wait(1000);
      if FindObj(x1, y1, 'se', 1713847, 25) then
        begin
          Mouse(x1, y1, 0, 0, false);
          ChooseOption('se');
        end;
    end;
    
    
    
    
    
    procedure MainLoop;
    begin//main loop
      DeclarePlayers;
      SetupLogin;
        if (ContainsRFish) and (FindSymbol(x, y, 'range') == false) then
        begin
          WalkToRange;
        end;
        if (ContainsCFish) and (Banks.IsTargetValid) then
        begin
          WalkToBank;
        end;
        if (ContainsRFish) and (FindSymbol(x, y, 'range')) then
        begin
          UseOnRange;
        end;
        if (ContainsCFish) and (Banks.IsTargetValid) then
        begin
          BankCFish;
        end;
        if (InvEmpty) then
        begin
          GetFish;
        end;
    
    end;
    
    begin
      MainLoop();
    end.

  2. #2
    Join Date
    Nov 2011
    Location
    Louisiana
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I could be wrong, but I believe you have to have [] around the Uptext. So it would be ['Use'] in the FindObj function.
    Last edited by shstiger2009; 12-22-2011 at 05:54 PM.

  3. #3
    Join Date
    Dec 2011
    Location
    P2P :)
    Posts
    561
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Simba Code:
    procedure UseOnRange;
    begin
      InvMouse(0, 'se');//This is your issue. what exactly are you trying to do?
      wait(1000);
      if FindObj(x1, y1, 'se', 1713847, 25) then
        begin
          Mouse(x1, y1, 0, 0, false);
          ChooseOption('se');
        end;
    end;

    InvMouse
    function InvMouse(InvSlot, Action: Byte) : boolean;
    A combined MouseItem & MMouseItem, will hopefully replace both procedures one day. Usage is like SRL’s MouseBox, Action determines what to do:

    1: Leftclick
    2: Rightclick
    3: Move mouse to item
    Note by EvilChicken!
    Example:

    if InvMouse(1, rightClick) then
    WaitOption('eposit', 500);
    I wear my scars like the rings on a pimp
    I live life like the captain of a sinking ship
    Always sell your product for ATLEAST mid to ensure that the market doesn't drop.

  4. #4
    Join Date
    Jun 2006
    Posts
    694
    Mentioned
    0 Post(s)
    Quoted
    31 Post(s)

    Default

    Simba Code:
    if InvMouse(1, leftClick) then

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
  •