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

Thread: Scripting my own Iron Miner 07

  1. #1
    Join Date
    Dec 2011
    Posts
    445
    Mentioned
    26 Post(s)
    Quoted
    256 Post(s)

    Default Scripting my own Iron Miner 07

    First, yes I know theres a powerminer already released, but I want to script my own, for practice.

    I've been watching YoHo's vids, but i've ran into the FindObjCustom part, and i'm not sure if I should use Danny's 07 Include P07_FindObj or FindObjCustom. I looked at P07_FindObj but it doesn't make any sense to me... My question is, do I use P07_FindObj or FindObjCustom for mining Iron Ore in 07.

    If P07_FindObj then please explain what the parameters should be, and why I should use it. And if you could provide an example, I learn allot from examples :P

  2. #2
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    P07_FindObj then, u got the include I guess?

    Parameters:
    try typing the function on the function list (left side of simba) and then double click it.
    or by typing it when scripting and then CTRL + LEFTCLICK.
    That shows the parameters u need

    The difference of the two functions are the uptexts. Since the uptext (font) in 07 is different than now.

    Creds to DannyRS for this wonderful sig!

  3. #3
    Join Date
    Dec 2011
    Posts
    445
    Mentioned
    26 Post(s)
    Quoted
    256 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    P07_FindObj then, u got the include I guess?

    Parameters:
    try typing the function on the function list (left side of simba) and then double click it.
    or by typing it when scripting and then CTRL + LEFTCLICK.
    That shows the parameters u need

    The difference of the two functions are the uptexts. Since the uptext (font) in 07 is different than now.
    So one does not work on the other.
    I thought it'd be something like that... My script would mess up when it tried to right click a rock. Does P07_FindObj move the mouse to the object?
    Also should I use ACA for the color? (Probably an obvious question..)
    Last edited by Twinki; 02-24-2013 at 07:55 AM.

  4. #4
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Twinki View Post
    I thought it'd be something like that... My script would mess up when it tried to right click a rock. Does P07_FindObj move the mouse to the object?
    It should do exactly the same as the FindObj on RS2.
    I don't know if the include is buggy or not.

    Creds to DannyRS for this wonderful sig!

  5. #5
    Join Date
    Dec 2011
    Posts
    445
    Mentioned
    26 Post(s)
    Quoted
    256 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    It should do exactly the same as the FindObj on RS2.
    I don't know if the include is buggy or not.
    Should I use ACA with P07_FindObj?

    and should I put "Rocks" in with the uptext?

    I also seem to be getting Cannot find Object..
    Last edited by Twinki; 02-24-2013 at 08:12 AM.

  6. #6
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Twinki View Post
    Should I use ACA with P07_FindObj?

    and should I put "Rocks" in with the uptext?

    I also seem to be getting Cannot find Object..
    yeah ACA is the best tool for colorpicking tool !! Of course use it.
    Watch Yohojo's video on how to maximize the potential of ACA.

    Maybe uptext buggy (I don't know if the include is properly made)
    Try using visible words and 3 letters ex: 'Roc', 'ock'

    Creds to DannyRS for this wonderful sig!

  7. #7
    Join Date
    Dec 2011
    Posts
    445
    Mentioned
    26 Post(s)
    Quoted
    256 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    yeah ACA is the best tool for colorpicking tool !! Of course use it.
    Watch Yohojo's video on how to maximize the potential of ACA.

    Maybe uptext buggy (I don't know if the include is properly made)
    Try using visible words and 3 letters ex: 'Roc', 'ock'
    Well P07_FindObj doesn't move the mouse, it only looks for the object.
    This is a noob question but how do I make it move the mouse to the object and store the info into variables

  8. #8
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Simba Code:
    procedure example;
    var     // local variables
      x, y:integer;

    begin
      if P07_FindObj(x,y, dont know the other parameters) then   // now the stuff we found is stored in x, y
      begin
        Writeln('Hooray found it')  // just a debug line to see if we found the object
        MMouse(x,y, rx, ry)   // moves mouse to the x, y coords. rx and ry and the random off-coords.
        Clickmouse2(mouse_left)   // mouse_right for right of course
      end else Writeln(' Did not find it') // something went wrong with our color or maybe uptext

    Creds to DannyRS for this wonderful sig!

  9. #9
    Join Date
    Dec 2011
    Posts
    445
    Mentioned
    26 Post(s)
    Quoted
    256 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    Simba Code:
    procedure example;
    var     // local variables
      x, y:integer;

    begin
      if P07_FindObj(x,y, dont know the other parameters) then   // now the stuff we found is stored in x, y
      begin
        Writeln('Hooray found it')  // just a debug line to see if we found the object
        MMouse(x,y, rx, ry)   // moves mouse to the x, y coords. rx and ry and the random off-coords.
        Clickmouse2(mouse_left)   // mouse_right for right of course
      end else Writeln(' Did not find it') // something went wrong with our color or maybe uptext
    Tried that but I get an error when compiling

    Invalid number of parameters at line 139
    Compiling failed.

    If P07_FindObj(x, y, RockColor, 10, 15, ['Mi', 'Min', 'Mine'], 3) then

  10. #10
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Twinki View Post
    Tried that but I get an error when compiling

    Invalid number of parameters at line 139
    Compiling failed.

    If P07_FindObj(x, y, RockColor, 10, 15, ['Mi', 'Min', 'Mine'], 3) then
    Ok let me take a look in that include.

    EDIT:
    function P07_FindObj(color, tol, count : integer; uptext : TStringArray; action : integer): Boolean;

    The function clicks normally

    If it doesn't work use findcolortolerance and combined with P07_IsUpTextMultiCustom(Text: TStringArray): Boolean;

    U got the include from http://villavu.com/forum/showthread.php?t=96863 right?
    to be sure.

    And just check the include out, what u can use etc..

    Creds to DannyRS for this wonderful sig!

  11. #11
    Join Date
    Dec 2011
    Posts
    445
    Mentioned
    26 Post(s)
    Quoted
    256 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    Ok let me take a look in that include.

    EDIT:
    function P07_FindObj(color, tol, count : integer; uptext : TStringArray; action : integer): Boolean;

    The function clicks normally

    If it doesn't work use findcolortolerance and combined with P07_IsUpTextMultiCustom(Text: TStringArray): Boolean;

    U got the include from http://villavu.com/forum/showthread.php?t=96863 right?
    to be sure.

    And just check the include out, what u can use etc..
    Mine doesn't click or move the mouse, it justs finds the object....


    Riiiiiggghhht.....
    Lets see if I can figure out where to put those..

    and mine doesn't click or move the mouse, it justs finds the object

    and yes.
    Last edited by Twinki; 02-24-2013 at 10:03 AM.

  12. #12
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by Twinki View Post
    Riiiiiggghhht.....
    Lets see if I can figure out where to put those..

    and yes.
    I would look into making your own object finder ^^ using something written by someone else for that is a bad idea, because objects are always different, and need to be sorted correctly based on what they are, size and etc, read some tutorials


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  13. #13
    Join Date
    Dec 2011
    Posts
    445
    Mentioned
    26 Post(s)
    Quoted
    256 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    I would look into making your own object finder ^^ using something written by someone else for that is a bad idea, because objects are always different, and need to be sorted correctly based on what they are, size and etc, read some tutorials
    Well I think I got it to where it would move the mouse over and click correctly ETC... The only problem i'm having now is that when i start it, it'll hover over the objects but then it just stops, doesn't click or anything. It basically doesn't do anything after the 'then'
    Simba Code:
    Function MineIron:Boolean;
    Var
      x, y, PlusOneOre, OreCounter: Integer;
    Begin
      PlusOneOre:= InvCount +1;
      x:=MSCX;
      y:=MSCY;
      If FindObjCustom(x, y, ['Min', 'Mine'], [RockColor], 5) then
      Begin
      WriteLn('Found Iron Rock');
      GetMousePos(x, y);

        Case Random (2) Of
          0: Mouse(x, y, 0, 1, True);
          1:Begin
              Mouse(x, y, 0, 1, False);
              Wait(RandomRange(400, 1000));
              P07_ChooseOptionMulti(['Mine']);
              End;
          End;

          Repeat
          MarkTime(OreCounter);
          Antiban;
          Wait(1000);
          If InvCount=PlusOneOre Then
            WriteLn('Collected one Ore');
        Until (InvCount=PlusOneOre) Or (TimeFromMark(OreCounter) > 7000)


      End;
    End

    It doesn't write 'Found Iron Rock'

  14. #14
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    I'm guessing this is for 07scape? That function is for main RS and wont work there


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  15. #15
    Join Date
    Dec 2011
    Posts
    445
    Mentioned
    26 Post(s)
    Quoted
    256 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    I'm guessing this is for 07scape? That function is for main RS and wont work there
    I had it working earlier.. it'd click the rock and everything.The FindObj works, but then it all messed up and it wouldn't click the Mine option when right clicked.. Will P07_ChooseOptionMulti(['Mine']); work for the option?

    and yes it is.

  16. #16
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by Twinki View Post
    I had it working earlier.. it'd click the rock and everything.The FindObj works, but then it all messed up and it wouldn't click the Mine option when right clicked.. Will P07_ChooseOptionMulti(['Mine']); work for the option?

    and yes it is.
    That should work for the right click yes, its because the Uptext is completely different in normal RS compared to 07


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  17. #17
    Join Date
    Dec 2011
    Posts
    445
    Mentioned
    26 Post(s)
    Quoted
    256 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    That should work for the right click yes, its because the Uptext is completely different in normal RS compared to 07
    The script still stops right after it hovers over the objects :c
    It doesn't write "Found Iron Rock", like it doesn't do then.

  18. #18
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by Twinki View Post
    The script still stops right after it hovers over the objects :c
    It doesn't write "Found Iron Rock", like it doesn't do then.
    Like I said before, findobj, wont work in 07, you'll have to learn how to do it yourself ,

    ClickMouse2(mouse_right);

    Will make the script right click


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  19. #19
    Join Date
    Dec 2011
    Posts
    445
    Mentioned
    26 Post(s)
    Quoted
    256 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    Like I said before, findobj, wont work in 07, you'll have to learn how to do it yourself ,

    ClickMouse2(mouse_right);

    Will make the script right click
    I see that you updated your includes and added FindObjCustom(Thank you BTW ), I changed it to that and now the script just starts and stops.. doesn't do anything. But when I change the client just too Simba it starts...

  20. #20
    Join Date
    Dec 2011
    Posts
    170
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by Twinki View Post
    I see that you updated your includes and added FindObjCustom(Thank you BTW ), I changed it to that and now the script just starts and stops.. doesn't do anything. But when I change the client just too Simba it starts...
    http://docs.villavu.com/srl-5/srlref.html
    http://docs.villavu.com/simba/refere...html#scriptref

    These 2 links have been very, very helpful for me when learning.
    You should get an idea for most things, the documentation is pretty bad but it helps.

    Also always take a look at the includes themselves.

  21. #21
    Join Date
    Dec 2011
    Posts
    445
    Mentioned
    26 Post(s)
    Quoted
    256 Post(s)

    Default

    Quote Originally Posted by shebee View Post
    http://docs.villavu.com/srl-5/srlref.html
    http://docs.villavu.com/simba/refere...html#scriptref

    These 2 links have been very, very helpful for me when learning.
    You should get an idea for most things, the documentation is pretty bad but it helps.

    Also always take a look at the includes themselves.
    Thanks for the advice


    EDIT: Its doing the same thing as before... It doesn't say it can't find the color, it doesn't do the 'then'. If that makes sense. It just stops after it finds the object.
    Simba Code:
    Function MineIron:Boolean;
    Var
      x, y, PlusOneOre, OreCounter: Integer;
    Begin
      PlusOneOre:= P07_InvCount +1;
      x:=MSCX;
      y:=MSCY;
      If P07_FindObjCustom(x, y, ['Mine', 'Rocks', 'Min', 'Rock'], [RockColor], 5) Then
        Begin
          WriteLn('Found Iron Rock');
          GetMousePos(x, y);

          Case Random (2) Of
            0: Mouse(x, y, 0, 1, True);
            1: Begin
                Mouse(x, y, 0, 1, False);
                Wait(RandomRange(400, 1000));
                P07_ChooseOptionMulti(['Mine', 'Min', 'Rock', 'Rocks']);
                End;
            End;

          Repeat
          MarkTime(OreCounter);
          Antiban;
          Wait(1000);
          If P07_InvCount=PlusOneOre Then
          WriteLn('Collected one Ore');
        Until (P07_InvCount=PlusOneOre) Or (TimeFromMark(OreCounter) > 7000)
      End;

    End;
    Last edited by Twinki; 02-24-2013 at 07:56 PM.

  22. #22
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Twinki View Post
    Thanks for the advice


    EDIT: Its doing the same thing as before... It doesn't say it can't find the color, it doesn't do the 'then'. If that makes sense. It just stops after it finds the object.
    Simba Code:
    Function MineIron:Boolean;
    Var
      x, y, PlusOneOre, OreCounter: Integer;
    Begin
      PlusOneOre:= P07_InvCount +1;
      x:=MSCX;
      y:=MSCY;
      If P07_FindObjCustom(x, y, ['Mine', 'Rocks', 'Min', 'Rock'], [RockColor], 5) Then
        Begin
          WriteLn('Found Iron Rock');
          GetMousePos(x, y);

          Case Random (2) Of
            0: Mouse(x, y, 0, 1, True);
            1: Begin
                Mouse(x, y, 0, 1, False);
                Wait(RandomRange(400, 1000));
                P07_ChooseOptionMulti(['Mine', 'Min', 'Rock', 'Rocks']);
                End;
            End;

          Repeat
          MarkTime(OreCounter);
          Antiban;
          Wait(1000);
          If P07_InvCount=PlusOneOre Then
          WriteLn('Collected one Ore');
        Until (P07_InvCount=PlusOneOre) Or (TimeFromMark(OreCounter) > 7000)
      End;

    End;
    See if the uptexts works.
    Press play, hover mouse above the rock check debug.

    Simba Code:
    begin    // mainloop
      Wait(3000)
      Writeln(P07_GetUpText) // I think this is the right name?
    end.

    Check if your debug actually gets the uptext .

    Creds to DannyRS for this wonderful sig!

  23. #23
    Join Date
    Dec 2011
    Posts
    445
    Mentioned
    26 Post(s)
    Quoted
    256 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    See if the uptexts works.
    Press play, hover mouse above the rock check debug.

    Simba Code:
    begin    // mainloop
      Wait(3000)
      Writeln(P07_GetUpText) // I think this is the right name?
    end.

    Check if your debug actually gets the uptext .
    It does get the UpText perfectly.

  24. #24
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Twinki View Post
    It does get the UpText perfectly.
    Maybe your rockcolor then ? Up the tolerance a bit with +2 at a time.
    Or get new colors.

    and remove x := MSCX , y := MSCY .
    That's fault coding.

    Creds to DannyRS for this wonderful sig!

  25. #25
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by Twinki View Post
    It does get the UpText perfectly.
    I double checked everything and it works fine for me, try a larger object, it may be a flaw with the speed of the include on smaller objects, I will attempt to rememdy on next update,

    use ClickMouse2(mouse_left); not that older way
    Last edited by DannyRS; 02-24-2013 at 08:53 PM.


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

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
  •