Results 1 to 12 of 12

Thread: This script gives me errors

  1. #1
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default This script gives me errors

    check below for uptext.rar

  2. #2
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Assign an integer variable/handler to load the bitmap with BitmapFromString, then use that variable as the first parameter of FindBitmap. The second and third parameter are the point in which the bitmap is located (if found).

  3. #3
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    Assign an integer variable/handler to load the bitmap with BitmapFromString, then use that variable as the first parameter of FindBitmap. The second and third parameter are the point in which the bitmap is located (if found).
    Could you give me an example

  4. #4
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    Simba Code:
    program fighte;
    Const
    // fill out
    NPC=10468317;
    loot=8345019;
    tolorence=15;
    time=3; // in seconds
    rwait=1000;
    tleft= 93;
    tright = 139;
    bleft=630;
    bright=447;
    // player detection
    playerx1=259;
    playery1=160;
    playerx2=275;
    playery2=189;
    // hitbar
    hpx1=242;
    hpy1=159;
    hpx2=296;
    hpy2=165;
    hpcol=50036;





    procedure clicknpc;
    var
     X,Y: Integer;
    begin
            if FindColorTolerance(X,Y,NPC,tleft,tright,bleft,bright,tolerence)
          movemouse(x, y);
          Wait(120 + Random(80));
           ClickMouse(x, y, Mouse_Left)
           waitloot; //Make sure this is declared before
           Wait((time*1000) + Random(rwait));
           if  FindColorTolerance(X,Y,hpcol,hpx1,hpy1,hpx2,hpy2,tolerence)
           then waitloot //Don't put a semi colon after a then, that also has an else in it
           else
           loot;
           if FindColorTolerance(X,Y,loot,tleft,tright,bleft,bright,tolerence)
           movemouse(x, y);
           Wait(120 + Random(80));
           ClickMouse(x, y, Mouse_right)

           FindBitmap(14, 12, 'meJyTUdd2mPAfGcmoa+NCEAUMYI' +
            'BfMVwlGptylXAEcQamFB53oonjsR2NTVOVxPgIiBhQAXLIYBXEjwD' +
            'OzpG+');
            // ?? no idea what to do from here.
           else
            Writeln('Failed to Find Npc')
            wait(500);
            procedure clicknpc;
            end;
    end;
    begin
      repeat
      clicknpc;
      until (False);
      end.

    Man, you need a lesson on the basics of pascal first. Take a look at the TuT in my signature first, get a basic understanding. You have many concept flaws. Finally, Please...Dear god...Please...Use the tab button more efficiently :').

    For the bitmaps, I would try FindObjectDeformed. Take a look at this.

    Also, take a look at Coh3ns guide after mine, that should clear your doubts.
    ~Rez
    Last edited by Rezozo; 11-23-2012 at 04:48 AM.

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  5. #5
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Rezozo View Post
    I edited it in the quote.
    Man, you need a lesson on the basics of pascal first. Take a look at the TuT in my signature first, get a basic understanding. You have many concept flaws.

    Also, take a look at Coh3ns guide after mine, that should clear your doubts.
    ~Rez
    [Error] (39:8): Unknown identifier 'waitloot' at line 38
    Compiling failed.

    No idea were to declare it.

  6. #6
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    Did you make a procedure that waits for the loot? There is no such function/procedure pre defined by SRL, to my knowledge.
    ~Rez

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  7. #7
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    The procedure im using checks to see if the hp bar is above the player. as soon as it goes away it is suposed to then right click the search for the bitmap

  8. #8
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    Is that called waitloot? Did you even include it in the program? As far as I see, that isn't there.
    Also, another thing for your bitmaps: Here.
    ~Rez
    Last edited by Rezozo; 11-23-2012 at 04:59 AM.

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  9. #9
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    sec im following tut, gonna rewrite and see what i get

  10. #10
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Ok so i tried to do a dry run.. and it did not work(i got no errors)
    Simba Code:
    Program TestBitMap;

    Var
      X, Y, charm: Integer; {All the script variables were declared here}

    Procedure CallThings;
    Begin
      charm :=  BitmapFromString(31, 12, 'meJyTUdeWIQU5TPgPRyRpJNJkBj' +
            'CgrvnIJkNEkNnUMpwMvVN3HIMj/IZjDXOscQFxCcRMiDdxmY/scrQ' +
            'wxx8XcMPR2HiCBZmLi40ZJnAvUNdwBiSAJ9iJNxwevGiOx59mMJMl' +
            'VnHMdIvf8WjKiBGnEQIAUtQGXA==');

    End;
    Procedure FreeThings;
    Begin
      FreeBitMap(charm);
    End;
    Procedure pickup;
    Begin
      FindColorTolerance(X,Y,1479346,183,125,334,231,15)
      movemouse(x, y);
           Wait(120 + Random(80));
           ClickMouse(x, y, Mouse_right)
      If FindBitMapToleranceIn(charm, X, Y,248, 197, 270, 214, 65) Then
      Begin
        WriteLn('Debug: We Found charm');
        movemouse(X, Y);
        ClickMouse(X, Y, Mouse_left)
      End Else
        WriteLn('Debug: We Could Not Find The charm');
    End;
    Begin

      CallThings;
      //AddOnTerminate('FreeThings');


      Repeat
      Until(False)
      FreeThings;
      Terminatescript();
    End.
    going to be be on again tomorow
    Last edited by rj; 11-23-2012 at 05:19 AM.

  11. #11
    Join Date
    May 2012
    Posts
    351
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    It's pretty hard to pickup things with simba. The colour detection is not the best with items on the ground
    Currently Working on:
    Mining:77/80
    Herblore:55/80

  12. #12
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    Quote Originally Posted by Lord View Post
    It's pretty hard to pickup things with simba. The colour detection is not the best with items on the ground
    You just have to know what to look for and how to look for it.
    Damn, I need to sleep. GN.
    ~Rez

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

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
  •