Results 1 to 6 of 6

Thread: Small error, please help out

  1. #1
    Join Date
    Jul 2007
    Posts
    1,055
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Small error, please help out

    Basicly I'm VERY NEW to scripting...So far all I'm doing is editing scripts for my personal use.

    My problem is that I copied and pasted a procedure that turns on prayer...(Masterkill's procedure)

    Procedure CastPrayer;
    begin
    if (Players[CurrentPlayer].Booleans[0] = False) then exit;
    GameTab(6);
    Wait(100 + random(100));
    if (FindColorTolerance(x, y, 15533737, 551, 324, 583, 355, 20)) then
    begin
    Mouse(567, 340, 3, 3, True);
    Mouse(715, 305, 3, 3, True);
    end;
    end;
    So I copied and pasted that into script, and I added the
    Players[0].Booleans[0] := True; // Use prayer? (!you need prayer lvl 34+!)
    to the player setup.

    The error I'm getting now is
    Line 118: [Error] (14813:24): Unknown identifier 'x' in script
    Failed when compiling
    And I'm guessing it will have an error with "identifier 'y' in script"

    My question to you is how do I solve this problem???

  2. #2
    Join Date
    Oct 2006
    Location
    MI USA
    Posts
    3,166
    Mentioned
    6 Post(s)
    Quoted
    11 Post(s)

    Default

    You need to declare x and y as Variables in the top of your script.

    §RAM


  3. #3
    Join Date
    Jul 2007
    Posts
    1,055
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    and how exactly do i do that...?

  4. #4
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You can either..

    SCAR Code:
    Procedure CastPrayer;
    var
    x,y:Integer;
    begin
    if (Players[CurrentPlayer].Booleans[0] = False) then exit;
    GameTab(6);
    Wait(100 + random(100));
    if (FindColorTolerance(x, y, 15533737, 551, 324, 583, 355, 20)) then
    begin
    Mouse(567, 340, 3, 3, True);
    Mouse(715, 305, 3, 3, True);
    end;
    end;

    or at the top where it says..

    SCAR Code:
    Program New;

    var
    x,y:Integer;

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

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

    Default

    Rogeruk thanks a lot. But now I got another problem. It never actually clicks prayer... IDK I think I'm just gona learn how to script and do this myself. Ty anyways

  6. #6
    Join Date
    Nov 2006
    Posts
    189
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Go to tutorial island on the SRL Forums. It helps plenty. That's how I learned to script.
    If I see you autoing with level 3/default clothes/crap name I WILL report you. Auto Correctly. - put this in your sig

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need help with a small error
    By Timothegreat in forum OSR Help
    Replies: 5
    Last Post: 06-03-2007, 07:37 AM
  2. Small error wont compile-please help
    By Adamb_135 in forum OSR Help
    Replies: 2
    Last Post: 04-18-2007, 01:48 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
  •