Results 1 to 9 of 9

Thread: Why wont this work

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

    Why wont this work

    Ok i just watched a 5 minute video on DTMs and decided to try and use a DTM to check if the recycle bin on my desktop has anything in it or not. This is the code i have so far, please could someone point me in the right direction and tell me why its not working?

    SCAR Code:
    //Checks if recycle bin is full or not
    program New;


    var
    x, y, bin: integer;


    Procedure LoadDTM;
    begin
      bin := DTMFromString('78DA63D4606060106140018C331921348CAF0' +
           '424D851D5FCFFFF13558D26A69A5FBF7EA0AAD10712DCA86A7EFF' +
           'FF8FAA460F4888A3AAB98BAE46164848A3AA39FB094D0D489E0F5' +
           '5CD7334730093921379');
    end;

    Procedure FindDTM;
    begin;
    if(FindDTM(bin, x, y, 3, 2, 73, 53)) then;
    Mouse(x, y, true);
    Writeln('Recycle bin is full');
    end else;
    Writeln('Recycle bin is empty');
    end;



    begin
    LoadDTM;
    FindDTM;
    end.


    Thanks in advance!


    P.S The video might have been a little old, can you still use If(findDTM?


    EDIT: I get the error
    Code:
    Line 19: [Error] (19:36): Invalid number of parameters in script

  2. #2
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    Procedure FindDTM;
    begin;
      if(FindDTM(bin, x, y, 3, 2, 73, 53)) then
      begin
        Mouse(x, y, true);
        Writeln('Recycle bin is full');
      end else
        Writeln('Recycle bin is empty');
    end;
    Interested in C# and Electrical Engineering? This might interest you.

  3. #3
    Join Date
    Jul 2007
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I put in what you said Smartzkid but it still says there is an incorrect number of parameters

  4. #4
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    //Checks if recycle bin is full or not
    program New;
    {.include SRL\SRL.scar}
    
    var
     bin: integer;
    
    
    Procedure LoadDTM;
    begin
      bin := DTMFromString('78DA63D4606060106140018C331921348CAF0' +
           '424D851D5FCFFFF13558D26A69A5FBF7EA0AAD10712DCA86A7EFF' +
           'FF8FAA460F4888A3AAB98BAE46164848A3AA39FB094D0D489E0F5' +
           '5CD7334730093921379');
    end;
    
    Procedure FindMyDTM;
    begin;
    if(FindDTM(bin, x, y, 3, 2, 73, 53)) then
    Begin
    Mouse(x, y, 2, 2, true);
    Writeln('Recycle bin is full');
    end
    else
    Writeln('Recycle bin is empty');
    end;
    
    
    
    begin
    SetupSRL;
    LoadDTM;
    FindMyDTM;
    end.
    Fixed!

  5. #5
    Join Date
    Jan 2007
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    right ok, you need
    SCAR Code:
    Mouse(x, y, 0, 0, true)
    ( u missed out the random x and y variables- given that yr not doing this on runescape, then you dont need any randomisation !

    edit- sry chris, didnt realise ud just answered, (id left page for a while without refreshing) sry

  6. #6
    Join Date
    Jul 2007
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It works!

    Hey i just realized its you again Chris :P anyways thanks again and + rep again if i can

  7. #7
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That wasn't the actual problem though Joe.. The problem was that he named his procedure FindDTM, the same name of the FindDTM function in SCAR, so it was thinking that he was calling the FindDTM function.. Get what im sayin?

    Anytime Phil..

  8. #8
    Join Date
    Jan 2007
    Posts
    117
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ah rite cool! edit: out of interest chris, wud 'mouse(x,y,true)' bring up an error? edit2-it wud bring an error, guess i was half way to solving it, but it took a 'Lesser Demon' to go the whole slog congrats !

  9. #9
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol, yea, the first thing i saw was also no randomization, still got an error though..

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. why wont this work?
    By rogue poser in forum OSR Help
    Replies: 11
    Last Post: 01-01-2008, 08:28 PM
  2. Why wont this work
    By philowns in forum OSR Help
    Replies: 3
    Last Post: 07-29-2007, 01:36 AM
  3. Just wont work
    By reece844 in forum OSR Help
    Replies: 5
    Last Post: 04-24-2007, 09:01 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
  •