Results 1 to 17 of 17

Thread: Need help perfecting my script

  1. #1
    Join Date
    Mar 2013
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default Need help perfecting my script

    I have developed a really good script that earns around 40k xp an hour in a no random zone, but every now and then, it just doesn't click until I disable then enable SMART.
    Also, When my character gains a level it stops, and doesn't realise it has stopped training.
    Is there anyway for my script to detect if it hasn't gained xp for a minute or so, or if it hasn't gained an item in a minute or so?
    If not any suggestions as to what I could do?
    I don't want to release any more information about my script yet until it is working Perfect.
    Will also want to restrict how many people can use it, if your suggestions makes that finishing touch then you can have a copy!
    Thanks for any help.


    EDIT:so far it is dealt with by being logged out for inactivity then logging itself back in, but I think it is a big red flag if it gets forced out every time it levels up.

  2. #2
    Join Date
    Mar 2013
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    You could try making it check the slots of your inventory for items, and then if it doesn't detect anything, it could re-run the procedures.

  3. #3
    Join Date
    Mar 2013
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Syden View Post
    You could try making it check the slots of your inventory for items, and then if it doesn't detect anything, it could re-run the procedures.
    It may for example obtain 18 items, and then stop. Is there a way to check if the number of empty slots has changed in the last minute?

  4. #4
    Join Date
    Mar 2013
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    You can make it check certain slots, 1-28. So if you had 18 slots filled, you could make it check from 18 on and decide whether or not there are items existing in those slots, and if there arent, re run the procedure. I think theres a few different functions that will check Slots or check remaining slots not filled. (I don't know them)

  5. #5
    Join Date
    Jul 2012
    Posts
    437
    Mentioned
    10 Post(s)
    Quoted
    165 Post(s)

    Default

    im not too familar with the 07 includes here's an example for number of empty spaces in EOC


    Quote Originally Posted by tehq View Post
    Simba Code:
    program Count;
    {$DEFINE SMART}
    {$i SRL/srl.simba}

    Function InventoryFree: integer;
    begin
      Result := (28 - InvCount);
      Writeln(Result);
    end;

    begin
      TypeSend(IntToStr(InventoryFree));
    end.

  6. #6
    Join Date
    Mar 2013
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    The thing is if the last few slots are empty, it could just be they haven't filled yet, or it could be that it has stopped completely.
    I noticed when I was using a woodcutting script it had a ChopWaitTime to check if it was chopping. Is it possible to have something like this for all skills?

  7. #7
    Join Date
    Mar 2013
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    I believe that's just a procedure that tells it to wait a certain amount of time before trying to chop again; not actually checking if the player is chopping although it's assuming the player is chopping because it was told so. (if Chop = true; then ChopWaitTime) Or something along those lines.

    I could be wrong though, try looking through the functions, there may be one.

  8. #8
    Join Date
    Mar 2013
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Syden View Post
    I believe that's just a procedure that tells it to wait a certain amount of time before trying to chop again; not actually checking if the player is chopping although it's assuming the player is chopping because it was told so. (if Chop = true; then ChopWaitTime) Or something along those lines.

    I could be wrong though, try looking through the functions, there may be one.
    Do you think I could get it to do an invent count every minute, and if invent count is not > than previous invent count, make it click again?

  9. #9
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Simba Code:
    procedure a;
      i, CutTimer : Integer;
    begin
      i := InvCount; // Stores how many items you have in your inventory in 'i'
      MarkTime(CutTimer);  // Marks a timer
      if TimeFromMark(CutTimer) > 60000 then  // Checks if the timer has been running for over a minute
        if i = InvCount then  // Checks if your inventory count is still the same as it was a minute ago
          Writeln('Has been a minute and nothing has been added to the inventory.');
    end;

    I think you want something like that anyway. This is written with SRL-OSR and not P07Include though, not sure which you are using. Just make sure you MarkTime every time you get a log or whatever so it doesn't have to run through that.

  10. #10
    Join Date
    Mar 2013
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Total View Post
    Simba Code:
    procedure a;
      i, CutTimer : Integer;
    begin
      i := InvCount; // Stores how many items you have in your inventory in 'i'
      MarkTime(CutTimer);  // Marks a timer
      if TimeFromMark(CutTimer) > 60000 then  // Checks if the timer has been running for over a minute
        if i = InvCount then  // Checks if your inventory count is still the same as it was a minute ago
          Writeln('Has been a minute and nothing has been added to the inventory.');
    end;

    I think you want something like that anyway. This is written with SRL-OSR and not P07Include though, not sure which you are using. Just make sure you MarkTime every time you get a log or whatever so it doesn't have to run through that.

    Ah this is exactly what I'm looking for but I'm using the P07 include. Would it take much work to convert it?

  11. #11
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    You should be able to just use P07_InvCount instead of InvCount for P07Include, so just change those and you should be good to go.

  12. #12
    Join Date
    Mar 2013
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Total View Post
    You should be able to just use P07_InvCount instead of InvCount for P07Include, so just change those and you should be good to go.
    Ah good, got that script working. Is there a way to get it to start that procedure every minute? If i set it to start when cutting, it could cut a few more logs, then stop. The procedure will check and see that the inventory has increased so won't do anything, and my character will still stand there. Or how would I make it start the procedure every time it gets a new log?

  13. #13
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    If your inventory is open at all times you could just do something like this

    Simba Code:
    if i < P07_InvCount then
    begin
      Writeln('Gained an item in inventory, resetting timer and inventory count');
      MarkTime(CutTimer);
      i := P07_InvCount;
    end;

  14. #14
    Join Date
    Mar 2013
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Total View Post
    If your inventory is open at all times you could just do something like this

    Simba Code:
    if i < P07_InvCount then
    begin
      Writeln('Gained an item in inventory, resetting timer and inventory count');
      MarkTime(CutTimer);
      i := P07_InvCount;
    end;

    Ok so I've made a procedure:

    procedure CheckInvent;
    begin;
    i := P07_InvCount; // Stores how many items you have in your inventory in 'i'
    MarkTime(CutTimer); // Marks a timer
    if TimeFromMark(CutTimer) > 60000 then // Checks if the timer has been running for over a minute
    if i = P07_InvCount then // Checks if your inventory count is still the same as it was a minute ago
    CutTree;
    if not i = P07_InvCount then
    begin;
    MarkTime(CutTimer);
    i := P07_InvCount;
    end;
    end;


    (cuttree is another procedure)

    From what I understand this will make a timer, after 60 seconds it will check the invent and compare it to i
    If it is the same as i, it will cut another tree.
    If it is not the same as i, it will reset the timer do it again.

    Do i just put the procedure at the start of my process list and it will loop endlessly?

  15. #15
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    You should implement the basic idea into your CutTree procedure instead of creating a new procedure for it because if you do it that way every time its called its going to remark the timer and it will never hit 1 minute.

  16. #16
    Join Date
    Mar 2013
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Total View Post
    You should implement the basic idea into your CutTree procedure instead of creating a new procedure for it because if you do it that way every time its called its going to remark the timer and it will never hit 1 minute.

    Any suggestions as to where I'm going wrong here?

    procedure CutTree;
    begin;
    if P07_FindObj(x, y, 'own', 6723505, 5) then
    begin
    ClickMouse2(mouse_left);
    begin;
    i := P07_InvCount; // Stores how many items you have in your inventory in 'i'
    MarkTime(CutTimer); // Marks a timer
    if TimeFromMark(CutTimer) > 60000 then // Checks if the timer has been running for over a minute
    if i = P07_InvCount then // Checks if your inventory count is still the same as it was a minute ago
    ClickMouse2(mouse_left);
    if not i = P07_InvCount then
    begin;
    MarkTime(CutTimer);
    i := P07_InvCount;
    end;
    end;

    repeat
    Wait(RandomRange(3000, 8000));
    until not P07_IsUpTextMultiCustom(['Teak']) or(P07_InvFull);

    end;
    end;

  17. #17
    Join Date
    Mar 2012
    Location
    Over there
    Posts
    840
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by includer100 View Post
    Any suggestions as to where I'm going wrong here?

    procedure CutTree;
    begin;
    if P07_FindObj(x, y, 'own', 6723505, 5) then
    begin
    ClickMouse2(mouse_left);
    begin;
    i := P07_InvCount; // Stores how many items you have in your inventory in 'i'
    MarkTime(CutTimer); // Marks a timer
    if TimeFromMark(CutTimer) > 60000 then // Checks if the timer has been running for over a minute
    if i = P07_InvCount then // Checks if your inventory count is still the same as it was a minute ago
    ClickMouse2(mouse_left);
    if not i = P07_InvCount then
    begin;
    MarkTime(CutTimer);
    i := P07_InvCount;
    end;
    end;

    repeat
    Wait(RandomRange(3000, 8000));
    until not P07_IsUpTextMultiCustom(['Teak']) or(P07_InvFull);

    end;
    end;

    Simba Code:
    procedure CutTree;
    begin;
      MarkTime(CutTimer);
      i := P07_InvCount;
      repeat
        if P07_FindObj(x, y, 'own', 6723505, 5) then
          ClickMouse2(mouse_left);
        if TimeFromMark(CutTimer) > 60000 then
          if i = P07_InvCount then
            if P07_IsUpTextMultiCustom(['Teak']) then
              ClickMouse2(mouse_left);
        if not i = P07_InvCount then
        begin;
          MarkTime(CutTimer);
          i := P07_InvCount;
        end;

        repeat
          Wait(RandomRange(3000, 8000));
        until not P07_IsUpTextMultiCustom(['Teak']) or(P07_InvFull);
        end;
      until P07_InvFull;
    end;

    Thats how I would do it.
    Last edited by Total; 03-26-2013 at 10:38 PM.

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
  •