Results 1 to 8 of 8

Thread: simple script help

  1. #1
    Join Date
    Aug 2012
    Posts
    31
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default simple script help

    hello im just trying to make script that kills men in edgeville then stops when it gets a lvl 1 clue scroll..

    my problem is it searches and finds the color just find I just need it to right click attack and wait until the man is dead then find a new one... I want to keep this super simple using color.. heres what I have so far..

    program killman;


    Procedure KillMan;
    Var
    x, y:integer;
    begin
    if FindColorSpiralTolerance(x, y, 6489444 ,19, 98, 524, 411, 25) then
    begin
    MoveMouse(x, y);
    ClickMouse(x, y, 1);
    end else
    begin
    if FindColorSpiralTolerance(x, y, 7313353 ,19, 98, 524, 411, 25) then
    begin
    MoveMouse(x, y);
    ClickMouse(x, y, 1);
    end else
    begin
    if FindColorSpiralTolerance(x, y, 3507351 ,19, 98, 524, 411, 25) then
    begin
    MoveMouse(x, y);
    ClickMouse(x, y, 1);
    end else
    begin
    if FindColorSpiralTolerance(x, y, 5669561 ,19, 98, 524, 411, 25) then
    begin
    MoveMouse(x, y);
    ClickMouse(x, y, 1);
    end else
    writeLn('KillMan failed, did not find any color');
    end;
    end;
    end;
    end;


    begin
    ActivateClient;
    KillMan;
    end


    its not on a loop because it wont attack and it takes over my mouse.. for some reason the hot key to stop the script doesn't work.

  2. #2
    Join Date
    Aug 2012
    Posts
    31
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    I just need to know the phrase for "if show text" then click... I see I could use something in relfection called "chooseoption" I think.. but I don't know how to do that.. help a guy learn to script please lol...

    this compiles but doesn't do anything.. I switched it to just look for purple women. also in the original script that will move and click, it doesn't click on the actual man/woman it moves to the spot next to them tho... I think it needs to slowly move then click.. someone help.... also I cant join the irc... it doesn't work on my pc

    program killman;


    Procedure KillMan;
    Var
    x, y:integer;
    begin
    if FindColorSpiralTolerance(x, y, 4229211 ,4, 12, 506, 328, 25) then
    begin
    MoveMouse(x, y);
    begin
    ClickMouse(x, y, 2);
    if IsFontloaded('ttack') then
    begin ClickMouse(x, y,1);
    end else
    end;


    begin
    ActivateClient;
    KillMan;
    end
    end
    end
    Last edited by HippestTrip; 04-12-2016 at 03:17 AM.

  3. #3
    Join Date
    Aug 2012
    Posts
    31
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    this sucks.. just ban me for triple posting cuz nobodys ever going to help me... thanks for nothing guys. ive been trying to learn shit bullshit for 3 years...

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

    Default

    Tip: post your code in simba tags so people can read it.

    If you want to use reflection:
    https://villavu.com/forum/showthread.php?t=111662
    https://villavu.com/forum/showthread.php?t=111664

    I've never used Aerolib, but I spent a few seconds looking at the public scripts and it looks like waitOption('text', waitTime); is how the choose option menu is handled.

  5. #5
    Join Date
    Aug 2012
    Posts
    31
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    I think im going to end up using tpointarray stuff... I just need to remember static and nonstatic functions I believe.. calling all my variables and such so they can be used.. all these tutorials just expect us to know this. im frustrated.

    does anyone know how to make it click the middle of an npc? like in an up to date tutorial possibly?
    Last edited by HippestTrip; 04-12-2016 at 05:41 AM.

  6. #6
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Quote Originally Posted by HippestTrip View Post
    I think im going to end up using tpointarray stuff... I just need to remember static and nonstatic functions I believe.. calling all my variables and such so they can be used.. all these tutorials just expect us to know this. im frustrated.
    Settle down my friend, you only asked your question yesterday and you didn't ask it very well.

    The first recommendation is look at using Aerolib if you want to create a bot that uses colour as it has a lot of extremely useful functions built in to assist you.

    You can grab it here: https://villavu.com/forum/showthread.php?t=108953

    This explains the core functionality: https://villavu.com/forum/showthread.php?t=113715

    There aren't any bare beginner friendly tutorials written in Aerolib or Lape reflection from what I have seen, but you can still adapt tutorials that were written in SRL over the Lape like I did (recently).

    My personal favourite tutorial is: https://villavu.com/forum/showthread.php?t=44942

    So moving on to your problem. If you are going to do it in Aerolib then you can look at the functions located in C:/Simba/Includes/Aerolib.
    This will list all of the .Simba files that house all of the useful functions. An example of this is waitUptext:
    Simba Code:
    if waitUptext('Man', 400) then

    You can also use a string array for more accuracy with waitUpTextMulti:
    Simba Code:
    if waitUpTextMulti(['Man', 'an', 'Ma'], 400) then

    I found them here: https://github.com/J-Flight/AeroLib/...ore/Text.simba

    Anyway I hope this gets you on your way. You are welcome to Pm me with any questions, but try and look at a few tutorials first

  7. #7
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    It sucks that you haven't gotten any help, I am not familiar enough with AeroLib (the currently preferred color include for botting OSR) so I really can't help much overall.
    Tho, it sounds like you are on the right path, but with loads of more learning needed, because a fighter is not the simplest thing to start off with, but not to bad if you take it step by step and enjoy what you are doing.

    However I did pull up some older method I had from some thieving bot, made some minor adjustments. I think this will help you along, but it might not work at all if some updates has been made to RS, or if I fucked up when adjusting it (for aerolib).
    Simba Code:
    (*
      find all the points that contains any of the given colors.
      it returns all the points as a single array of TPoint (TPointArray).
    *)

    function FindColorsTolEx(var TPA:TPointArray; Colors:TIntegerArray; Bounds:TBox; Tol:Int32): Boolean;
    var
      i:Int32;
      TMP:TPointArray;
    begin
      for i:=0 to High(Colors) do
      begin
        FindColorsTolerance(TMP, Colors[i], Bounds.x1, Bounds.y1, Bounds.x2, Bounds.y2, Tol);
        TPA := CombineTPA(TPA,TMP);
      end;
      Result := Length(TPA) <> 0;
    end;

    (*
      Tries to find a man, and then move the mouse that man.
      If it's successful it will return "True".
    *)

    function MouseOverMan(): Boolean;  
    var
      TPA,TMP:TPointArray;
      ATPA:T2DPointArray;
      i,size:Int32;
      B:TBox;
    begin
      SetColorToleranceSpeed(2);
      FindColorsTolEx(TPA, [5588036,4741960], TBox([25,25,500,300]), 30);
      SetColorToleranceSpeed(1);

      ATPA := SplitTPA(TPA,5);
      SortATPAFromMidPoint(ATPA, Point(264,179));
      for i:=0 to High(ATPA) do
      begin
        B := GetTPABounds(ATPA[i]);
        size := Max(B.x2-B.x1+1, B.y2-B.y1+1);
        if not(InRange(size, 20, 50)) then
          Continue;
       
        MouseBox(B, MOUSE_MOVE);
        Wait(Random(60,130));
        if waitUptext('Man', 600) then
          Exit(True);
      end;
    end;

    Now what you do is to call it, if it returns True then cursor has been positioned over a man.

    Simba Code:
    begin
      //we repeat the following actions for all eternity (for now..)
      repeat
        if MouseOverMan() then   //if found a man, and is hovering him..:
          FastClick(mouse_Left); //attacked him by doing a single click.
         
        //now at this point you'd wanna check if you are still in a fight, and wait until its over
        //once it's over you have to look for a clue-scroll on the ground, this may get tricky, but
        //can be done with a similar function to "MouseOverMan", except only search a small area around you.
       
        //temporary i'll just add a 2-4 second Wait, and HOPE that you are done fighting, hehe :P
        Wait(Random(2000,4000));
       
      until False;
    end;

    Now this is untested, and modified without actually testing it afterwards, it looks alright.. so.. if it fail to compile then give us the error message ^.^

    Now I am aware that what I just displayed to you might be way beyond your current knowledge, and if so I recomend going through some turorials, just read them, and play around with writing short "stupid" pieces of code, learn what works and what doesn't. And what all these "keywords" in the language mean. Writing loops that does "stuff", eg counting to 1000.. and such.
    Last edited by slacky; 04-12-2016 at 09:10 AM.
    !No priv. messages please

  8. #8
    Join Date
    Aug 2012
    Posts
    31
    Mentioned
    1 Post(s)
    Quoted
    14 Post(s)

    Default

    so I know in order to click the middle of man I need to put a box of points around him, can someone show me how to do that? there is a tut on here but it looks outdated/pics aren't showing up for me

    @slacky, I just need to know what all to edit and where to put things...
    Last edited by HippestTrip; 04-13-2016 at 02:18 AM.

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
  •