Results 1 to 5 of 5

Thread: How to log timer.

  1. #1
    Join Date
    Jun 2015
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default How to log timer.

    Hi All,

    I apologise if this has been posted before. Tried searching but couldn't find anything I'm looking for.

    So I'm using MarkTime and TimeFromMark to log how efficient was each of my process doing.

    What I find was very unsightly and messy.

    Anyway to somewhat show the numbers behind the process

    example. Mining(time)
    Dropping(time)

  2. #2
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    What do you mean by "unsightly" and "messy"? You will be working with milliseconds with these timer functions, based on your current system time. You can use msToTime() to format ms values into neater values, but functions shouldn't be taking that long - working with ms is better.

    Failing that, @CynicRus made a timer/profiler for Lape here: https://villavu.com/forum/showthread.php?t=112752 - you could see if some of your PS functions work with this.

    Perhaps I do not understand your question. Care to elaborate on the results you are looking for?

  3. #3
    Join Date
    Jun 2015
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I apologise for my bad command of the english language. Do not really know how to express myself at times.

    First time creating a script so this is what I use for mining.

    Simba Code:
    Function MineTin:Boolean;
    Var
     X, Y, PlusOne, MinusOne, MineOreCounter, DropOreCounter, Timer, TinOre: Integer;

    begin
     TinOre := DTMFromString('mrAAAAHic42BgYOAGYiYGCOACYhEgFgdiASDmBGIeIOaA8oWBmB+I2YCYBaqnICODIdrTmKEk1omhLMGZIT0hgaE914ehsaICLM4KVIMPMxLAMAAAiLcJ1g==');
    repeat
     MinusOne:= InvCount - 1;
     MarkTime(Timer);
     If FindDTM(TinOre, X, Y, MIX1, MIY1, MIX2, MIY2) Then
     WriteLn('Found Tin Ore In Inventory');

    begin
     MMouse(X, Y, 10, 10);
     Wait(randomRange(50 + random(100), 200 + random(100)));
     If IsUpText('Tin ore') Then
     Mouse(X, Y, 0, 0, False);
     ChooseOption('Drop');
    end;
     MarkTime(DropOreCounter);
    repeat
     Wait(100);
    until (InvCount=MinusOne) Or (TimeFromMark(DropOreCounter) >1000)
     if InvCount=Minusone Then
     WriteLn('Dropped Tin Ore');
     WriteLn(TimeFromMark(Timer));
    until(not(FindDTM(TinOre, X, Y, MIX1, MIY1, MIX2, MIY2)));
    begin
     FreeDTM(TinOre);
    end;


    begin
     PlusOne:= InvCount + 1;
     MarkTime(Timer);
     If FindObjCustom(X, Y, ['Rocks'], [6776686, 5921377, 8947859, 8092806], 30) Then
     WriteLn('Found Tin Rock');
    begin
     GetMousePos(X, Y);
     Wait(randomRange(50, 100));
     If IsUpText('Rocks') Then
    begin
     Mouse(X, Y, 0, 0, True);
     WriteLn('Mining Tin Rock');
     WriteLn(TimeFromMark(Timer));
     Wait(randomRange(50, 100));
     MMouse(0, 0, 0, 500);
    end;
    end;
     MarkTime(MineOreCounter);
    repeat
     Wait(100);
    until (InvCount=PlusOne) Or (TimeFromMark(MineOreCounter) > 15000)
    if InvCount=Plusone Then
     WriteLn('Got 1 Tin Ore');
    end;
    end;

    Simba Code:
    Found Tin Ore In Inventory
    Dropped Tin Ore
    1528                        //I presume this is in ms
    Found Tin Rock
    Mining Tin Rock
    764

    So what I'm trying to achieve is this

    Dropped Tin Ore: 1528ms
    Mining Tin Rock: 764ms

    I've tried reading and understand the link you have posted but I'm afraid it's too advanced for me.

    I will give it a try never the less.

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

    Default

    So it looks like you have the times and just want them on the previous line?
    If so then just do
    Simba Code:
    writeLn('dropped ore: ', timeFromMark(timer));
    or
    Simba Code:
    write('dropped ore: ');
    writeLn(timeFromMark(timer));

  5. #5
    Join Date
    Sep 2010
    Location
    Finland
    Posts
    298
    Mentioned
    8 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by evilcitrus View Post
    So it looks like you have the times and just want them on the previous line?
    If so then just do
    Simba Code:
    writeLn('dropped ore: ', timeFromMark(timer));
    or
    Simba Code:
    write('dropped ore: ');
    writeLn(timeFromMark(timer));
    Or even a simpler version, to those that don't understand more advanced methods yet.
    Simba Code:
    writeln('dropped ore: ' + inttostr(timeFromMark(timer)));
    Rusting away

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
  •