Page 1 of 2 12 LastLast
Results 1 to 25 of 39

Thread: First script simple error.

  1. #1
    Join Date
    Feb 2010
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default First script simple error.

    Dont plan to use this on runescape as its still really simple but it would be nice to run it through a couple of times just to show it works. 1 error currently in it can someone help me?

    program Pickpocketing;
    {.include SRL/SRL.scar}

    var
    x,y: Integer;

    const
    GuardColor= 689068;//colour of the guard

    begin
    SetupSRL;
    repeat
    FindColorTolerance(x,y,GuardColor,0,0,600,600)) then
    ClickMouse(x,y,true);
    ChooseOption('pickpocket');
    Wait(3000+random(100));
    end;
    until(false);
    end.
    The error is:

    New client targeted
    Failed when compiling
    Line 51: [Error] (330:11): Unknown identifier 'CreateTPAFromBMP' in script C:\Program Files\SCAR 3.22\includes\SRL\SRL\Core\Math.scar
    Hopefully my script is right! it's supposed to pickpocket a guard every 3 seconds on a continous loop!

  2. #2
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Make sure you have updated SRL.

    Also, you forgot to put the tolerance in FindColorTolerance();

    ClickMouse is not recommended for RS scripts as it is detectable. Use Mouse(x, y, ranX, ranY:Integer; ClickLeft: Boolean); instead

  3. #3
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Have you moved your plugins?
    There used to be something meaningful here.

  4. #4
    Join Date
    Feb 2010
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks for your post i appreciate the quick reply.

    il have a go with that click left/click right statement you informed me of.

    What exactly do I have to do with the findcolourtolerance? someone told me about it on another forum without really explaining it.

    And I have moved nothing, just downloaded scar 3.22 and download srl from the drop down menu.

  5. #5
    Join Date
    Oct 2009
    Location
    Connersille, Indiana
    Posts
    254
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That would probably be your problem, you are running an old version of SCAR and SRL. Go to this link http://villavu.com/forum/showthread.php?t=47714 and follow the tutorial on how to properly setup SCAR and SRL.

  6. #6
    Join Date
    Feb 2010
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Alek000 View Post
    That would probably be your problem, you are running an old version of SCAR and SRL. Go to this link http://villavu.com/forum/showthread.php?t=47714 and follow the tutorial on how to properly setup SCAR and SRL.
    Thanks i have some work to do now so il go through that guide later.

    In the meantime, where do i put the tolerance number in my script above please?

  7. #7
    Join Date
    Jan 2008
    Location
    Houston, Texas, USA
    Posts
    770
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    3.22 isn't the latest version of SCAR. Download 3.23 via svn. Follow this guide to properly setup the latest SCAR and SRL.

    http://villavu.com/forum/showthread.php?t=47714

    Now for FindColorTolerance...

    this are the parameters

    Code:
    FindColorTolerance(var  x,  y: Integer; color, xs, ys, xe, ye: Integer; Tolerance: Integer): Boolean;
    So it should be something like

    SCAR Code:
    FindColorTolerance(x, y, color, MSX1, MSY1, MSX2, MSY2, Tolerance);

    MSX1, MSY1, MSX2, MSY2 are the main screen coordinates.

    So your program should be something like


    I think that should work...I am quite tired right now so I might have got something wrong...

    Edit: Scratch that...try this.

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



    const
    GuardColor= 689068;//colour of the guard

    procedure PickPocket;
    var x,y: Integer;
    begin
      if FindColorTolerance(x, y, GuardColor, MSX1, MSY1, MSX2, MSY2, 3) then
      begin
        Mouse(x, y, 4, 4, False);//Use mouse for Runescape
        ChooseOption('ickpocket');//No need to write the whole thing. Part of the text will do.
        Wait(3000+random(100));
      end else Exit;
    end;

    begin
      SetupSRL;
      repeat
        PickPocket;
      until(false);
    end.
    Last edited by FEAR; 02-23-2010 at 04:06 PM.

  8. #8
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by FEAR View Post
    3.22 isn't the latest version of SCAR. Download 3.23 via svn. Follow this guide to properly setup the latest SCAR and SRL.

    http://villavu.com/forum/showthread.php?t=47714

    Now for FindColorTolerance...

    this are the parameters

    Code:
    FindColorTolerance(var  x,  y: Integer; color, xs, ys, xe, ye: Integer; Tolerance: Integer): Boolean;
    So it should be something like

    SCAR Code:
    FindColorTolerance(x, y, color, MSX1, MSY1, MSX2, MSY2, Tolerance);

    MSX1, MSY1, MSX2, MSY2 are the main screen coordinates.

    So your program should be something like

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

    var
    x,y: Integer;

    const
    GuardColor= 689068;//colour of the guard

    begin
      SetupSRL;
      repeat
        if FindColorTolerance(x, y, GuardColor, MSX1, MSY1, MSX2, MSY2, 3)) then //I put 3 as the tolerance...
        begin
          Mouse(x, y, true);//Use mouse for Runescape
          ChooseOption('ickpocket');//No need to write the whole thing. Part of the text will do.
          Wait(3000+random(100));
        end else Exit;//so if it doesn't find the color, it will exit out of the loop...
      until(false);
    end.

    I think that should work...I am quite tired right now so I might have got something wrong...
    Missing ranX and ranY in Mouse();, but other than that, the above looks just fine

  9. #9
    Join Date
    Jan 2008
    Location
    Houston, Texas, USA
    Posts
    770
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    Missing ranX and ranY in Mouse();, but other than that, the above looks just fine
    Yep was fixing that just now and made the pickpocket a procedure

  10. #10
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    it can't do chooseoption if you are left clicking, change it to Mouse(x, y, 4, 4, False);

  11. #11
    Join Date
    Jan 2008
    Location
    Houston, Texas, USA
    Posts
    770
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Baked0420 View Post
    it can't do chooseoption if you are left clicking, change it to Mouse(x, y, 4, 4, False);
    Lol oops...Well I did write I was tired

  12. #12
    Join Date
    Feb 2010
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by FEAR View Post
    Lol oops...Well I did write I was tired
    really appreciate it mate

  13. #13
    Join Date
    Jan 2008
    Location
    Houston, Texas, USA
    Posts
    770
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by lewis_ View Post
    really appreciate it mate
    No problem

  14. #14
    Join Date
    Feb 2010
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by FEAR View Post
    No problem
    ugh for some reason its not selecting pickpocket, but it finds the guards perfectly is there any other way to make it choose pickpocket from the list? i read a guide it included bitmaps? or can i just not make the mouse go down a certain ammount of pixels after clicking and then make it click again?

    Heres the guard with the pickpocket interface:


  15. #15
    Join Date
    Jan 2008
    Location
    Houston, Texas, USA
    Posts
    770
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by lewis_ View Post
    ugh for some reason its not selecting pickpocket, but it finds the guards perfectly is there any other way to make it choose pickpocket from the list? i read a guide it included bitmaps? or can i just not make the mouse go down a certain ammount of pixels after clicking and then make it click again?

    Heres the guard with the pickpocket interface:

    Hmm try putting 'uard' as the chooseOption

    Edit: Does it right click and does the option come up? If it does changing the text should do...
    Last edited by FEAR; 02-23-2010 at 05:32 PM.

  16. #16
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    It looks like it's for a private server.. SRL is made for JaGeX's runescape. The procedures in SRL might not work on that server...

  17. #17
    Join Date
    Jan 2008
    Location
    Houston, Texas, USA
    Posts
    770
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    It looks like it's for a private server.. SRL is made for JaGeX's runescape. The procedures in SRL might not work on that server...
    Oy yea...didn't think of that...(right now my head hurts if I try to think )

    Lewis, your best chance is making a bitmap for that option and Using FindBitmap...Let me see if I can find a tutorial for you.

    Edit: Try this http://villavu.com/forum/showthread.php?t=47845 or I think Coh3n also wrote about Bitmaps in his tutorial...
    yep, also try this http://villavu.com/forum/showpost.ph...74&postcount=3 search for bitmap and see how to make one properly.
    Last edited by FEAR; 02-23-2010 at 05:38 PM.

  18. #18
    Join Date
    Feb 2010
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by FEAR View Post
    Hmm try putting 'uard' as the chooseOption

    Edit: Does it right click and does the option come up? If it does changing the text should do...
    Yes sorry for the late reply, it right clicks. so it works upto choose option. It just doesn't select ickpocket.

    EDIT:

    I am just making a bitmap for the pickpocket section correct?

  19. #19
    Join Date
    Jan 2008
    Location
    Houston, Texas, USA
    Posts
    770
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by lewis_ View Post
    Yes sorry for the late reply, it right clicks. so it works upto choose option. It just doesn't select ickpocket.

    EDIT:

    I am just making a bitmap for the pickpocket section correct?
    Yes you have to make a Bitmap for that line....

    Or tell me the coordinates of any point in that line. Use the color picker anywhere on that line and tell me what you get in debugbox. It should look something like this

    SCAR Code:
    Color Picked: 16777215 at (362, 212)
    Last edited by FEAR; 02-23-2010 at 05:56 PM.

  20. #20
    Join Date
    Feb 2010
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    sorry im new to this lol right ive got this :

    pickpocketbmp := BitmapFromString(195, 15, 'beNrtmFGOgzAMRH' +
    'O7XqC/e/9jsFWpoqzH44whEVQblA8IjjH1w57m+Sil/Dwfr7E1xz4' +
    'jjgNLrvK8baWOGQHXR7C7ZSvlfbeeDByiz92MGbfzqSANSK/LbPrq' +
    'wkkgiZ67Ye8p3o95LNWn0Ax+IvicDwcp9okx+IyVNEsIUrYU3 AokZ' +
    'txSVF98Tsw+SG0GxaTPAMm8ONYfdKIWOg6SCNV3gTSpo+kgpZ I+A6' +
    'QoqkJBUvh0Wxv7eFFKsZ7IRJc+n/Ica7yaX9RI7aV7S5k081mQXN0' +
    'SyJXAXgfJFEnm5BhISJGb2Xqwhe0l8zDPM751m1+jkdpb7rlr bxql' +
    'ATUFEtMtrk3Onutql6KBIGEiWMvDUoD4sUYZn5/33O04XXiwyLiAM' +
    'Rl/DKS4Urn6KloLR5eisSAF2iNONzaaUSCxFuZWqlEgMTwQlfiuCh ' +
    'IAwwQws1czzim6A0is0ZwHSWmCijJPtTO9ag0DySsdbt6Zffb vv6j' +
    'YZ4AUS+JWULG60RVjXc/oHIuVsiGJvSmej1FxLbt7fazIdP+LufYJ' +
    'kILlf+e74CFIwdaK7bD4LcA5qxvMg+7ZFQDoId5FORZSvAfFQ qIs8' +
    'V/VjUF5nJhxJp/srEyRAemqLaB/NSZthF4e7QJpjVHILZDWuC1IX1' +
    'fD1zg1fgH81TAR');

  21. #21
    Join Date
    Jan 2008
    Location
    Houston, Texas, USA
    Posts
    770
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by lewis_ View Post
    sorry im new to this lol right ive got this :

    pickpocketbmp := BitmapFromString(195, 15, 'beNrtmFGOgzAMRH' +
    'O7XqC/e/9jsFWpoqzH44whEVQblA8IjjH1w57m+Sil/Dwfr7E1xz4' +
    'jjgNLrvK8baWOGQHXR7C7ZSvlfbeeDByiz92MGbfzqSANSK/LbPrq' +
    'wkkgiZ67Ye8p3o95LNWn0Ax+IvicDwcp9okx+IyVNEsIUrYU3 AokZ' +
    'txSVF98Tsw+SG0GxaTPAMm8ONYfdKIWOg6SCNV3gTSpo+kgpZ I+A6' +
    'QoqkJBUvh0Wxv7eFFKsZ7IRJc+n/Ica7yaX9RI7aV7S5k081mQXN0' +
    'SyJXAXgfJFEnm5BhISJGb2Xqwhe0l8zDPM751m1+jkdpb7rlr bxql' +
    'ATUFEtMtrk3Onutql6KBIGEiWMvDUoD4sUYZn5/33O04XXiwyLiAM' +
    'Rl/DKS4Urn6KloLR5eisSAF2iNONzaaUSCxFuZWqlEgMTwQlfiuCh ' +
    'IAwwQws1czzim6A0is0ZwHSWmCijJPtTO9ag0DySsdbt6Zffb vv6j' +
    'YZ4AUS+JWULG60RVjXc/oHIuVsiGJvSmej1FxLbt7fazIdP+LufYJ' +
    'kILlf+e74CFIwdaK7bD4LcA5qxvMg+7ZFQDoId5FORZSvAfFQ qIs8' +
    'V/VjUF5nJhxJp/srEyRAemqLaB/NSZthF4e7QJpjVHILZDWuC1IX1' +
    'fD1zg1fgH81TAR');
    OK first first let me try something simpler....read my last post...I edited it. Get me the coordinates of any point in that line (pickpocket Guard)

  22. #22
    Join Date
    Feb 2010
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ive got this? Any outstanding errors you can see?

    program Pickpocketing;
    {.include SRL/SRL.scar}



    const
    GuardColor= 689068;//colour of the guard
    pickpocketbmp : Integer;

    procedure LoadBmps;
    begin

    pickpocketbmp := BitmapFromString(195, 15, 'beNrtmFGOgzAMRH' +
    'O7XqC/e/9jsFWpoqzH44whEVQblA8IjjH1w57m+Sil/Dwfr7E1xz4' +
    'jjgNLrvK8baWOGQHXR7C7ZSvlfbeeDByiz92MGbfzqSANSK/LbPrq' +
    'wkkgiZ67Ye8p3o95LNWn0Ax+IvicDwcp9okx+IyVNEsIUrYU3 AokZ' +
    'txSVF98Tsw+SG0GxaTPAMm8ONYfdKIWOg6SCNV3gTSpo+kgpZ I+A6' +
    'QoqkJBUvh0Wxv7eFFKsZ7IRJc+n/Ica7yaX9RI7aV7S5k081mQXN0' +
    'SyJXAXgfJFEnm5BhISJGb2Xqwhe0l8zDPM751m1+jkdpb7rlr bxql' +
    'ATUFEtMtrk3Onutql6KBIGEiWMvDUoD4sUYZn5/33O04XXiwyLiAM' +
    'Rl/DKS4Urn6KloLR5eisSAF2iNONzaaUSCxFuZWqlEgMTwQlfiuCh ' +
    'IAwwQws1czzim6A0is0ZwHSWmCijJPtTO9ag0DySsdbt6Zffb vv6j' +
    'YZ4AUS+JWULG60RVjXc/oHIuVsiGJvSmej1FxLbt7fazIdP+LufYJ' +
    'kILlf+e74CFIwdaK7bD4LcA5qxvMg+7ZFQDoId5FORZSvAfFQ qIs8' +
    'V/VjUF5nJhxJp/srEyRAemqLaB/NSZthF4e7QJpjVHILZDWuC1IX1' +
    'fD1zg1fgH81TAR');
    end;

    procedure PickPocket;
    var x,y: Integer;
    begin
    if FindColorTolerance(x, y, GuardColor, MSX1, MSY1, MSX2, MSY2, 3) then
    begin
    Mouse(x, y, 4, 4, False);//Use mouse for Runescape
    if(FindBitmap(pickpocketbmp,x,y)) then
    Mouse(x, y, 4, 4, True);
    Wait(3000+random(100));
    end else Exit;
    end;

    begin
    SetupSRL;
    repeat
    PickPocket;
    until(false);
    end.

  23. #23
    Join Date
    Jan 2008
    Location
    Houston, Texas, USA
    Posts
    770
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by lewis_ View Post
    Ive got this? Any outstanding errors you can see?
    Yes...your Bitmap name is pickpocketbm not Fish and you can't use the same variable for two things...use different variable for the bitmap...And look in my last post! lol

  24. #24
    Join Date
    Feb 2010
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by FEAR View Post
    Yes...your Bitmap name is pickpocketbm not Fish and you can't use the same variable for two things...use different variable for the bitmap...And look in my last post! lol
    lol changed that, thought id get it before you read um error on line 8 ?

    PHP Code:
    Line 8: [Error] (21790:15): is ('='expected in script C:\Users\Lewis\Desktop\scarprerelease\Scripts\Pickpocketvgaurds.scar 
    And i keep failing at getting the coords of the pickpocket, would that not change every time though depending on where the guards are? so how would we use that to click the pickpocket?

  25. #25
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    You didn't load the bmp. Add LoadBmps to the mainloop (after SetupSRL;)

Page 1 of 2 12 LastLast

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
  •