Results 1 to 9 of 9

Thread: [Adding Dropping] NOT WORKING :)

  1. #1
    Join Date
    Sep 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default [Adding Dropping] NOT WORKING :)

    hi, I "made" a power miner using Solemn Wishes tutorial but there wasn't a drop function to it so I decided to add on to the script( change it around and hopefully make a new one based on his).

    I tried to get it to drop but I keep getting an error:

    Line 3: [Error] (14684:20): Duplicate identifier 'Mine' in script
    SCAR Code:
    program pwrmin0r;
    {.include SRL/SRL.scar}
    var rocksmined,x,y,Mine:integer;
    const
    rock1color=16777215;


    procedure minethatore;//this is a simple procedure but works
    begin
    if(FindColorSpiralTolerance(x,y,Rock1Color,5,5,514 ,337,2))then
    movemousesmooth(x,y) //moves the mouse towards the color
    wait(1000+500)//wait a random time
    if(FindBitmapToleranceIn(mine,x,y,6,6,126,23,1))then//this is the bitmap we made earlier
    begin
    getmousepos(x,y) //gets the position of the mouse
    clickmouse(x,y,true) // clicks the mouse at its current position
    wait(3000+1000) //waits 3 seconds + 1 second
    end;
    end;


    procedure loadbitmaps;
    begin
    Mine := BitmapFromString(14, 12,
            '000000000000000000000000000000000000000000000000000000' +
            '000000000000000000000000000000000000FFFFFFFFFFFF000000' +
            '000000000000000000FFFFFFFFFFFF000000000000000000000000' +
            '000000000000FFFFFFFFFFFF000000000000000000000000FFFFFF' +
            'FFFFFF000000000000000000000000000000000000FFFFFFFFFFFF' +
            'FFFFFF000000000000FFFFFFFFFFFFFFFFFF000000000000000000' +
            '000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF' +
            'FFFFFFFFFFFF000000000000FFFFFFFFFFFF000000000000FFFFFF' +
            'FFFFFF000000FFFFFFFFFFFF000000FFFFFFFFFFFF000000000000' +
            '000000000000000000000000FFFFFFFFFFFF000000000000000000' +
            '000000FFFFFFFFFFFF000000000000FFFFFFFFFFFF000000000000' +
            'FFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFF000000' +
            '000000FFFFFFFFFFFF000000000000FFFFFFFFFFFF000000000000' +
            '000000000000FFFFFFFFFFFF000000000000FFFFFFFFFFFF000000' +
            '000000FFFFFFFFFFFF000000000000000000000000FFFFFFFFFFFF' +
            '000000000000FFFFFFFFFFFF000000000000FFFFFFFFFFFF000000' +
            '000000000000000000FFFFFFFFFFFF000000000000FFFFFFFFFFFF' +
            '000000000000000000000000000000000000000000000000000000' +
            '000000000000000000000000000000000000');
    end;
    begin
        SetupSRL;
        loadbitmaps;
    repeat
      minethatore;
        writeln('mined '+inttostr(rocksmined)+ ' rocks so far');
      if InvFull then
    begin
    DropToPosition(2, 28);

    until(false)
    end.

    any suggestions? Still somewhat new at this whole scripting thing.
    Thanks in advance, Kow.

  2. #2
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    MouseSmooth will get you banned

    DropAll; using SRL will drop your whole inv..


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  3. #3
    Join Date
    Jun 2007
    Location
    NSW, Australia.
    Posts
    541
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Number 1, learn better standards, it makes it easier for everyone.
    Number 2, I don't know what that massive bitmap is for, you should probably get rid of it.
    Number 3, the procedure InvFull doesn't exist anymore. In its place, use if (InvCount = 28).
    Number 4, instead of DropToPosition, use DropTo.
    Number 5, never use ClickMouse or MoveMouseSmooth. Instead, use Mouse and MMouse.

    I'm not sure what the error was about, but possibly there is something already declared as 'Mine' in SRL, try changing the name of the bitmap.

    Overall, it was a nice attempt at a script though. Keep working at it!
    Quote Originally Posted by RAM View Post
    I sam sofa king wee todd did ! ~RAM
    My SRL Army Blog.


  4. #4
    Join Date
    Oct 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i totally know what you people are talking about.

  5. #5
    Join Date
    Sep 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright, i fixed the dropping and added some more to it.
    The dropping itself, without the antirandoms and what not works.
    I used some tutorials for help and came down to this, sadly, it doesn't work!

    here's the script, i appreciate all the help
    besides the fact that it's not mining and just logs off, pointing out other problems in the script would be nice
    oh, and btw, it's really shaky after it mines a rock, the pointer moves everywhere( the little brown dirt tiles on the ground too)

    SCAR Code:
    program powerminer;
    {.include SRL/SRL.scar}
    var x,y : integer;
    Loads : integer;
    const
    rock1color=2964577;

    procedure minethatore;
    begin
    if FindObj(x, y, 'ine', Rock1Color, 30) then
       begin
          MMouse(x, y, 0, 0);
          if ChooseOption('ine') then
          wait(2000+random(2000))
          begin
    end;
    end;
    end;

    procedure AntiRandom;
    begin
      FindTalk;
      FindNormalRandoms;
      FindLamp('mining');
       if FindFight then
        begin
         RunAwayDirection('n'); //runs north (s, w, e)
         Wait(10000+random(2000));
         RunBack;
        end;
    end;

    Procedure Drop;
    begin
      if (InvCount=28) then
    begin
    DropAll;
    Loads:=Loads+1;
    end;
    end;

    procedure ProgressReport;
    begin
    ClearDebug;
       Writeln('[]========================================[]');
        Writeln('---------------->ProgressReport!?<----------------');
        Writeln('  did ' + IntToStr(Loads) + ' Loads' + '    ');
        Writeln('---------------------------------------------');
        Writeln('[]========================================[]');
    end;

    begin
        SetupSRL;
    repeat
     minethatore;
     AntiRandom;
     Drop;
    until(false)
    end.

  6. #6
    Join Date
    Jun 2007
    Location
    NSW, Australia.
    Posts
    541
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Fixed it up a bit, compare the two scripts now, take a look at what I did.

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

    //var x,y : integer; <- Don't use globals for x and y.

    Loads : integer;
    const
    rock1color=2964577;

    procedure MineThatOre;   //<- Notice the capitals?
    var X, Y : Integer;
    begin
    //if FindObj(x, y, 'ine', Rock1Color, 30) then  <- Instead, you can use FindObjCustom, it rocks.
      if (FindObjCustom(X, Y, ['ine', 'ock', 'Min', 'Roc'], [Rock1Colors], 3) // <- 3 tolerance should do.
      begin
        Mouse(x, y, 3, 3, True); //<- Added randomness in, changed to Mouse instead of MMouse.
    //  if ChooseOption('ine') then <- What are you doing here? You can't chooseoption unless you R-Clicked.
        Wait(2000 + Random(2000)); // <- Forgot the semicolon, otherwise good.
      end;
    end;

    procedure AntiRandom;    //<- All good, just standardized it a bit.
    begin
      FindTalk;
      FindNormalRandoms;
      FindLamp('mining');
      if FindFight then
      begin
        RunAwayDirection('n'); //runs north (s, w, e)
        Wait(10000 + Random(2000));
        RunBack;
      end;
    end;

    procedure Drop;     //<- Standardized it.
    begin
      if (InvCount=28) then
      begin
        DropAll;
        Loads:=Loads+1;
      end;
    end;

    procedure ProgressReport;  //Good work, cleaned it up a little :)
    begin
      ClearDebug;
      Writeln('[]========================================[]');
      Writeln('---------------->ProgressReport!?<----------------');
      Writeln('  did ' + IntToStr(Loads) + ' Loads' + '    ');
      Writeln('---------------------------------------------');
      Writeln('[]========================================[]');
    end;

    begin
      SetupSRL;

      ActivateClient;  //Always remember to do this, otherwise your script wont work.
     
      Wait(1000);
     
      repeat
        MineThatOre;
        AntiRandom;
        Drop;
      until(false);
    end.
    Quote Originally Posted by RAM View Post
    I sam sofa king wee todd did ! ~RAM
    My SRL Army Blog.


  7. #7
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    just a suggestion use numerous rock colors so you have a much better chance of finding the rocks.

  8. #8
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    // * procedure ClickAllItemsColorTolWait(option: String; color, tol, waitnum: Integer);        // * byWT-Fakawi
    // * procedure ClickAllItemsBmpTolWait(optionx: String; bmp, tol, waitnum: Integer);           // * by WT-Fakawi
    // * procedure ClickAllItemsBmpMaskTolWait(optionx: String; bmp, tol, ctol, waitnum: Integer); // * by WT-Fakawi
    // * procedure DropItem(i: Integer);                                                           // * by Lorax
    // * procedure DropAll;                                                                        // * by Lorax
    // * procedure DropExcept(I: Array of Integer);                                                // * by Spky
    // * procedure DropToPosition(StartPosition, EndPosition: Integer);                            // * by Mutant Squirrle
    // * procedure DropHold(keep: String);

    these are all procedures that can help you

    Join the fastest growing merchanting clan on the the net!

  9. #9
    Join Date
    Sep 2007
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks a lot/again for the help. I'll add multiple rock colors and post another update.

    I would just have to add another
    if (FindObjCustom(X, Y, ['ine', 'ock', 'Min', 'Roc'], [Rock1Colors], 3)
    ...
    ...

    but use Rock2Colors,etc. rather than rock1 and add the other constants?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help with dropping
    By dallas574 in forum OSR Help
    Replies: 3
    Last Post: 07-24-2008, 05:13 PM
  2. Dropping procedure not working correctly
    By HyperSecret in forum OSR Help
    Replies: 0
    Last Post: 04-17-2008, 05:16 AM
  3. Dropping By DTM
    By ammo2006 in forum OSR Help
    Replies: 2
    Last Post: 09-17-2007, 12:11 AM
  4. More dropping help
    By RudeBoiAlex in forum OSR Help
    Replies: 5
    Last Post: 03-06-2007, 04:38 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
  •