Results 1 to 5 of 5

Thread: Errors with my script...

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

    Default Errors with my script...

    Here it is (IMO it's starting to look decent )

    SCAR Code:
    //This is my first script, a powerminer.Put your pickaxe in the first slot. If you are taking
    //more than one pickaxe be aware that the least valuable one's heads might get lost.
    //If you bring multiple pickaxes that are the same (like 2 rune picks) one's head might get lost
    //Otherwise just fill in the info in lines 20-72 and you should be ready to go!

    //If the autocolor isn't working go to my 'AutoColor' procedure and change the colors
    //(I haven't tested most of them) and please report to me that they weren't working

    //If the best pick is lost, the script will stop

    //Most likely this will not work on the rocks that are covered in the brown stuff
    //Unless you change the colors in the AutoColor procedure


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

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

      var
        RockColor1, RockColor2, RockColor3, Ore, AmountLoads, inventories, x, y:integer;

      const

        YourSRLId = '5';  //Enter your SRL Stats ID number, if you don't have one go here - [url]http://www.stats.srl-forums.com/[/url]
        YourSRLPassword ='5'; //Your SRL Stats password
        Rundirection = 'N'; //Direction to run, north, south etc. n, s, e, or w


        RockTolerance = 10; //10 should be fine, but if it's not finding the rock then increase it and/or change the above colors
        WaitTime = 2500; //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 2-3 sec or so
        IfGasFound = 15000; //Time you want it to wait after it finds a gas (before mining again)
                            //same thing with the 1 second = 1000
        Loads = 1; //How many loads do you want each character to do before logging out?
        MineRockLength = 600000; ////Time you want it to mine an inventory of rocks before giving up (multiply by 1000,
                             //1 second = 1000, 2 seconds = 2000, etc)




    Procedure DeclarePlayers;
    begin
        HowManyPlayers := 4;   //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 := 'jamesgames5';  //Put the name of your rs character here
        Players[0].Pass := 'ratchetdeadlocked';  //Put the password of your rs character here
        Players[0].Nick := 'ames';  //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.
        Players[0].Strings[1]:= 'copper'; //What ore are you mining? copper, tin, iron, coal, mith
                                            //NOTE: IF ADDY OR RUNE YOU'LL HAVE TO SET YOUR OWN COLORS
                                            //IN THE AUTOCOLOR PROCEDURE(it's right after this DeclarePlayers)
        Players[0].Integers[1]:= 1; //How many pickaxes on the character?




       
        Players[1].Name := '';
        Players[1].Pass := '';             //to set the rest of these up just refer to the above instructions
        Players[1].Nick := '';
        Players[1].Active := False;
        Players[1].Strings[1]:= 'copper';
        Players[1].Integers[1]:= 1;

        Players[2].Name := '';
        Players[2].Pass := '';
        Players[2].Nick := '';
        Players[2].Active := False;
        Players[2].Strings[1]:= 'copper';
        Players[2].Integers[1]:= 1;
       
        Players[3].Name := '';
        Players[3].Pass := '';
        Players[3].Nick := '';
        Players[3].Active := False;
        Players[3].Strings[1]:= 'copper';
        Players[3].Integers[1]:= 1;


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


    procedure AutoColor;
      begin
        If (Players[CurrentPlayer].Strings[1] = 'copper') then
          begin
            RockColor1 := 3890561;
            RockColor2 := 3463635;
            RockColor3 := 3624564;
            exit;
          end;

        if (Players[CurrentPlayer].Strings[1] = 'tin') then
          begin
            RockColor1 := 6053220;
            RockColor2 := 8750479;
            RockColor3 := 9079701;
            exit;
          end;
         
        if (Players[CurrentPlayer].Strings[1] = 'iron') then
          begin
            RockColor1 := 2832734;
            RockColor2 := 1844541;
            RockColor3 := 2898785;
            exit;
          end;
         
        if (Players[CurrentPlayer].Strings[1] = 'coal') then
          begin
            RockColor1 := 2438967;
            RockColor2 := 2966339;
            RockColor3 := 2768703;
            exit;
          end;
         
        if (Players[CurrentPlayer].Strings[1] = 'mith') then
          begin
            RockColor1 := 6570819;
            RockColor2 := 7950930;
            RockColor3 := 6373697;
            exit;
          end;
         
        if (Players[CurrentPlayer].Strings[1] = 'addy') then
          begin
            {RockColor1 := ;
            RockColor2 := ;
            RockColor3 := ;
            exit;
            Just fill the rockcolors out and remove braces}

            Writeln('You have to put your own colors if you want to powermine addy');
            TerminateScript;
          end;
         
        if (Players[CurrentPlayer].Strings[1] = 'rune') then
          begin
            {RockColor1 := ;
            RockColor2 := ;
            RockColor3 := ;
            exit;
            Just fill the rockcolors out and remove braces}

            Writeln('You have to put your own colors if you want to powermine rune');
            TerminateScript;
          end;
      end;
     
    procedure WhatPick;
     var BronzePick, IronPick, SteelPick, MithPick, AddyPick, RunePick, PickStick:integer;

      begin

        BronzePick := DTMFromString('78DA639460666010666240068E46720CEC409' +
           'A1188FF0301A32C508D24AA1A882C8C04D2F240356204D48802D5' +
           'C81150230454A34C400D3F508D160135BC40353A04D4F01161973' +
           '0117EE727EC77009D1506D6');
        IronPick := DTMFromString('78DA631467666078CFC8800C1C6D6C18D8813' +
           '448F43F10302A02D57C435503918591405A02A8E62B0135C24035' +
           'FF08A8E103AAE16022ACE63F017378806A3E1150230D54F316BF1' +
           'A00853D0C59');
        SteelPick := DTMFromString('78DA633CC2C4C0200CC448202B3989811D483' +
           '302F17F2060DC09941743550391859140FA0C116A0E00E51508A8' +
           'D907945721A0E624505E94809A53407949026A7600E5B588708F3' +
           '40135BB099B03007CB90E23');
        MithPick := DTMFromString('78DA637464666078CFC8800C0C8DBC18D8813' +
           '448F43F10309A03D5703031A00246241248DB03D5FC62C4AFC616' +
           'A8E61F0135D64498630154F39F08359F08A8F104AAF946408D1B5' +
           '0CD07FC6A00EE190EDE');
        AddyPick := DTMFromString('78DA637CC7C4C0200CC448C0D2C38A811D483' +
           '302F17F2060FC01949746550391859140FA33505E94809AB74079' +
           '29026A5E00E55508A8790A94D724A0E609505E8708731409A8790' +
           'C941723A0E611505E03BF1A003F4C0F5A');
        RunePick := DTMFromString('78DA637CCBC4C0F09E91011998790430B0036' +
           '990E87F2060FC0E54F30D550D44164602E9D74035BF09A8790154' +
           'F39F809A2740351C4CF8D53C05CAFF2560CE73A09A4F04D47C00A' +
           'A79835F0D00CE18131B');
        PickStick := DTMFromString('78DA6314666060906140038C4824901601124' +
           '204D44801095E026A40F2CA04D408000929026A048184220135E2' +
           '404214BF1A00B23A014A'); //MasterKill's


        if FindDTM(RunePick, x,y, MIX1, MIY1, MIX2, MIY2) then
          begin
            WhatPick := 'rune';
            Writeln('You have a rune pick. Tell Scapian if this is not correct');
            exit;
          end;
        if FindDTM(AddyPick, x,y, MIX1, MIY1, MIX2, MIY2) then
          begin
            WhatPick := 'addy';
            Writeln('You have an addy pick. Tell Scapian if this is not correct');
            exit;
          end;
        if FindDTM(MithPick, x,y, MIX1, MIY1, MIX2, MIY2) then
          begin
            WhatPick := 'mith';
            Writeln('You have a mith pick. Tell Scapian if this is not correct');
            exit;
          end;
        if FindDTM(SteelPick, x,y, MIX1, MIY1, MIX2, MIY2) then
          begin
            WhatPick := 'steel';
            Writeln('You have a steel pick. Tell Scapian if this is not correct');
            exit;
          end;
        if FindDTM(IronPick, x,y, MIX1, MIY1, MIX2, MIY2) then
          begin
            WhatPick := 'iron';
            Writeln('You have an iron pick. Tell Scapian if this is not correct');
            exit;
          end;
        if FindDTM(BronzePick, x,y, MIX1, MIY1, MIX2, MIY2) then
          begin
            WhatPick := 'bronze';
            Writeln('You have a bronze pick. Tell Scapian if this is not correct');
            exit;
          end;
        Writeln('Couldnt find a pick. Terminating script. If you do have a pick,');
        Writeln('Tell Scapian about this flaw.');
        TerminateScript;
      end;

         
    procedure FindPickaxe;
     var FindingPickTries: integer;
      begin
        FindingPickTries := 0;
        if(PickLost = true) then
          begin
            if(LostPick = 'rune') then
             begin
              repeat
                if(FindObjCustom(x, y, ['Head', 'ick'], [6379586,8352599], 13) then
                  begin
                    Mouse(x, y, 0, 0, True);
                    Writeln('WOOT! Found the pick head!');
                    exit;
                  end
                else
                  begin
                    FindingPickTries := FindingPickTries + 1;
                  end;
              until(FindingPickTries > 10);
             end;

           if(LostPick = 'addy') then
            begin
              repeat
                if(FindObjCustom(x, y, ['Head', 'ick'], [4017213,3819834], 13) then
                  begin
                    Mouse(x, y, 0, 0, True);
                    Writeln('WOOT! Found the pick head!');
                    exit;
                  end
                else
                  begin
                    FindingPickTries := FindingPickTries + 1;
                  end;
              until(FindingPickTries > 10);
            end;

             
           if(LostPick = 'mith') then
              repeat
                if(FindObjCustom(x, y, ['Head', 'ick'], [5322551,5519929], 13) then
                  begin
                    Mouse(x, y, 0, 0, True);
                    Writeln('WOOT! Found the pick head!');
                    exit;
                  end
                else
                  begin
                    FindingPickTries := FindingPickTries + 1;
                  end;
              until(FindingPickTries > 10);
             
           if(LostPick = 'steel') then
              repeat
                if(FindObjCustom(x, y, ['Head', 'ick'], [7765887,6316135], 13) then
                  begin
                    Mouse(x, y, 0, 0, True);
                    Writeln('WOOT! Found the pick head!');
                    exit;
                  end
                else
                  begin
                    FindingPickTries := FindingPickTries + 1;
                  end;
              until(FindingPickTries > 10);
             
           if(LostPick = 'iron') then
              repeat
                if(FindObjCustom(x, y, ['Head', 'ick'], [5526619,5197909], 13) then
                  begin
                    Mouse(x, y, 0, 0, True);
                    Writeln('WOOT! Found the pick head!');
                    exit;
                  end
                else
                  begin
                    FindingPickTries := FindingPickTries + 1;
                  end;
              until(FindingPickTries > 10);
             
           if(LostPick = 'bronze') then
            begin
              repeat
                if(FindObjCustom(x, y, ['Head', 'ick'], [1846843,1978944], 13) then
                  begin
                    Mouse(x, y, 0, 0, True);
                    Writeln('WOOT! Found the pick head!');
                    exit;
                  end
                else
                  begin
                    FindingPickTries := FindingPickTries + 1;
                  end;
              until(FindingPickTries > 10);
            end;
          end;
        else
          begin
            exit;
          end;
      end;


    Procedure IsPickLost;
     var PickLost: boolean;
      begin
        if(WhatPick:='rune') then
          if not (FindDTM(RunePick, x,y, MIX1, MIY1, MIX2, MIY2)) then
            begin
              if(FindDTM(PickStick, x,y, MIX1, MIY1, MIX2, MIY2)) then
                begin
                  PickLost = true;
                  Writeln('OH NO! The rune pickaxes head is gone! Lets try to find it');
                  LostPick = 'rune';
                  exit;
                end
              else
                begin
                  Writeln('Hmm, either the pick is broken or there is a flaw in the script');
                  Writeln('If the pick is not broken, report this to Scapian, terminating script');
                  TerminateScript;
                end;
            end
          else
            begin
              PickLost = false;
              exit;
            end;

           
        if(WhatPick:='addy') then
          if not (FindDTM(AddyPick, x,y, MIX1, MIY1, MIX2, MIY2)) then
            begin
              if(FindDTM(PickStick, x,y, MIX1, MIY1, MIX2, MIY2)) then
                begin
                  PickLost = true;
                  Writeln('OH NO! The addy pickaxes head is gone! Lets try to find it');
                  LostPick = 'addy';
                  exit;
                end
              else
                begin
                  Writeln('Hmm, either the pick is broken or there is a flaw in the script');
                  Writeln('If the pick is not broken, report this to Scapian, terminating script');
                  TerminateScript;
                end;
            end
          else
            begin
              PickLost = false;
              exit;
            end;
           
        if(WhatPick:='mith') then
          if not (FindDTM(MithPick, x,y, MIX1, MIY1, MIX2, MIY2)) then
            begin
              if(FindDTM(PickStick, x,y, MIX1, MIY1, MIX2, MIY2)) then
                begin
                  PickLost = true;
                  Writeln('OH NO! The mith pickaxes head is gone! Lets try to find it');
                  LostPick = 'mith';
                  exit;
                end
              else
                begin
                  Writeln('Hmm, either the pick is broken or there is a flaw in the script');
                  Writeln('If the pick is not broken, report this to Scapian, terminating script');
                  Writeln('If the pick IS broken, make sure to mention it when posting proggy');
                  TerminateScript;
                end;
            end
          else
            begin
              PickLost = false;
              exit;
            end;
           
        if(WhatPick:='steel') then
          if not (FindDTM(SteelPick, x,y, MIX1, MIY1, MIX2, MIY2)) then
            begin
              if(FindDTM(PickStick, x,y, MIX1, MIY1, MIX2, MIY2)) then
                begin
                  PickLost = true;
                  Writeln('OH NO! The steel pickaxes head is gone! Lets try to find it');
                  LostPick = 'steel';
                  exit;
                end
              else
                begin
                  Writeln('Hmm, either the pick is broken or there is a flaw in the script');
                  Writeln('If the pick is not broken, report this to Scapian, terminating script');
                  TerminateScript;
                end;
            end
          else
            begin
              PickLost = false;
              exit;
            end;
           
        if(WhatPick:='iron') then
          if not (FindDTM(IronPick, x,y, MIX1, MIY1, MIX2, MIY2)) then
            begin
              if(FindDTM(PickStick, x,y, MIX1, MIY1, MIX2, MIY2)) then
                begin
                  PickLost = true;
                  Writeln('OH NO! The iron pickaxes head is gone! Lets try to find it');
                  LostPick = 'iron';
                  exit;
                end
              else
                begin
                  Writeln('Hmm, either the pick is broken or there is a flaw in the script');
                  Writeln('If the pick is not broken, report this to Scapian, terminating script');
                  TerminateScript;
                end;
            end
          else
            begin
              PickLost = false;
              exit;
            end;
           
        if(WhatPick:='bronze') then
          if not (FindDTM(BronzePick, x,y, MIX1, MIY1, MIX2, MIY2)) then
            begin
              if(FindDTM(PickStick, x,y, MIX1, MIY1, MIX2, MIY2)) then
                begin
                  PickLost = true;
                  Writeln('OH NO! The bronze pickaxes head is gone! Lets try to find it');
                  LostPick = 'bronze';
                  exit;
                end
              else
                begin
                  Writeln('Hmm, either the pick is broken or there is a flaw in the script');
                  Writeln('If the pick is not broken, report this to Scapian, terminating script');
                  TerminateScript;
                end;
            end
          else
            begin
              PickLost = false;
              exit;
            end;
      end;


    procedure Randoms;
      begin
        FindNormalRandoms;
        if (FindFight) then
          begin
            runawaydirection(rundirection);
            wait(5000);
            RunBack;
          end;
      end;
         
    procedure Mining;
      var TimeMining,Tries:integer;
      begin
        MarkTime(TimeMining);
        Tries:=0
        repeat
           if(not(LoggedIn))then
              begin
                Exit;
              end;
           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
               Tries:=Tries+1
                 if (Tries = 25) then
                   begin
                     Writeln('Couldnt find the color 25 times, terminating script');
                     TerminateScript;
                   end;
             end;
           if FindNPCChatText('inventory is too full to hold any more') then
             begin
               exit;
             end;
           wait(WaitTime + random(20));
           Randoms;
           RandomRClick;
           RandomRClick;
           PickUpMouse;
           Randoms;
           GameTab(4);
        until(InvCount=28) or (TimeFromMark(TimeMining) > MineRockLength+random(20000))

       
      end;

    procedure Drop;
      var FailedDrop, DropTries, Dropping:Integer;
      begin

        Ore := DTMFromString('78DA63CC66626078C28002E6476B30E830323' +
           '00011C37F20602C07AA79CE8006189148205D0854F39A809A34A0' +
           '9A8F04D4E401D5BC27A0A606A8E60101352540353709A84900AA7' +
           '94B404D2C50CD0BFC6A007EB41170');

        {Ore := DTMFromString('78DA63FCC8C4C030919101199C2A3262F80FA' +
           '441A2FF8180F12D50CD7C543510591809A47F01D5CC24A0E63F50' +
           '4D0F0135CF8830E72150CD0C026A7E03D54C25A0E62B504D2B7E3' +
           '500380212C7'); Another DTM, just in case the other one not working...}

        MarkTime(Dropping)
        DropTries := 0;
        FailedDrop := 0;
        repeat
          if FindDTM(Ore, x,y, MIX1, MIY1, MIX2, MIY2) then
            begin
              Mouse(x,y,1,1,false);
              ChooseOption('rop');
              DropTries:=DropTries+1;
              wait(500);
              Randoms;
            end
          else
            begin
              FailedDrop:=FailedDrop+1;
            end;
          if (FailedDrop=30) then
            begin
              Writeln('Tried dropping the ore 30 times but failed, report this bug to Runescapian, terminating script...')
              TerminateScript;
            end;
           
        until(DropTries = 35) or (TimeFromMark(Dropping)>300000)

        Inventories:=Inventories+1;
        AmountLoads:=AmountLoads+1;
      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;
       if (YourSRLPassword = '') 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('|\/\ We worked ' + TimeRunning + '/\/\/\/\/\/\/\/\/\//\/\/\|');
        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;
     
    procedure login;

      begin
        if (not(loggedin)) then
          begin
            loginplayer;
            findnormalrandoms;
            wait(1000);
            setBar('brightness',4);
          end
        else
          begin
            findnormalrandoms;
            wait(1000);
            setBar('brightness',4);
          end;
      end;
     
    procedure EnoughLoads;
      begin
        if(AmountLoads=Loads)then
        begin
          NextPlayer(True);
          AmountLoads:=0;
          HighestAngle;
          MakeCompass('N');
        end;
      end;
     
    procedure AvoidGas;
      begin
        wait(IfGasFound);
        if (FindColorTolerance (x, y, 9806756, 0, 0, 400, 400, 3)) then
          begin
            wait(10000);
          end
        else
          begin
            exit;
          end;
      end;
       



    procedure FindingGas; //Colors of the gas are from Masterkill will get my own soon
      begin
        if (FindColorTolerance (x, y, 10596274, 0, 0, 400, 400, 3)) then
          begin
            AvoidGas;
          end;

        if (FindColorTolerance (x, y, 9806756, 0, 0, 400, 400, 3)) then
          begin
            AvoidGas;
          end;

        if (FindColorTolerance (x, y, 9017755, 0, 0, 400, 400, 3)) then
          begin
            AvoidGas;
          end;

        if (FindColorTolerance (x, y, 8821148, 0, 0, 400, 400, 3)) then
          begin
            AvoidGas;
          end;
         
         
      end;



    begin
     SetupSRL;
     ScriptID := '532';
     SRLId := YourSRLId;
     SRLPassword:= YourSRLPassword;
     CheckSrlId;
     FindRS;
     ActivateClient;
     DeclarePlayers;
     login;
     repeat
       if(not(LoggedIn))then
         begin
           Exit;
         end;
       AutoColor;
       Mining;
       Drop;
       Randoms;
       AntiBan;
       proggy;
       EnoughLoads;
     until(false)
       Siggy;
    end.

    Error is

    Line 190: [Error] (15218:10): Identifier expected in script C:\Program Files\SCAR 3.12\Scripts\PowerMinerByScapian.scar
    Failed when compiling
    Identifier is usually something with begins and ends right? I can't seem to find where I missed one though, or is it not begins/ends this time?

  2. #2
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Think you left your pass in man
    EDIT: well since you are now offline I changed your pass, I'll PM it to ya.

    K it's cuz your procedure is "procedure WhatPick;"
    and in it you have "WhatPick := 'addy';", etc
    which you can't do since 'WhatPick' is the procedure name.

    I think what you were trying to do is:

    SCAR Code:
    Function WhatPick: string; //make WhatPick a function so that it RETURNS what you want =]]
       //in this case we'd be returning a string.
     var BronzePick, IronPick, SteelPick, MithPick, AddyPick, RunePick, PickStick:integer;

      begin

        BronzePick := DTMFromString('78DA639460666010666240068E46720CEC409' +
           'A1188FF0301A32C508D24AA1A882C8C04D2F240356204D48802D5' +
           'C81150230454A34C400D3F508D160135BC40353A04D4F01161973' +
           '0117EE727EC77009D1506D6');
        IronPick := DTMFromString('78DA631467666078CFC8800C1C6D6C18D8813' +
           '448F43F10302A02D57C435503918591405A02A8E62B0135C24035' +
           'FF08A8E103AAE16022ACE63F017378806A3E1150230D54F316BF1' +
           'A00853D0C59');
        SteelPick := DTMFromString('78DA633CC2C4C0200CC448202B3989811D483' +
           '302F17F2060DC09941743550391859140FA0C116A0E00E51508A8' +
           'D907945721A0E624505E94809A53407949026A7600E5B588708F3' +
           '40135BB099B03007CB90E23');
        MithPick := DTMFromString('78DA637464666078CFC8800C0C8DBC18D8813' +
           '448F43F10309A03D5703031A00246241248DB03D5FC62C4AFC616' +
           'A8E61F0135D64498630154F39F08359F08A8F104AAF946408D1B5' +
           '0CD07FC6A00EE190EDE');
        AddyPick := DTMFromString('78DA637CC7C4C0200CC448C0D2C38A811D483' +
           '302F17F2060FC01949746550391859140FA33505E94809AB74079' +
           '29026A5E00E55508A8790A94D724A0E609505E8708731409A8790' +
           'C941723A0E611505E03BF1A003F4C0F5A');
        RunePick := DTMFromString('78DA637CCBC4C0F09E91011998790430B0036' +
           '990E87F2060FC0E54F30D550D44164602E9D74035BF09A8790154' +
           'F39F809A2740351C4CF8D53C05CAFF2560CE73A09A4F04D47C00A' +
           'A79835F0D00CE18131B');
        PickStick := DTMFromString('78DA6314666060906140038C4824901601124' +
           '204D44801095E026A40F2CA04D408000929026A048184220135E2' +
           '404214BF1A00B23A014A'); //MasterKill's


        if FindDTM(RunePick, x,y, MIX1, MIY1, MIX2, MIY2) then
          begin
            Result := 'rune'; //then make this Result := WHATEVER; and that's what it will return
            Writeln('You have a rune pick. Tell Scapian if this is not correct');
            exit;
          end;
        if FindDTM(AddyPick, x,y, MIX1, MIY1, MIX2, MIY2) then
          begin
            Result := 'addy';
            Writeln('You have an addy pick. Tell Scapian if this is not correct');
            exit;
          end;
        if FindDTM(MithPick, x,y, MIX1, MIY1, MIX2, MIY2) then
          begin
            Result := 'mith';
            Writeln('You have a mith pick. Tell Scapian if this is not correct');
            exit;
          end;
        if FindDTM(SteelPick, x,y, MIX1, MIY1, MIX2, MIY2) then
          begin
            Result := 'steel';
            Writeln('You have a steel pick. Tell Scapian if this is not correct');
            exit;
          end;
        if FindDTM(IronPick, x,y, MIX1, MIY1, MIX2, MIY2) then
          begin
            Result := 'iron';
            Writeln('You have an iron pick. Tell Scapian if this is not correct');
            exit;
          end;
        if FindDTM(BronzePick, x,y, MIX1, MIY1, MIX2, MIY2) then
          begin
            Result := 'bronze';
            Writeln('You have a bronze pick. Tell Scapian if this is not correct');
            exit;
          end;
        Writeln('Couldnt find a pick. Terminating script. If you do have a pick,');
        Writeln('Tell Scapian about this flaw.');
        TerminateScript;
      end;
    Then when you use it, it should be like:
    SCAR Code:
    if(WhatPick = 'rune') then //and not
        if(WhatPick:='rune') then //like u have it =]]

  3. #3
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    An identifier expected in script requires that you have not declared a variable or you're using a procedure or function inside of a procedure which you have put below that procedure. If you're going to use a function/procedure you had already made and it is below the procedure it is going to be used in of course it is going to give an error. Move that procedure/function above the procedure it is going to be used in.

    That is why you add includes just below Program New;, otherwise, if you add an include below a procedure which uses those includes then it will appear with a similar error.
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

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

    Default

    Thanks guys, now I think I understand more about functions

    Time to add an autoresponder (looking tougher than I thought maybe later...) and then complete the mainloop, then I'll be done!

    Maybe the first release will be 1000 lines

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

    Default

    Add gametab(4) and gametab(5), so it scans the inventory slots and the equipment.
    Active only during the Summer...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. First Script, Several Errors
    By Jackrawl in forum OSR Help
    Replies: 8
    Last Post: 09-11-2007, 10:03 PM
  2. First Script/with errors.
    By hihi12340 in forum OSR Help
    Replies: 21
    Last Post: 06-19-2007, 02:22 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
  •