Results 1 to 8 of 8

Thread: Problem With Bitmaps

  1. #1
    Join Date
    Nov 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Problem With Bitmaps

    What´s wrong here, plz I need help.

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

    // ----------------------------------------------------------------------------------------- //

    procedure DeclarePlayers;
    begin

    HowManyPlayers := 5 ; // Number of characters you will use.
    NumberOfPlayers (HowManyPlayers) ; // Leave like this.
    CurrentPlayer := 0 ; // The number of the starting player.

    Players[0].Name :=''; // Character Name
    Players[0].Pass :=''; // Character Pass
    Players[0].Nick :=''; // Three letters of your Character name.
    Players[0].Active := True;

    Players[1].Name :=''; // Character Name
    Players[1].Pass :=''; // Character Pass
    Players[1].Nick :=''; // Three letters of your Character name.
    Players[1].Active := True;

    Players[2].Name :=''; // Character Name
    Players[2].Pass :=''; // Character Pass
    Players[2].Nick :=''; // Three letters of your Character name.
    Players[2].Active := True;

    Players[3].Name :=''; // Character Name
    Players[3].Pass :=''; // Character Pass
    Players[3].Nick :=''; // Three letters of your Character name.
    Players[3].Active := True;

    Players[4].Name :=''; // Character Name
    Players[4].Pass :=''; // Character Pass
    Players[4].Nick :=''; // Three letters of your Character name.
    Players[4].Active := True;

    Writeln (' Using ' + IntToStr(HowManyPlayers) + ' Players ') ;

    end;

    // ----------------------------------------------------------------------------------------- //

    procedure Papenco;
    begin
    Writeln( ' ________ ___ ________ ________ __ __ ________ ________ ');
    wait(200);
    Writeln( ' | ___ | / _ \ | ___ | | _____| | \ | | | _____| | _____ |');
    wait(200);
    Writeln( ' | |__| | / /_\ \ | |__| | | |_ | \ | | | | | | | |');
    wait(200);
    Writeln( ' | _____| / ___ \ | _____| | _| | \ | | | | | | | |');
    wait(200);
    Writeln( ' | | | / \ | | | | |____ | |\ \| | | |____ | |___| |');
    wait(200);
    Writeln( ' |__| |_| |_| |__| |_______| |_| \___| |_______| |_______|');
    wait(200);
    Writeln( ' Papenco Presents ' );
    wait(2000);
    Cleardebug;
    Writeln('Papenco´s Air Runes Runecrafter');
    wait(1000);
    end;

    // ----------------------------------------------------------------------------------------- //

    procedure LoadImages;
    var
    Tree: integer;
    begin
    Tree := BitmapFromString(17, 17, 'beNrNUl0LgkAQ3B3X0jQfIglC' +
    'Q9LeeigIevX//6p07/yKU5+ChmFZjpnbWe6IfgRWOgGAPe0CrZ6Vs' +
    'raiHIsNyFg26jIKDEb3LIymiHpldN5HZesOwzA+BPykyysp69 35fm' +
    'yVvtLkxPeENE3z8hQXdH0nFcujvlmLqBgzyaChipZVv8MktMP SSLK' +
    'csoz2cZvFUDeDzD9BJRG6vWVgY4HT0twZbW2jFUphAq+9NSCT ISb0' +
    'Cvyu+nZ7LOsx5eJX+wd8AO/+BeE=');
    end;

    // ----------------------------------------------------------------------------------------- //

    procedure GoToAltar;
    var
    x, y, T, FallyRoadColor, RoadColor: integer;
    begin
    T:= 0;
    FallyRoadColor:= FindFallyRoadColor;
    RadialRoadWalk(FallyRoadColor ,210 ,225, 2, -2, 75);
    flag;
    wait(150 + random(100));
    FallyRoadColor:= FindFallyRoadColor;
    RadialRoadWalk(FallyRoadColor ,165 ,195, 0, -1, 65);
    flag;
    wait(100 + random(150));
    Repeat
    RoadColor:= FindRoadColor;
    RadialRoadWalk(RoadColor, 165, 195, -1, 0, 65);
    flag;
    wait(50 +random(200));
    T:= T+1;
    100 until T= 3;
    101 RoadColor:= FindRoadColor;
    102 RadialRoadWalk(RoadColor,250, 300, 0, 0, 70);
    103 flag;
    104 wait(200 + random(50));
    105 FindBitmapIn(Tree, x, y, 845, 245, 883, 280);
    106 Mouse(x, y);
    107 flag;
    108 wait(150 + random(150));
    end;


    begin
    SetupSRL;
    Papenco;
    DeclarePlayers;
    LoadImages;
    GoToAltar
    end.



    I get this error Line 105: [Error] (15194:14): Unknown identifier 'Tree' in script

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

    Default

    [[please use scar tags when posting a script
    makes things much easier.]]


    but anyways it's because you declared the variable 'tree' as a local variable so basically it's only known in the the procedure 'LoadImages'
    you need to declare it globally(like i did below)

    SCAR Code:
    program AirRunes;
    {.include SRL/SRL.scar}

    var
      Tree : Integer;  
            //declare it usually in the beginning of your script that way it can be used in ANY procedure/function

    // ----------------------------------------------------------------------------------------- //

    procedure DeclarePlayers;
    begin

    HowManyPlayers := 5 ; // Number of characters you will use.
    NumberOfPlayers (HowManyPlayers) ; // Leave like this.
    CurrentPlayer := 0 ; // The number of the starting player.

    Players[0].Name :=''; // Character Name
    Players[0].Pass :=''; // Character Pass
    Players[0].Nick :=''; // Three letters of your Character name.
    Players[0].Active := True;

    Players[1].Name :=''; // Character Name
    Players[1].Pass :=''; // Character Pass
    Players[1].Nick :=''; // Three letters of your Character name.
    Players[1].Active := True;

    Players[2].Name :=''; // Character Name
    Players[2].Pass :=''; // Character Pass
    Players[2].Nick :=''; // Three letters of your Character name.
    Players[2].Active := True;

    Players[3].Name :=''; // Character Name
    Players[3].Pass :=''; // Character Pass
    Players[3].Nick :=''; // Three letters of your Character name.
    Players[3].Active := True;

    Players[4].Name :=''; // Character Name
    Players[4].Pass :=''; // Character Pass
    Players[4].Nick :=''; // Three letters of your Character name.
    Players[4].Active := True;

    Writeln (' Using ' + IntToStr(HowManyPlayers) + ' Players ') ;

    end;

    // ----------------------------------------------------------------------------------------- //

    procedure Papenco;
    begin
    Writeln( ' ________ ___ ________ ________ __ __ ________ ________ ');
    wait(200);
    Writeln( ' | ___ | / _ \ | ___ | | _____| | \ | | | _____| | _____ |');
    wait(200);
    Writeln( ' | |__| | / /_\ \ | |__| | | |_ | \ | | | | | | | |');
    wait(200);
    Writeln( ' | _____| / ___ \ | _____| | _| | \ | | | | | | | |');
    wait(200);
    Writeln( ' | | | / \ | | | | |____ | |\ \| | | |____ | |___| |');
    wait(200);
    Writeln( ' |__| |_| |_| |__| |_______| |_| \___| |_______| |_______|');
    wait(200);
    Writeln( ' Papenco Presents ' );
    wait(2000);
    Cleardebug;
    Writeln('Papenco´s Air Runes Runecrafter');
    wait(1000);
    end;

    // ----------------------------------------------------------------------------------------- //

    procedure LoadImages;
    begin
    Tree := BitmapFromString(17, 17, 'beNrNUl0LgkAQ3B3X0jQfIglC' +
    'Q9LeeigIevX//6p07/yKU5+ChmFZjpnbWe6IfgRWOgGAPe0CrZ6Vs' +
    'raiHIsNyFg26jIKDEb3LIymiHpldN5HZesOwzA+BPykyysp69 35fm' +
    'yVvtLkxPeENE3z8hQXdH0nFcujvlmLqBgzyaChipZVv8MktMP SSLK' +
    'csoz2cZvFUDeDzD9BJRG6vWVgY4HT0twZbW2jFUphAq+9NSCT ISb0' +
    'Cvyu+nZ7LOsx5eJX+wd8AO/+BeE=');
    end;

    // ----------------------------------------------------------------------------------------- //

    procedure GoToAltar;
    var
    x, y, T, FallyRoadColor, RoadColor: integer;
    begin
    T:= 0;
    FallyRoadColor:= FindFallyRoadColor;
    RadialRoadWalk(FallyRoadColor ,210 ,225, 2, -2, 75);
    flag;
    wait(150 + random(100));
    FallyRoadColor:= FindFallyRoadColor;
    RadialRoadWalk(FallyRoadColor ,165 ,195, 0, -1, 65);
    flag;
    wait(100 + random(150));
    Repeat
    RoadColor:= FindRoadColor;
    RadialRoadWalk(RoadColor, 165, 195, -1, 0, 65);
    flag;
    wait(50 +random(200));
    T:= T+1;
    100 until T= 3;
    101 RoadColor:= FindRoadColor;
    102 RadialRoadWalk(RoadColor,250, 300, 0, 0, 70);
    103 flag;
    104 wait(200 + random(50));
    105 FindBitmapIn(Tree, x, y, 845, 245, 883, 280);
    106 Mouse(x, y);
    107 flag;
    108 wait(150 + random(150));
    end;


    begin
    SetupSRL;
    Papenco;
    DeclarePlayers;
    LoadImages;
    GoToAltar
    end.

    Hope this helps
    Derek-

  3. #3
    Join Date
    Nov 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    what have you changed?

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

    Default

    i took the variable declaration 'tree' out of the procedure 'LoadImages' and instead declared it in the beginning

  5. #5
    Join Date
    Nov 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OK thanks, I´ll see if it works like this

  6. #6
    Join Date
    Nov 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok, I finally solved the bitmap problem but now my radialwalk function do nothing, there´s no error but it just doesn´t clicks what should I do?

  7. #7
    Join Date
    Jul 2007
    Location
    St. Louis, Missouri, USA.
    Posts
    575
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Please don't double post.... this is like the third time I've seen you do it. Use the edit button if no one posted below you.

    ...But I was going to say, the color has to be visible on the minimap, if it doesn't find it it won't do anything. That could be your problem.
    -You can call me Mick-



  8. #8
    Join Date
    Nov 2007
    Posts
    94
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, the Road is visible and it finds the color and there´s no error in script but it just doesn´t click. all the other scripts i try to use work pretty good, plz help.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Bitmaps?
    By Prince in forum OSR Help
    Replies: 5
    Last Post: 02-08-2008, 11:34 PM
  2. Bitmaps?
    By nooby noobster in forum OSR Help
    Replies: 3
    Last Post: 03-15-2007, 10:51 PM
  3. Need help with bitmaps!!!!!!
    By diamondhero5 in forum OSR Help
    Replies: 4
    Last Post: 02-19-2007, 02:49 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
  •