Results 1 to 8 of 8

Thread: Need help with a simple auto-buyer

  1. #1
    Join Date
    Aug 2014
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default Need help with a simple auto-buyer

    So I'm trying to make a script that will

    1.) Right-click the arrow shafts
    2.) Purchase "50" of them

    I eventually want to be able to buy feathers and do the same, but I can do that after I get this sorted out because I will end up combining both of them.

    However, when I run the script just to see if it will "MMouse" to the coordinates, it doesn't compile. Well, I guess it does compile, but it doesn't move the mouse to the coordinates.It just says "SRL compiled in 0 seconds".


  2. #2
    Join Date
    Jun 2015
    Posts
    64
    Mentioned
    2 Post(s)
    Quoted
    21 Post(s)

    Default

    There's nothing calling your procedure, also for rsps use the select a client tool to pick the window so the coordinates will be correct.
    hi it me

  3. #3
    Join Date
    Dec 2015
    Location
    where do you live!
    Posts
    30
    Mentioned
    2 Post(s)
    Quoted
    13 Post(s)

    Default

    Hey you might take a look at an old, out-dated script I wrote.

    You're welcome to salvage the code/use it as a reference. If you know the coordinates of the item you want to buy, one of the functions from this script may be of great use to you.
    Last edited by Keelijh; 01-23-2016 at 11:23 PM.

  4. #4
    Join Date
    Mar 2012
    Posts
    107
    Mentioned
    2 Post(s)
    Quoted
    49 Post(s)

    Default

    Quote Originally Posted by YMCMBubel View Post
    So I'm trying to make a script that will

    1.) Right-click the arrow shafts
    2.) Purchase "50" of them

    I eventually want to be able to buy feathers and do the same, but I can do that after I get this sorted out because I will end up combining both of them.

    However, when I run the script just to see if it will "MMouse" to the coordinates, it doesn't compile. Well, I guess it does compile, but it doesn't move the mouse to the coordinates.It just says "SRL compiled in 0 seconds".

    The main body of your script needs to be at the bottom, at least that is how I and many others do it. You also have to call the procedure in the main body for it to execute, after SetupSRL;



    Simba Code:
     

  5. #5
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    Hey mate, i don't even know if the SRL library is still maintained and working? In any case.

    Flights aerolib include is the most current, I would suggest making a DTM - which there are many guide on this forum as to this..

    or alternative use a colour function, but the previous suggestion would be more ideal.

    https://github.com/J-Flight/AeroLib/...gine/DTM.simba

    Also if you take a look at other people scripts (towards the bottom) you find -

    Code:
     Program Sample;
     {$DEFINE SMART}
     {$i AeroLib/AeroLib.Simba}
    
    Var
     DTM_ShopItem := DTMFromString('DTMLabelHere,ijisjijsijsisjsijsisjisjsisjsijs=');
      
    Procedure rightclickitem
     begin
       if findDTM(DTM_ShopItem, P.X, P.Y, MSX1, MSCY, MSX2, MSY2) then
        begin
          missMouse(P, 5, 5);
         if waitUpTextMulti('PlaceUptextHere', 300) then  //300 is a wait time
       end; 
     end
    
    Procedure MainLoop;
    begin
     rightclickitem;
    end;
    
    
    begin
      InitAL;
      //LoginPlayer(False);
      repeat
       Mainloop 
      until(false);
    end;

    ***Don't quote me on this.. I haven't used Aerolib in sometime, i am a little rusty. But this should nudge you in the right direction?

    <------------------>



  6. #6
    Join Date
    Aug 2014
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by AFools View Post
    Hey mate, i don't even know if the SRL library is still maintained and working? In any case.

    Flights aerolib include is the most current, I would suggest making a DTM - which there are many guide on this forum as to this..

    or alternative use a colour function, but the previous suggestion would be more ideal.

    https://github.com/J-Flight/AeroLib/...gine/DTM.simba

    Also if you take a look at other people scripts (towards the bottom) you find -

    Code:
     Program Sample;
     {$DEFINE SMART}
     {$i AeroLib/AeroLib.Simba}
    
    Var
     DTM_ShopItem := DTMFromString('DTMLabelHere,ijisjijsijsisjsijsisjisjsisjsijs=');
      
    Procedure rightclickitem
     begin
       if findDTM(DTM_ShopItem, P.X, P.Y, MSX1, MSCY, MSX2, MSY2) then
        begin
          missMouse(P, 5, 5);
         if waitUpTextMulti('PlaceUptextHere', 300) then  //300 is a wait time
       end; 
     end
    
    Procedure MainLoop;
    begin
     rightclickitem;
    end;
    
    
    begin
      InitAL;
      //LoginPlayer(False);
      repeat
       Mainloop 
      until(false);
    end;

    ***Don't quote me on this.. I haven't used Aerolib in sometime, i am a little rusty. But this should nudge you in the right direction?
    Thank you so much man. I had to change a few things around but it works great, honestly. I like the aerolib include.

  7. #7
    Join Date
    Aug 2014
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by AFools View Post
    Hey mate, i don't even know if the SRL library is still maintained and working? In any case.

    Flights aerolib include is the most current, I would suggest making a DTM - which there are many guide on this forum as to this..

    or alternative use a colour function, but the previous suggestion would be more ideal.

    https://github.com/J-Flight/AeroLib/...gine/DTM.simba

    Also if you take a look at other people scripts (towards the bottom) you find -

    Code:
     Program Sample;
     {$DEFINE SMART}
     {$i AeroLib/AeroLib.Simba}
    
    Var
     DTM_ShopItem := DTMFromString('DTMLabelHere,ijisjijsijsisjsijsisjisjsisjsijs=');
      
    Procedure rightclickitem
     begin
       if findDTM(DTM_ShopItem, P.X, P.Y, MSX1, MSCY, MSX2, MSY2) then
        begin
          missMouse(P, 5, 5);
         if waitUpTextMulti('PlaceUptextHere', 300) then  //300 is a wait time
       end; 
     end
    
    Procedure MainLoop;
    begin
     rightclickitem;
    end;
    
    
    begin
      InitAL;
      //LoginPlayer(False);
      repeat
       Mainloop 
      until(false);
    end;

    ***Don't quote me on this.. I haven't used Aerolib in sometime, i am a little rusty. But this should nudge you in the right direction?
    Alright, so I've been toying with srl-osr include and I've worked my script around to this:
    Code:
    Program AtaTinMiner;
    {$i srl-osr/srl.simba}
    
    Procedure MineTin;
    var
      X,Y:Integer;
     begin
     if findColorTolerance(X,Y,2503250,5,4,764,520,1) then
      begin
      moveMouse(X,Y); //moves the mouse to the coordinates of the found point
      wait(100); //waits 1/10 of a second
      clickMouse(X,Y,1); //clicks the left-side of the mouse
      end;
     end;
    
    Procedure BankTin;
    var
      Bank,X,Y:Integer;
      begin
      Bank := DTMFromString('mbQAAAHicY2VgYHgCxDeB+BYQvwDil0CcC8SZQFwCxEVAnA7EIfacDJHOnGA6yJaTIcyBkwEdMOLAYAAAALwJqw==');
      if InvFull then
      begin FindDTM(Bank,X,Y,5,4,764,520)
    
    
    
    begin
      MineTin(); //you have to do this
      BankTin();
      //this is what will happen when you run the script
    end.// <-- the one with the period
    
    
    Begin
    MouseSpeed := 15;
    end.
    However, I get this as my error:
    Code:
    Error: Expression expected at line 30
    Compiling failed.
    What does it mean by "expression"? And how could I fix this?

  8. #8
    Join Date
    May 2012
    Location
    Glorious Nippon
    Posts
    1,011
    Mentioned
    50 Post(s)
    Quoted
    505 Post(s)

    Default

    Quote Originally Posted by YMCMBubel View Post
    Simba Code:
    1. Procedure BankTin;
    2. var
    3.   Bank,X,Y:Integer;
    4.   begin //no end
    5.   Bank := DTMFromString('mbQAAAHicY2VgYHgCxDeB+BYQvwDil0CcC8SZQFwCxEVAnA7EIfacDJHOnGA6yJaTIcyBkwEdMOLAYAAAALwJqw==');
    6.   if InvFull then
    7.   begin FindDTM(Bank,X,Y,5,4,764,520) //no end
    8.  
    9. begin
    10.   MineTin(); //you have to do this
    11.   BankTin();
    12.   //this is what will happen when you run the script
    13. end.// <-- the one with the period
    14.  
    15. //delete all of this
    16. Begin
    17. MouseSpeed := 15;
    18. end.
    There are a few problems here. You have begins without ends, and you have two 'main' blocks.
    It looks like you're having trouble with the basics of how pascal/lape is structured.
    This tutorial should help: https://villavu.com/forum/showthread.php?t=58935

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
  •