XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 9 of 9

Thread: When stay X playsound?

  1. #1
    Elizabeth's Avatar
    Join Date
    Mar 2016
    Location
    Poland
    Posts
    72
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb When stay X playsound?

    I need script .lua when my character stay 60 second my client play alarm.
    This is possible?

  2. #2
    Senior Member Trykon's Avatar
    Join Date
    Nov 2014
    Location
    UK
    Posts
    952
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    It is possible:

    local seconds = 0
    local pos = Self.Position()

    while true then
    if Self.Position().x == pos.x and Self.Position().y == pos.y then
    seconds = seconds + 1
    if seconds >= 60 then
    alert()
    end
    else
    seconds = 0
    pos = Self.Position()
    end
    end

    This is not tested and written on the phone so you might want to check it before you run it
    All my full afk scripts are accessible at:
    My thread
    My store
    My project
    Looking for RL Tibia testers - RP and EK scripts for FREE. Link to info.

  3. #3
    Elizabeth's Avatar
    Join Date
    Mar 2016
    Location
    Poland
    Posts
    72
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Trykon View Post
    It is possible:

    local seconds = 0
    local pos = Self.Position()

    while true then
    if Self.Position().x == pos.x and Self.Position().y == pos.y then
    seconds = seconds + 1
    if seconds >= 60 then
    alert()
    end
    else
    seconds = 0
    pos = Self.Position()
    end
    end

    This is not tested and written on the phone so you might want to check it before you run it
    Line #: 4
    Error: 'do' expected near 'then'

    Not work my friend

  4. #4
    Senior Member Trykon's Avatar
    Join Date
    Nov 2014
    Location
    UK
    Posts
    952
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    local seconds = 0
    local pos = Self.Position()

    while true do
    if Self.Position().x == pos.x and Self.Position().y == pos.y then
    seconds = seconds + 1
    if seconds >= 60 then
    alert()
    end
    else
    seconds = 0
    pos = Self.Position()
    end
    end

    @Elizabeth
    All my full afk scripts are accessible at:
    My thread
    My store
    My project
    Looking for RL Tibia testers - RP and EK scripts for FREE. Link to info.

  5. #5
    Elizabeth's Avatar
    Join Date
    Mar 2016
    Location
    Poland
    Posts
    72
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Trykon View Post
    local seconds = 0
    local pos = Self.Position()

    while true do
    if Self.Position().x == pos.x and Self.Position().y == pos.y then
    seconds = seconds + 1
    if seconds >= 60 then
    alert()
    end
    else
    seconds = 0
    pos = Self.Position()
    end
    end

    @Elizabeth
    Hey, I totaly forgot about this thread Today i check this, but still don't work
    When I add this script alarm play non stop, immediately after switching on.

  6. #6
    Senior Member Trykon's Avatar
    Join Date
    Nov 2014
    Location
    UK
    Posts
    952
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Elizabeth View Post
    Hey, I totaly forgot about this thread Today i check this, but still don't work
    When I add this script alarm play non stop, immediately after switching on.
    If I were you I wouldn't copy my code any time... As most of the time I reply from phone so my code may have typos and so on... I would carefully rewrite it.
    Also I have never tested it and actually never tried to write something like this, so this is just rough try.
    At the moment I don't see any problem with it.
    To be honest I also forgot about this
    All my full afk scripts are accessible at:
    My thread
    My store
    My project
    Looking for RL Tibia testers - RP and EK scripts for FREE. Link to info.

  7. #7

    Join Date
    Apr 2017
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    local seconds 0
    local pos 
    Self.Position()

    while 
    true do
    if 
    Self.Position().== pos.and Self.Position().== pos.y then
    seconds 
    seconds 1
    sleep
    (1000)
    if 
    seconds >= 60 then
    alert
    ()
    end
    else
    seconds 0
    pos 
    Self.Position()
    end
    end 


    this should work sleep function was missing :P

  8. #8
    Senior Member Trykon's Avatar
    Join Date
    Nov 2014
    Location
    UK
    Posts
    952
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by big View Post
    PHP Code:
    local seconds 0
    local pos 
    Self.Position()

    while 
    true do
    if 
    Self.Position().== pos.and Self.Position().== pos.y then
    seconds 
    seconds 1
    sleep
    (1000)
    if 
    seconds >= 60 then
    alert
    ()
    end
    else
    seconds 0
    pos 
    Self.Position()
    end
    end 


    this should work sleep function was missing :P
    it might be the case
    All my full afk scripts are accessible at:
    My thread
    My store
    My project
    Looking for RL Tibia testers - RP and EK scripts for FREE. Link to info.

  9. #9
    Elizabeth's Avatar
    Join Date
    Mar 2016
    Location
    Poland
    Posts
    72
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by big View Post
    PHP Code:
    local seconds 0
    local pos 
    Self.Position()

    while 
    true do
    if 
    Self.Position().== pos.and Self.Position().== pos.y then
    seconds 
    seconds 1
    sleep
    (1000)
    if 
    seconds >= 60 then
    alert
    ()
    end
    else
    seconds 0
    pos 
    Self.Position()
    end
    end 


    this should work sleep function was missing :P
    Yes, now it work! 1 year later, but still needed, thank U Biggy!

Posting Permissions

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