Page 2 of 2 FirstFirst 12
Results 26 to 30 of 30

Thread: Type Mismatch

  1. #26
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh, it worked, thanks.

    I have 7 begins and 8 ends now though....So does a case count as another begin?

  2. #27
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Runescapian321 View Post
    Oh, it worked, thanks.

    I have 7 begins and 8 ends now though....So does a case count as another begin?
    Yes
    Active only during the Summer...

  3. #28
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Getting another error, pretty much the same as the one I got when I tried a Drop procedure (By the way I counted my begins/ends, I got 1 case, 7 begins, 8 ends)

    SCAR Code:
    //This is my first script, a powerminer. Put your picks in the first three inventory slots (DO NOT
    //TAKE ANYTHING ELSE), the first three because things in those spots won't be dropped
    // and fill in the info in lines 10-13 and 18-26

    //Big thanks to Derek, Method, and JackLKrawl for helping me fix errors and and suggesting what functions I should use

    program PowerMinerByScapian;
    {.include SRL/SRL.scar}

      var
        cx,cy,x,y:integer;
      const

        YourSRLId = '';  //Enter your SRL Stats ID number, if you don't have one go here - [url]http://www.stats.srl-forums.com/[/url]
        YourSRLPassword =''; //Your SRL Stats password

        RockColor1 = 3890561; //put the color of the rock (using the color picker) before the ; but after the =
        RockColor2 = 3463635; //same as above, just a slightly different color
        RockColor3 = 3624564; //same as above, just a slightly different color
        WaitTime = 10000; //Time you want it to wait in between clicking rocks (multiply by 1000,
                             //1 second = 1000, 2 seconds = 2000, etc)

    Procedure DeclarePlayers;
    begin
        HowManyPlayers := 1;   //Ignore this line, just be sure to set the players you won't be using False
        NumberOfPlayers(HowManyPlayers);  //Ignore this line
        CurrentPlayer := 0; //Which player do you want to start with? (0 is the first player)

        Players[0].Name := '';  //Put the name of your rs character here
        Players[0].Pass := '';  //Put the password of your rs character here
        Players[0].Nick := '';  //Put 3-4 letters of your rs name in here(Not the first letter
                                 //and no spaces or _'s.
        Players[0].Active := True; //Are you using this player? True is Yes, False is no.

        NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    end;




    procedure Mining;
      begin
        repeat
           if (FindObjCustom(x, y, ['Mine','ine O','ne Or','e Ore','Ore'], [RockColor1, RockColor2, RockColor3], 5)) then
               Mouse(x, y, 0, 0, True);
           else
            begin
              Writeln('Rock color not found, terminating script');
              TerminateScript;
            end;
          FTWait;
          wait(WaitTime);
          FindNormalRandoms;
        until(InvFull)
       
      end;

    procedure Drop;
      begin
        FindNormalRandoms;
        DropExcept([1,2,3])
      end;
     
    procedure Randoms;
      begin
        FindNormalRandoms;
        FTwait;
      end;

     
    procedure AntiBan;    //by SRL Devs
      var Ban: Integer;
        begin
        Ban:= random(5);
          case Ban of
            0: RandomRClick;
            1: HoverSkill('mining', False);
            2: PickUpMouse;
            3: AlmostLogout;
            4: Wait2(3 + random(9), true);
            5: BoredHuman;
          end;
        end;



    begin
     SetupSRL;
     ScriptID := '532';
     SRLId := YourSRLId;
     SRLPassword:= YourSRLPassword;
     ActivateClient;
     DeclarePlayers;
     Mining;
     Drop;
     Randoms;
     AntiBan;
     repeat
       Mining;
       Drop;
       Randoms;
       AntiBan;
     until(false)
    end.

    Line 46: [Error] (15074:1): Identifier expected in script C:\Program Files\SCAR 3.12\Scripts\PowerMinerByScapian.scar
    It's the else in the mining procedure

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

    Default

    When you have an else statement, the line before it shouldn't have a semi-colon.

    Therefore, this is right:

    SCAR Code:
    procedure Mining;
      begin
        repeat
           if (FindObjCustom(x, y, ['Mine','ine O','ne Or','e Ore','Ore'], [RockColor1, RockColor2, RockColor3], 5)) then
               Mouse(x, y, 0, 0, True)
           else
            begin
              Writeln('Rock color not found, terminating script');
              TerminateScript;
            end;
          FTWait;
          wait(WaitTime);
          FindNormalRandoms;
        until(InvFull)
       
      end;

    Nice standards
    [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]

  5. #30
    Join Date
    Sep 2007
    Location
    Pennsylvania
    Posts
    3,396
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Santa_Clause View Post
    When you have an else statement, the line before it shouldn't have a semi-colon.

    Therefore, this is right:

    SCAR Code:
    procedure Mining;
      begin
        repeat
           if (FindObjCustom(x, y, ['Mine','ine O','ne Or','e Ore','Ore'], [RockColor1, RockColor2, RockColor3], 5)) then
               Mouse(x, y, 0, 0, True)
           else
            begin
              Writeln('Rock color not found, terminating script');
              TerminateScript;
            end;
          FTWait;
          wait(WaitTime);
          FindNormalRandoms;
        until(InvFull)
       
      end;
    Aaah, thanks

    Nice standards
    Thanks I never really read any tuts on it, I just put spaces wherever I feel I should lol.


    Time to go read a tut on failsafes and put em in...Then I'll be done! I'll just have to ask to use somebody's Gas finder and pick head finder (until I have time to make my own) then I can release my script, woot!

    EDIT: failsafes seem a bit harder than I thought, going to finish learning them later...

    Now I have another problem, when the character mines an inventory full and gets ready to drop, it gives me this

    [Runtime Error] : Out Of Range in line 494 in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/Core/Inventory.scar
    And opens inventory.scar

    That part of it is

    SCAR Code:
    {*******************************************************************************
    procedure DropExcept(I: Array of Integer);
    By: Spky
    Description: Drops all except item(s) specified by inventory number(s).
    *******************************************************************************}


    procedure DropExcept(I: array of Integer);
    var
      InvSpot, En: Integer;
    begin
      for InvSpot := 1 to 28 do
      begin
        if (not (InvSpot = I[En])) then //this is 494
          DropItem(InvSpot) else
          En := En + 1;
      end;
    end;

    My script is
    SCAR Code:
    //This is my first script, a powerminer. Put your pick in the first inventory slot (DO NOT
    //TAKE ANYTHING ELSE)
    // and fill in the info in lines 10-13 and 18-26
    //Start logged in for now, I'll add logging in later

    //Big thanks to Derek, Method, and JackLKrawl for helping me fix errors and and suggesting what functions I should use

    program PowerMinerByScapian;
    {.include SRL/SRL.scar}

      var
        inventories,x,y:integer;
      const

        YourSRLId = '';  //Enter your SRL Stats ID number, if you don't have one go here - [url]http://www.stats.srl-forums.com/[/url]
        YourSRLPassword =''; //Your SRL Stats password

        RockColor1 = 3890561; //put the color of the rock (using the color picker) before the ; but after the =
        RockColor2 = 3463635; //same as above, just a slightly different color
        RockColor3 = 3624564; //same as above, just a slightly different color
        RockTolerance = 10; //10 should be fine, but if it's not finding the rock then increase it and/or change the above colors
        WaitTime = 10000; //Time you want it to wait in between clicking rocks (multiply by 1000,
                             //1 second = 1000, 2 seconds = 2000, etc)
                             //NOTE: because of a bit of antiban this will automatically include an
                             //extra 5 sec or so

    Procedure DeclarePlayers;
    begin
        HowManyPlayers := 1;   //Ignore this line, just be sure to set the players you won't be using False
        NumberOfPlayers(HowManyPlayers);  //Ignore this line
        CurrentPlayer := 0; //Which player do you want to start with? (0 is the first player)

        Players[0].Name := '';  //Put the name of your rs character here
        Players[0].Pass := '';  //Put the password of your rs character here
        Players[0].Nick := '';  //Put 3-4 letters of your rs name in here(Not the first letter
                                 //and no spaces or _'s.
        Players[0].Active := True; //Are you using this player? True is Yes, False is no.

        NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    end;




    procedure Mining;
      begin
        repeat
           if (FindObjCustom(x, y, ['Mine','ine O','ne Or','e Ore','Ore'], [RockColor1, RockColor2, RockColor3], RockTolerance)) then
               Mouse(x, y, 0, 0, True)
           else
            begin
              Writeln('Rock color not found, terminating script');
              TerminateScript;
            end;
          wait(WaitTime + random(20));
          FindNormalRandoms;
          RandomRClick;
          HoverSkill('mining', False);
        until(InvFull)
       
      end;

    procedure Drop;
      begin
        FindNormalRandoms;
        DropExcept([1])
        Inventories:=Inventories+1;
      end;
     
    procedure Randoms;
      begin
        FindNormalRandoms;
      end;

     
    procedure AntiBan;    //by SRL Devs
      var Ban: Integer;
        begin
        Ban:= random(5);
          case Ban of
            0: RandomRClick;
            1: HoverSkill('mining', False);
            2: PickUpMouse;
            3: AlmostLogout;
            4: Wait2(3 + random(9), true);
            5: BoredHuman;
          end;
        end;
       
    procedure CheckSrlId;
      begin
       if (YourSRLId = '') then
         begin
           Writeln('You need an SRL Stats account to use this script :)')
           Writeln('If you dont have one, go here - http://www.stats.srl-forums.com')
           Writeln('Signing up takes 1 minute, dont be lazy')
           Writeln('Srl stats are awesome, you can show off how long you have been running scripts!')
           TerminateScript;
         end
       else
         begin
           exit;
         end;
      end;
       
    procedure proggy;
      begin
        Writeln('|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|');
        Writeln('|\/\/\/\/\/\/ Power Miner by Scapian /\/\/\/\/\/\/\|');
        Writeln('|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\//\/\/\/\|');
        Writeln('|\/\ We have done' +intToStr(inventories) + 'inventories of ores so far! /\|');
        Writeln('|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\//\/\/\/\|');
        Writeln('|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|');
        Writeln('|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\//\/\/\/\|');
      end;
     
    procedure siggy;
      begin
        Writeln('I hope you had a great experience with the Scapian Power Miner!')
        Writeln('                   Hope to see you again!                      ')
        Writeln('                                   -Scapian')
      end;



    begin
     SetupSRL;
     ScriptID := '532';
     SRLId := YourSRLId;
     SRLPassword:= YourSRLPassword;
     CheckSrlId;
     FindRS;
     ActivateClient;
     DeclarePlayers;
     Mining;
     Drop;
     Randoms;
     AntiBan;
     repeat
       Mining;
       Drop;
       Randoms;
       AntiBan;
     until(false)
       Siggy;
    end.

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Type Mismatch...
    By Raskolnikov in forum OSR Help
    Replies: 3
    Last Post: 10-18-2008, 05:56 AM
  2. Type mismatch
    By batnas in forum OSR Help
    Replies: 3
    Last Post: 04-24-2008, 06:48 PM
  3. Type Mismatch..
    By Nava2 in forum OSR Help
    Replies: 1
    Last Post: 04-23-2008, 07:44 PM
  4. Type mismatch Help
    By Ashur2Good in forum OSR Help
    Replies: 2
    Last Post: 05-23-2007, 03:47 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
  •