Results 1 to 17 of 17

Thread: Problem with Drop Procedure

  1. #1
    Join Date
    Nov 2008
    Location
    Arizona
    Posts
    236
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Problem with Drop Procedure

    Theres the procedure im using..very basic i know.

    Code:
    procedure DropSilk;
    begin
      while FindDTM(Silk, x, y, MIX1, MIY1, MIX2, MIY2) do
      begin
        Mouse(x, y, 5, 5, False);
        wait(200)
        ChooseOption('rop');
      end;
    heres the error i keep getting.

    Code:
    Line 124: [Error] (18653:21): Unknown identifier 'x' in script
    someone please help its starting to really bother me
    I'm Back.

  2. #2
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Change it to this:
    SCAR Code:
    procedure DropSilk;
    var
    x, y: Integer;
    begin
      while FindDTM(Silk, x, y, MIX1, MIY1, MIX2, MIY2) do
      begin
        Mouse(x, y, 5, 5, False);
        wait(200)
        ChooseOption('rop');
      end;
    end;

  3. #3
    Join Date
    Nov 2008
    Location
    Arizona
    Posts
    236
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thank you much..sad i should of noticed that but thanks again =]
    I'm Back.

  4. #4
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hello, [JS]

    I know you have made a miner, but you should try to learn variables, since those X and Y do you know where they stand for?

    Try to find a tutorial.
    ~Hermen

  5. #5
    Join Date
    Nov 2008
    Location
    Arizona
    Posts
    236
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Hermen View Post
    Hello, [JS]

    I know you have made a miner, but you should try to learn variables, since those X and Y do you know where they stand for?

    Try to find a tutorial.
    lol hermen whats up?

    and i have not made a miner lol just to let you know this is my first script im working on.

    but while im asking questions does anyone know why InvFull isnt working?
    I'm Back.

  6. #6
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It does work.

  7. #7
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    You should try and make variables x, y global as they will be used a lot in your script.


    Global variables means
    SCAR Code:
    Var x, y : Integer;
    at the top of your script. Instead of having them in your procedure which is localized.

  8. #8
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    No Naum, you should keep variables local whenever you can.

  9. #9
    Join Date
    Nov 2008
    Location
    Arizona
    Posts
    236
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    It does work.
    well with my script im using ur dropdtm function and i had it set where

    Code:
    If InvFull then
     begin
     DropAllDTM;
     end;
    end;
    and it doesnt drop at all.
    I'm Back.

  10. #10
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    584
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Maybe its DropAllDTM; thats not working? Did you try a debug method to see if InvFull is actually being called?



    ~NS

  11. #11
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nadeem, that's my procedure (DropAllDTM), so obviously it has been put through extensive testing and should not fail .

    Well I will test once I get back from this party. It's really long though like ends tomorrow. So yeah, I'll get back to you in a while .

  12. #12
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    No Naum, you should keep variables local whenever you can.
    What would you rather do?

    Have:

    SCAR Code:
    Procedure blah;
    Var x, y : Integer;

    Procedure blah2;
    Var x, y : Integer;

    instead of

    SCAR Code:
    Var x, y : Integer;

    Procedure blah;

    Procedure blah2;

    ???

    You misunderstood, I did not say - 'Make all your variables global', I said just the x and y variables as they will be called a lot.

    And, yes, local variables should be used as much as possible..

  13. #13
    Join Date
    Nov 2008
    Location
    Arizona
    Posts
    236
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Nadeem View Post
    Maybe its DropAllDTM; thats not working? Did you try a debug method to see if InvFull is actually being called?



    ~NS

    nope i havnt, not exactly sure how to do that.

    i just typed in what i had for main loop.

    Code:
    if InvFull then
     whatever procedure.

    (offtopic) 100 posts! woot =p
    I'm Back.

  14. #14
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Do something like this, then:
    SCAR Code:
    if InvFull then
    begin
      Writeln('Inventory is full!');
      WhateverProcedure;
    end else
      Writeln('Either inventory is not full, or InvFull is failing.');

  15. #15
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    What would you rather do?

    Have:

    SCAR Code:
    Procedure blah;
    Var x, y : Integer;

    Procedure blah2;
    Var x, y : Integer;

    instead of

    SCAR Code:
    Var x, y : Integer;

    Procedure blah;

    Procedure blah2;

    ???

    You misunderstood, I did not say - 'Make all your variables global', I said just the x and y variables as they will be called a lot.

    And, yes, local variables should be used as much as possible..
    if your x and y are global and you call FindColorsSpiralTolerance() alot, wont it start the search from the x and y saved from a different procedure, semi fucking it up. I know you can reset x and y easily, or simply start the search from MScx MScy or whatever, I'm just saying. However, correct me if I'm wrong (which is like 99% of the time )
    “Ignorance, the root and the stem of every evil.”

  16. #16
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright, I fixed it for him. It was just a bad DTM. My procedure works fine.

  17. #17
    Join Date
    Nov 2008
    Location
    Arizona
    Posts
    236
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    Alright, I fixed it for him. It was just a bad DTM. My procedure works fine.
    yep everythings good thanks all =]
    I'm Back.

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •