Signup Now
Results 1 to 8 of 8
  1. #1
    Free User Architect's Avatar
    Join Date
    Feb 2017
    Posts
    36
    Reputation
    10
    Rep Power
    0

    message .time is not returning what it suppose to return?

    1. What OS you are at? Windows 7 64 bits

    2. Real PC or VPS? Real

    3. Using WindAddons? Which version? beta 20

    4. Which version of WindBot? beta 51

    5. Which version of Game Client? 11.10.4527

    6. Do you have a Dedicated Graphics Card? Yes

    7. Detailed description of the problem.

    Looks like .time from message is not returning what it suppose to return.
    In this example the time in my computer was 22:40, the message time was 22:39 and .time should return between 0 and 60 right?

    8. If applicable, a GIF of the action hosted on imgur.com.

    9. Do this happen in WindBot for Client Version 10.x too? I don't know. I don't use it anymore.

    10. Debug Log.

    Code:
    {level = 0, content = "A mutated rat loses 145 hitpoints due to your attack.", sender = "", type = 19}
    .time = 1487986795
    .timestr = 22:39
    11. Comments.

  2. #2
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,821
    Reputation
    220
    Rep Power
    26
    Quote Originally Posted by Architect View Post
    1. What OS you are at? Windows 7 64 bits

    2. Real PC or VPS? Real

    3. Using WindAddons? Which version? beta 20

    4. Which version of WindBot? beta 51

    5. Which version of Game Client? 11.10.4527

    6. Do you have a Dedicated Graphics Card? Yes

    7. Detailed description of the problem.

    Looks like .time from message is not returning what it suppose to return.
    In this example the time in my computer was 22:40, the message time was 22:39 and .time should return between 0 and 60 right?

    8. If applicable, a GIF of the action hosted on imgur.com.

    9. Do this happen in WindBot for Client Version 10.x too? I don't know. I don't use it anymore.

    10. Debug Log.

    Code:
    {level = 0, content = "A mutated rat loses 145 hitpoints due to your attack.", sender = "", type = 19}
    .time = 1487986795
    .timestr = 22:39
    11. Comments.
    It's working as it should, it will return current time in milliseconds.

  3. #3
    Free User Architect's Avatar
    Join Date
    Feb 2017
    Posts
    36
    Reputation
    10
    Rep Power
    0
    @mistgun Do you know the variable to get the current time? The only thing I could find in the docs is $timems that returns the time since bot starts. I compared its value with .time and .time is much more bigger than $timems.

  4. #4
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,821
    Reputation
    220
    Rep Power
    26
    It's because $timems as you said returns millis since bot start, .time on the other hand returns your os time.
    You can basically do this:

    local timePassed = os.time() - m.time -- where m.time is time when message was send



    to check how many seconds passed since message was send.
    Last edited by mistgun; 02-25-2017 at 03:39 PM. Reason: grammar nazi

  5. #5
    Free User Architect's Avatar
    Join Date
    Feb 2017
    Posts
    36
    Reputation
    10
    Rep Power
    0
    @mistgun thanks for make things clear! Rep++ you!

    Still someone needs to fix the docs. In the doc its write that .time retruns time in seconds not in miliseconds. I'm a programmer and I know how boring is to fillup documentation!? Sorry about that! xD

    Att. Architect

  6. #6
    Wind Tester
    Join Date
    Dec 2013
    Location
    Warsaw, Poland
    Posts
    2,579
    Reputation
    149
    Rep Power
    27
    Quote Originally Posted by Architect View Post
    @mistgun thanks for make things clear! Rep++ you!

    Still someone needs to fix the docs. In the doc its write that .time retruns time in seconds not in miliseconds. I'm a programmer and I know how boring is to fillup documentation!? Sorry about that! xD

    Att. Architect
    You can fix it yourself.
    https://github.com/Tibia-WindBot/WindBot-Docs

  7. #7
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,441
    Reputation
    309
    Rep Power
    28
    Quote Originally Posted by Architect View Post
    @mistgun thanks for make things clear! Rep++ you!

    Still someone needs to fix the docs. In the doc its write that .time retruns time in seconds not in miliseconds. I'm a programmer and I know how boring is to fillup documentation!? Sorry about that! xD

    Att. Architect
    I'm sorry. What @Imba meant to say is that you're free to contribute with a fix yourself if you find the time to. Otherwise, we'll get to it as soon as we can.

  8. #8
    Wind Tester
    Join Date
    Dec 2013
    Location
    Warsaw, Poland
    Posts
    2,579
    Reputation
    149
    Rep Power
    27
    Yes, thats exactly what i meant to say

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •