Results 1 to 3 of 3

Thread: First script (Monster killer + looting) questions

  1. #1
    Join Date
    Jul 2015
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default First script (Monster killer + looting) questions

    Hello everyone,

    I am trying to make a simple script that will kill a monster and loot the money it drops.

    Game: OS-Scape PvP
    Monster: Abbysal demon
    Drop: Blood Money

    Here is what my code looks like

    Code:
    program DemonKiller
    
    {$I SRL-6/SRL.simba}
    //srl-6 override function
    function waitClientReady(): boolean;override;begin result:= true;end
    var
       x, y, demonClick: integer;
    
    
    procedure ClickDemon;
    var
      x, y : integer;
    begin
      if FindColorTolerance(x, y, 1973824, 156, 165, 469, 264, 3) then
      begin
        MoveMouse(x, y);
        wait(250);
        ClickMouse(x, y, MOUSE_LEFT);
      end;
    end;
    
    procedure lootMoney;
    var
      x, y : integer;
    begin
      if FindColorTolerance(x, y, 1781723, 206, 319, 228, 323, 50) then
      begin
       MoveMouse(x, y);
       wait(250);
       ClickMouse(x, y, MOUSE_LEFT);
      end;
    end;
    
    begin
      setupSRL();
      repeat
        lootMoney;
        ClickDemon;
      until (false)
     end.

    The procedure ClickDemon works, but it just spam clicks the abbysal demons even if I'm in combat.
    How can I make a fuction that waits till I'm done fighting the monster before it starts clicking another?

    The Procedure lootMoney doesn't work at all... I commented out the ClickDemon and dropped the money and it doesn't click it at all. Even though I did the same steps as with clicking the demon..

    Any help is much appreciated!!

  2. #2
    Join Date
    Apr 2017
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I would look into PixelShift for the combat. There might be a better way, but I find PixelShift to be great to learn since it can be applied in many ways for various scripts.

    I'm not sure about the looting tho, maybe try opening a fresh tab/script and playing around with it to see if you can get it working, then copy/paste it over? My best guess since it's an "if" statement is that it's not finding the color.

  3. #3
    Join Date
    Mar 2014
    Posts
    195
    Mentioned
    4 Post(s)
    Quoted
    92 Post(s)

    Default

    Quote Originally Posted by stijnbogaert View Post
    Hello everyone,

    I am trying to make a simple script that will kill a monster and loot the money it drops.

    Game: OS-Scape PvP
    Monster: Abbysal demon
    Drop: Blood Money

    Here is what my code looks like

    Code:
    program DemonKiller
    
    {$I SRL-6/SRL.simba}
    //srl-6 override function
    function waitClientReady(): boolean;override;begin result:= true;end
    var
       x, y, demonClick: integer;
    
    
    procedure ClickDemon;
    var
      x, y : integer;
    begin
      if FindColorTolerance(x, y, 1973824, 156, 165, 469, 264, 3) then
      begin
        MoveMouse(x, y);
        wait(250);
        ClickMouse(x, y, MOUSE_LEFT);
      end;
    end;
    
    procedure lootMoney;
    var
      x, y : integer;
    begin
      if FindColorTolerance(x, y, 1781723, 206, 319, 228, 323, 50) then
      begin
       MoveMouse(x, y);
       wait(250);
       ClickMouse(x, y, MOUSE_LEFT);
      end;
    end;
    
    begin
      setupSRL();
      repeat
        lootMoney;
        ClickDemon;
      until (false)
     end.

    The procedure ClickDemon works, but it just spam clicks the abbysal demons even if I'm in combat.
    How can I make a fuction that waits till I'm done fighting the monster before it starts clicking another?

    The Procedure lootMoney doesn't work at all... I commented out the ClickDemon and dropped the money and it doesn't click it at all. Even though I did the same steps as with clicking the demon..

    Any help is much appreciated!!
    For looting items you can check out this thread.
    https://villavu.com/forum/showthread.php?t=116975

    Add as for it just spam clicking the demon.
    check out whats happening in your main loop.
    Simba Code:
    repeat
        lootMoney;
        ClickDemon;
      until (false)
    if it finds the money for it to loot it.
    Then if it finds the demon then click it.

    So if it doesnt fint the money it will just click the demon.

    So you will have to change it a bit. Like so.
    Simba Code:
    repeat
        ClickDemon;
        IsDemonDead; //a function to see if the demon is dead, so it can loot ,you will have to create this.
        lootMoney;
       
      until (false)
    As i dont play that server, i dont really know the code to check to see if the demon is dead,But here are some ideas.

    Check for hit points bars, check for hit splat near your char,your char pixel shift,and xp gain if you have an xp tracker.

    Check out the srl-6 documentation on pixel shift.

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
  •