Results 1 to 10 of 10

Thread: missing identifier

  1. #1
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default missing identifier

    ok i have an unkown identifier meaning theres an end or begin missing somewhere could sum1 kindly show me where.

    the error is:
    Line 149: [Error] (18776:1): Identifier expected in script

    EDIT:Found the reason. it's because i didn't put a repeat before until(FindBitmap(x, y, MinedOre)); but I don't know if i want it to repeat i just want it to stop mining when the ore goes grey which is what my bitmap is. so suggestions for that please and where do i put the repeat lmao all this is in the ClickRock procedure
    EDIT:Got the repeat sorted but not i get the error:
    Line 153: [Error] (18780:24): Unknown identifier 'MinedOre'
    which is in the findbitmap bit. I'm new to bitmaps but i've loaded it and put it in script so it should work shouldn't it? help plz

    Also but not as important
    i get a hint saying:
    Line 62: [Hint] (18689:10): Variable 'Result' never used in script
    this is where the Anti Ban starts so how do i use it in script cos i put it in loop o well That's the "DoAntiBan" function
    SCAR Code:
    //////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////
    //                  THE NOOBIEST                         //
    //                   POWERMINER                         //
    //                  BY RKROXPUNK                       //
    //                                                           //
    ////////////////////////////////////////////////////
    ///////////////////////////////////////////////////
    program PowerMiner;
    {.include SRL/SRL.scar}
    {.include srl\srl\skill\Mining.scar}

    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //                  LOGIN AND SETUP                     //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////

    const StartPlayer = 0;
      VersionNumber = '2';
      OreeColor = 3956353; //put the colour of the ore you want to mine here
      WaitTime = 8000; //how long before it clicks again
      RunDirec = 'N'; //Direction you want to run in if find smoking rock

    procedure DeclarePlayers;

    begin
      HowManyPlayers := 1; // Set Number of Players here.
      NumberOfPlayers(HowManyPlayers); // Sets the Players Array Length;
      CurrentPlayer := StartPlayer;

      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Loc := 'Loc1';
      Players[0].Skill := 'Mining';
      Players[0].Active := True;

      writeln(inttostr(HowManyPlayers) + ' Players');
    end;
    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //            RANDOMS AND ANTIBAN                       //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////

    Procedure AntiRandoms;
    begin
    SRLRandomsReport;
    FindNormalRandoms;
    BoredHuman;
    RandomMovement;
    FindPick;
    if(FindGas(x,y))then
     begin
      RunAwayDirection(RunDirec);
       Wait(15000)
      RunBack;
     end;
    end;

    function DoAntiBan: Boolean;
    begin
      AntiBan;
      wait(50 + random(100));
      BoredEvery(3 + random(3));
      wait(100 + random(100))
        RotateEvery(7 + random(4));
      wait(750 + random(250));
      LeaveScreenEvery(5 + random(7));
      wait(500 + random(150));
    end;
    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //                  BITMAPS                             //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////
    procedure LoadBmps;
    var
      MinedOre : Integer;
    begin
    MinedOre := BitmapFromString(34, 33, 'z78DAB5984B9283300C4' +
           '4AF14FF614908DCFF48E389BC90ABDDC26426E5AA5E81D1936459' +
           '22E7B4852D8BAEE9083B6A79641FCE81869CA31BE892B79806FAC' +
           'C47CCA88B2B3EAEA2F11597BA40FDE177BF2FA1A4F85CD6B2C517' +
           '6AF669096BA78428EFF9115EA89428E725C681122246211AB6904' +
           '26A2C8408594209BE2EA5DF264A8FF88CABAD3186339C1D8B682E' +
           '25EEA2925DD52BBE2E509F7E81DCEE56B7FE9D28BCAAA756ADD4F' +
           'E10F7B86B6D7151D9D8E99B459E146A54BFF9A5AEB7DEC83A3859' +
           'B8335A6BABB0B75343881A8BC48211BD771844672246353B525D4' +
           'AA9CD299EF1641A5DD8C32E9694A33CE282F9D6B110A210C2A3AE' +
           'B7CE578641E698D65EB028AF0A4B23C2B880F7C40FA2BA0E78E70' +
           'E77645DC9B50A05DAB3245717EA3445F3AAD84088288B229273A7' +
           'D565E79D4796F44AA52E54C6324134A8482AE7B5CEB0A0B6E8E87' +
           'AAE89B6DF5707FA11115A252C6283D6C6C2EE29C2D288DE15FB36' +
           '91CD852CA40790AF6BBD60915C251403967F25B2FB197D5F88521' +
           '65DCD4C164684A7EC22C750C94DAAEBAAA8D0B5DA8E3D833E719A' +
           '82C457132145F7C57916B883B0AE6A6D99892CAC3E8B5510DF460' +
           '15D0A7EF10611C934F495F4E1C8625733A4D02C988DDD77854EE5' +
           '06ADC6840E7DA5BBBEF6AE8E23A966CDAB8C02BB05F82EC6F782C' +
           '8BC37B1F7D62C766516DFB6F3A2B4B160A78D951C7931DB276ECC' +
           'AE77252CB46E28DF0E283027498FAA9F61678A759EF2963DE7761' +
           'E60FBE80A862C3A82AC7FC067208E8C48DE9AEA666D0AE8FC35C5' +
           'A0FA912C1DEC6CDECE6D9E85AED59E952E7A067557769DBFB0680' +
           'BA7274436ADE0591B10997F57DACE50FD063B6B0A3CA137672BBB' +
           '7BECCED434D14CDD184484758377BB14F19BF9EF45ABFDBF68C64' +
           'BCD334261F78AF31DBED971B14A689FA3DB2C6CDA9A6714356BEF' +
           'FC24A5B3CE9E145A3D148A33AD89EB5D1696DB139314CB3AD65BB' +
           '65BB27FFE999EA894EEE6BC6CFFB7BC98076556222C83096B263A' +
           '36D17C7458E700FF85BABE4EE52AB3FFDFB888D2338233BECC0B9' +
           '53814D4AE26DC64B9A806136AE715B3F97B2C1F72611DBB69F9B7' +
           '592EEE2039117FB699E90F7FCEB045');
    end;
    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //                  MINEING AND DROPPING                //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////

    function FindOre: Boolean;
    begin
      if FindColorSpiral(x, y, OreeColor, 0, 0, 515, 336) then
      begin
        Result := True;
        Status('Found Ore :D');
      end else
        Status('Did not find Ore :(');
      wait(5 + random(5));
    end;

    function MouseToOre: Boolean;
    begin
      repeat
        if (FindOre) then
        begin
          MMouse(x, y, 0, 0);
          Result := True;
          Wait(20 + random(150));
          Exit;
        end;
      until (false)
    end;

    procedure ClickRock;
    begin
     repeat
      if (MouseToOre = true) then
      begin
        Mouse(x, y, 0, 0, True)
       end;
      until(FindBitmap(x, y, MinedOre));
    end;

    procedure Drop;
    begin
      if (InvFull) then
        DropTo(2, 28);
    end;
    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //                    MAIN LOOP                         //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////
    begin
      SetupSRL;
      SetupSRLMining;
      DeclarePlayers;
      LoadBmps;
      LoginPlayer;
      begin
        activateclient;
        LoginPlayer
        MakeCompass('N');
        HighestAngle;
        SetRun(true);
        gametab(4);
      end;
      repeat
      repeat
        FindOre;
        MouseToOre;
        ClickRock;
      until isuptext('mine');
        while (MouseToOre) do
        AntiRandoms;
        if(FindNewBox)then
    SolveBox;
     if(findQuiz)then
    SolveQuiz;
    DoAntiBan;
        Drop;
      until (false);
    end.

    thx and hope u can help the uber noob.
    rk

  2. #2
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    MinedOre : Integer; needs to global, or it will only work in the loadbitmaps proc, and not in the procs that use the bitmap.

    The until in clickrock needs a repeat

    In the mainloop

    begin
    activateclient;
    LoginPlayer
    MakeCompass('N');
    HighestAngle;
    SetRun(true);
    gametab(4);
    end;

    that begin end does nothing

    The following while will only repeat antirandoms. I assume you want to the rest. So you need wrap what you want to repeat with begin end, with the begin being right after do.

    while (MouseToOre) do
    AntiRandoms;
    if(FindNewBox)then
    SolveBox;
    if(findQuiz)then
    SolveQuiz;
    DoAntiBan;
    Drop;

    Add Players[currentplayer].banked:=Players[currentplayer].banked+1; to your drop procedure so you can count loads and you will know when to switch.

    Right before the until(false) do
    if (Players[currentplayer].banked mod LoadsToDoBeforeSwitching) = 0 then nextplayer(true);

    Add LoadsToDoBeforeSwitching to const section.

    That bitmap is huge and I'll be surprised if the rockfinding works. Work on that.

  3. #3
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    whoa super confusing lol but i'll do my best and as for the bitmap i just follow fakawi's TUT i have photoshop so yeah....

    EDIT:
    Ok pretty sure i figured it all except as soon as u get to AddPlayers i get confused.
    could u possibly add that in and post?
    rk.
    EDIT: ok so Bitmap didn't work but no matter what i do i can't get a small string thing. any ideas as to why. my picture is small. background black
    i always get this error:
    [Runtime Error] : Exception: Access violation at address 006504C9 in module 'scar.exe'. Read of address 00000030 in line 145 in script

    line 145= until (FindBitmap(x, y, MinedOre));
    so i guess it's the bitmap

  4. #4
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    MinedOre needs to be a global var, and you need the declarebitmaps proc to be called before the findbitmap

  5. #5
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    done both of that. i don't have to put the findbitmap in loop do i?

  6. #6
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Do you have the loadbmps proc in the loop? (because it should be out of the loop, before it).

  7. #7
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    yup ill post script 1 sec. also i've changed the script so that instead of it mining till the rock goes grey i've changed the bitmap to "manage" from the rs chat box "you manage to mine some ore" but now it says unkown identifier "manage".


    SCAR Code:
    //////////////////////////////////////////////////////////
    /////////////////////////////////////////////////////////
    //                  THE NOOBIEST                      //
    //                   POWERMINER                      //
    //                  BY RKROXPUNK                    //
    //                                                 //
    ////////////////////////////////////////////////////
    ///////////////////////////////////////////////////
    program PowerMiner;
    {.include SRL/SRL.scar}
    {.include srl\srl\skill\Mining.scar}

    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //                  LOGIN AND SETUP                     //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////
    var
      MinedOre: Integer;
    const StartPlayer = 0;
      VersionNumber = '2';
      OreeColor = 4549781; //put the colour of the ore you want to mine here
      WaitTime = 8000; //how long before it clicks again
      RunDirec = 'N'; //Direction you want to run in if find smoking rock

    procedure DeclarePlayers;

    begin
      HowManyPlayers := 1; // Set Number of Players here.
      NumberOfPlayers(HowManyPlayers); // Sets the Players Array Length;
      CurrentPlayer := StartPlayer;

      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Loc := 'Loc1';
      Players[0].Skill := 'Mining';
      Players[0].Active := True;

      writeln(inttostr(HowManyPlayers) + ' Players');
    end;
    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //            RANDOMS AND ANTIBAN                       //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////

    procedure AntiRandoms;
    begin
      SRLRandomsReport;
      FindNormalRandoms;
      BoredHuman;
      RandomMovement;
      FindPick;
      if (FindGas(x, y)) then
      begin
        RunAwayDirection(RunDirec);
        Wait(15000)
          RunBack;
      end;
    end;

    function DoAntiBan: Boolean;
    begin
      AntiBan;
      wait(50 + random(100));
      BoredEvery(3 + random(3));
      wait(100 + random(100))
        RotateEvery(7 + random(4));
      wait(750 + random(250));
      LeaveScreenEvery(5 + random(7));
      wait(500 + random(150));
    end;
    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //                  BITMAPS                             //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////

    procedure LoadBmps;
    begin
     Manage:= BitmapFromString(44, 8, 'z78DAA555410EC3200CFB12A' +
           'B54AD1C13A9FFFFD2A4B183916B37741CA22A50C7380632E3EC5B' +
           '728CC823B2C77EBC7EDF23E22CE7CBB17DC7050E56E46F8CBE2E2' +
           '32B1CB5C7117D5DC67CA486E4ACAAAB5D8CB88A59D7C177FC0F3F' +
           'DCE06CBDBFF71BB62ABFEA0442683478E5340B99C9EDFE2CF04AC' +
           '421E613135C296615DA94F19A00B2AAD5C4C06E7A3594325E67EE' +
           '8BD4C7AAC14A9674107F5D28C07CD0F38B3A48E6E413C9D37AACA' +
           '280CF7B3FD4CF857F357C179473D41997A7A9EC8D85F8ECB654EF' +
           'AFBFEB2AB7A2751733FF008486E590');
    end;
    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //                  MINEING AND DROPPING                //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////

    function FindOre: Boolean;
    begin
      if FindColorSpiral(x, y, OreeColor, 0, 0, 515, 336) then
      begin
        Result := True;
        Status('Found Ore :D');
      end else
        Status('Did not find Ore :(');
      wait(5 + random(5));
    end;

    function MouseToOre: Boolean;
    begin
      repeat
        if (FindOre) then
        begin
          MMouse(x, y, 0, 0);
          Result := True;
          Wait(20 + random(150));
          Exit;
        end;
      until (false)
    end;

    procedure ClickRock;

    begin
      repeat
        if (MouseToOre = true) then
        begin
          Mouse(x, y, 0, 0, True)
        end;
      until (FindBitmap(x, y, Manage));
    end;

    procedure Drop;
    begin
      if (InvFull) then
        DropTo(2, 28);
    end;
    ////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////
    //                    MAIN LOOP                         //
    /////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////
    begin
      SetupSRL;
      SetupSRLMining;
      DeclarePlayers;
      LoadBmps;
      LoginPlayer;
        activateclient;
        LoginPlayer
          MakeCompass('N');
        HighestAngle;
        SetRun(true);
        gametab(4);
        repeat
        repeat
          FindOre;
          MouseToOre;
          ClickRock;
        until isuptext('mine');
        while (MouseToOre) do
        begin
          AntiRandoms;
        if (FindNewBox) then
          SolveBox;
        if (findQuiz) then
          SolveQuiz;
        DoAntiBan;
        end;
        Drop;
      until (false);
    end.

  8. #8
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Change minedore to manage in vars
    var
    manage: Integer;

    I don't know if that will work, since the background of the bitmap maybe changing, so you would need to use CreateBitmapMaskFromText, which doesn't worry about the color. I gotta be at work in 30 mins, so good luck.

  9. #9
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    tyvm for all ur help. now i have to learn yet another new thing! and yay now i feel like an idiot cos i forgot to change var lol o well thx

  10. #10
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default Now it's like an auto even with my mask

    ok now i've got a working mask/bmp thats of "manage" when you mine an ore in the chat box it says you manage to mine an iron ore or something. so my aim was to make it mine until it sees that. but all it does it continuously clicks on a rock till it mines it. so it kind of does work but i only want to click on the rock once. i think it's something to do with the repeats but u guys know better so yes suggestions please!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. im missing something
    By IronGummy Bear in forum OSR Help
    Replies: 18
    Last Post: 01-08-2009, 12:19 PM
  2. What am I missing?
    By taytot in forum OSR Help
    Replies: 3
    Last Post: 07-09-2008, 05:01 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
  •