Results 1 to 5 of 5

Thread: help with script, am noobie ;p

  1. #1
    Join Date
    Jun 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default help with script, am noobie ;p

    program CutDiamonds;
    {$i SRL-6/SRL.simba}
    Procedure DiamondCutter
    var
    x, y: Integer;
    begin
    if FindColorTolerance(x, y, 2968687,288, 137,300, 175, 10) then
    begin
    MoveMouse(x,y);
    wait(500)
    ClickMouse(x, y, mouse_Left)
    end;
    end;
    begin
    MouseSpeed := 15;
    SetupSRL-6();
    CutDiamonds
    end.



    soo that's what I got, whenever I try to play the script I get a error at: ClickMouse(x, y, mouse_Left)
    I am just trying to make it so the script will click on a npc so I can lateron tell it to buy items and so on.

    Appriciate the help
    PS trying to make it for a RSPS called pkhonor, and thanks in advance for reading.

  2. #2
    Join Date
    Sep 2014
    Location
    C:\Simba\
    Posts
    565
    Mentioned
    9 Post(s)
    Quoted
    71 Post(s)

    Default

    You need to add a ; after wait(500).
    You also need to add a ; after ClickMouse(...).
    also why are you trying to subtract 6 from SetupSRL
    EDIT: just realized you are probably thinking its srl6. Iirc its just SetupSRL;
    Feel free to ask me any questions, I will do my best to answer them!

    Previously known as YouPee.

  3. #3
    Join Date
    Jun 2016
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    okay I did that and I dont get anymore errors (thanks btw) but now when I target the RSPS and press play I get this message:
    -- setupSRL()
    ---- Setting up SRL...
    ---- HINT: You are not using SMART, be sure to use Simba's crosshairs to select the RS client.
    ---- Waiting up to 5 minutes for RS to load...
    and than nothing happens..

    sorry for newbie questuons, still trying to get into it

  4. #4
    Join Date
    Oct 2012
    Posts
    1,258
    Mentioned
    40 Post(s)
    Quoted
    588 Post(s)

    Default

    Along with what joopi's said ^ you're also calling CutDiamonds on line 17, but your procedure is called DiamondCutter (with no "CutDiamonds" in sight) so you should be calling that. (& it'll need a semi colon after it)

    You should read this scripting guide to quickly get a much stronger scripting base before continuing https://villavu.com/forum/showthread.php?t=58935, primarily this bit.
    After that, you should check out this thread https://villavu.com/forum/showthread...909&highlight=, if you do end up doing this, please do let us know how it goes =)

    Quote Originally Posted by doeplidoep View Post
    okay I did that and I dont get anymore errors (thanks btw) but now when I target the RSPS and press play I get this message:
    -- setupSRL()
    ---- Setting up SRL...
    ---- HINT: You are not using SMART, be sure to use Simba's crosshairs to select the RS client.
    ---- Waiting up to 5 minutes for RS to load...
    and than nothing happens..

    sorry for newbie questuons, still trying to get into it
    srl6 only detects rs3, from rj's guide: "a lot of the srl include will be unusable for the private server you want to bot on." & "First off we always want to include SRL just so we can use mmouse"
    Last edited by acow; 06-20-2016 at 01:19 PM.

  5. #5
    Join Date
    Nov 2015
    Location
    Oregon
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Hello Doeplidoep,

    I use identifiers (i think their called) for mouse clicks:

    0 = Right click
    1 = Left click
    2 = Scroll button click


    So it would look like ClickMouse(X, Y, 0); for a right click on points X, Y.

    Not 100% if this is the answer to your problem, but it is a nice tip to know.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Now for loading an RSPS client with srl-6, without overriding the ready procedure, you get this error:
    Code:
    -- setupSRL()
    ---- Setting up SRL...
    ---- HINT: You are not using SMART, be sure to use Simba's crosshairs to select the RS client.
    ---- Waiting up to 5 minutes for RS to load...
    and than nothing happens..
    Simply put this override function at the top of your script to ready the client automatically:
    Code:
    //srl-6 override function
    function waitClientReady(): boolean;override;begin result:= true;end
    Also I saw at the end, "SetupSRL-6();" 99% sure this is not the proper function to use.
    Use SetupSRL();

    Always remember your semicolons, and code structure.
    I suggest reading up on a few more tutorials that can be found in the tutorials section.

    After editing your code, this is what I have:
    Code:
    program CutDiamonds;
    {$i SRL-6/SRL.simba}
    
    var
      x, y:Integer;
      color:= 2968687;
    
    const
      bounds:= IntToBox(288, 137, 300, 175);
    
    //srl-6 override function
    function waitClientReady(): boolean;override;begin result:= true;end
    
    procedure DiamondCutter;
    begin
      if FindColorTolerance(x, y, color, bounds, 10) then
      begin
        MoveMouse(x, y);
        Wait(500 + Random(51));
        ClickMouse(x, y, 1);
      end;
    end;
    
    begin
      MouseSpeed:= 15;
      SetupSRL();
      CutDiamonds;
    end.

    If you have any more questions, feel free to ask.

    - Starfox
    My Scripts:
    TizenX Damage Token Collector
    OS-Scape Auto Buyer
    Check out an index of all my scripts here: ScriptingSRL

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
  •