Results 1 to 5 of 5

Thread: Question about DTM

  1. #1
    Join Date
    Jan 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Question about DTM

    Alright im making my very first scar script, this is what i want to make roughly:

    Its gona be a firemaking lvler using DTMs
    Now I made my DTMs for tinderbox and for logs and I want to do something like this:

    1) Find the tinderbox DTM
    2) Click it
    3) Find the log DTM
    4) Click it

    thats just rough what i want it to do lol

    So i started "TRYING" to script and stumbled on an error...
    Its says File Access Error, and I dont know what to do about it :P
    here comes the piece of script so far:
    Code:
    program BurningDesire;
    {.include SRL\SRL.scar}
    Var
    TinderDTM, x, y: Integer;
    
    Procedure FindTinder;
    
    begin
    TinderDTM := DTMFromString('78DA6314636060106140014B66CE00D38C503' +
           'EA30090E06640038CA86A6481840C01358A408283801A5E20214B' +
           '400D3BA69B31D4A8000961FC6A004EF6030D');
           begin
                if FindDTM(TinderDTM,x, y, 1, 1, 200, 200)
                then Mouse(x, y, 1, 1, True);
                WriteLn('Tinderbox found!');
                Flag;
           end;
    
      FreeDTM(TinderDTM)
    end;
    begin
         SetupSrl;
         FindTinder;
    end.
    I hope someone can help me find the solution
    Also it always writes me the message for some reason,
    so i think the whole code is wrong? if anyone can help it would be apreciated!

  2. #2
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    File Access error has nothing to do with your script, only that SRL can't get access to the chatlog file.
    It shouldn't make any difference to the runtime of your script.
    Solution of it: Allow file access in the scar Filewall.
    I made a new script, check it out!.

  3. #3
    Join Date
    Jan 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Markus View Post
    File Access error has nothing to do with your script, only that SRL can't get access to the chatlog file.
    It shouldn't make any difference to the runtime of your script.
    Solution of it: Allow file access in the scar Filewall.
    Thanks :P!
    Do you perhaps know why it shows "Tinderbox found!" while theres no tinderbox to find lol

  4. #4
    Join Date
    Dec 2007
    Posts
    103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Because you didn't add begin and end; to your IF-statement. If you don't do that it'll run every line but the first one after the statement.

    SCAR Code:
    if FindDTM(TinderDTM,x, y, 1, 1, 200, 200) then
    begin  //Must be used when more than 1 command should be run...
    Mouse(x, y, 1, 1, True);  //1st command..
    WriteLn('Tinderbox found!'); //2nd command..
    Flag;  //3rd command..
    end; //to match the "begin"..
    This sentence is false.

  5. #5
    Join Date
    Jan 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Gumleren View Post
    Because you didn't add begin and end; to your IF-statement. If you don't do that it'll run every line but the first one after the statement.

    SCAR Code:
    if FindDTM(TinderDTM,x, y, 1, 1, 200, 200) then
    begin  //Must be used when more than 1 command should be run...
    Mouse(x, y, 1, 1, True);  //1st command..
    WriteLn('Tinderbox found!'); //2nd command..
    Flag;  //3rd command..
    end; //to match the "begin"..
    Wow!!! Youre right!
    Thank you so much!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. i has a question
    By Solkrieg in forum OSR Help
    Replies: 5
    Last Post: 10-30-2008, 08:20 AM
  2. tab 5 question
    By dvdcrayola in forum OSR Help
    Replies: 4
    Last Post: 07-04-2008, 06:43 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
  •