Yoko
http://forum.yoko.com.ua/

Script Request: "timer" to warn you can drink another potion
http://forum.yoko.com.ua/viewtopic.php?f=1&t=16748
Page 1 of 1

Author:  theuoplayerbr [ 2011-08-29 21:53:42 ]
Post subject:  Script Request: "timer" to warn you can drink another potion

Hey folks, i play at a shard that shows messages informing the seconds remaining to drink another potion.

Example:

The potions delay are 15s. When you drink the potion "A" until you get the 15 seconds the shards shows messagens like "14" / "13" when you try do drink another potion.

I want a scrip that starts a "timer" when i drink the potion and wait 15 seconds to print a message like "you can drink another potion". But if i try do drink another potion before the 15s has gone, the timer should restart with the remaining seconds, not get another 15s timer.

I dont know if i could make myself clear.

Thanks.

Author:  ZeroDX [ 2011-08-29 23:51:05 ]
Post subject:  Re: Script Request: "timer" to warn you can drink another po

Code:
sub DrinkPotion()
var Time, t_Potion = '0x1234', c_Potion = '0x1234' ; type and color
  If UO.GetGlobal('PotionTimer') == 'NotReady'
    Return
   else
    UO.UseType(t_Potion, c_Potion)
    Time = UO.Timer()
    UO.SetGlobal('PotionTimer', 'NotReady')
    Repeat
      Wait(100)
    Until Time + 150 <= UO.Timer()
    UO.SetGlobal('PotionTimer', 'Ready')
    UO.Print('Messageeeeeeeeeeeeeeeee') ;  your message here
  Endif
Endsub

Author:  Mirage [ 2011-08-30 08:01:33 ]
Post subject:  Re: Script Request: "timer" to warn you can drink another po

Code:
sub DrinkPotion()
var Time, t_Potion = '0x1234', c_Potion = '0x1234' ; type and color
  If UO.GetGlobal('PotionTimer') == 'NotReady'
    UO.Print('Wait bla bla bla')  ;  <=== для наглядности.
    Return
   else
    UO.UseType(t_Potion, c_Potion)
    Time = UO.Timer()
    UO.SetGlobal('PotionTimer', 'NotReady')
    Repeat
      Wait(100)
    Until Time + 150 <= UO.Timer()
    UO.SetGlobal('PotionTimer', 'Ready')
    UO.Print('Messageeeeeeeeeeeeeeeee') ;  your message here
  Endif
Endsub

Кажется мне что он сейчас попросит чтобы таймер отображался в сообщениях. :roll:

Author:  ZeroDX [ 2011-08-30 08:57:06 ]
Post subject:  Re: Script Request: "timer" to warn you can drink another po

Проще засунуть туда юз пота, чтобы выводил ещё в секундах

Author:  theuoplayerbr [ 2011-09-05 22:00:11 ]
Post subject:  Re: Script Request: "timer" to warn you can drink another po

Quote:
UO.Print('Wait bla bla bla') ; <=== для наглядности.


Injection warning a error in the line... what is it?

Author:  Mirage [ 2011-09-06 06:47:27 ]
Post subject:  Re: Script Request: "timer" to warn you can drink another po

Code:
sub DrinkPotion()
var Time, t_Potion = '0x1234', c_Potion = '0x1234' ; type and color
  If UO.GetGlobal('PotionTimer') == 'NotReady' then   ; <=
    UO.Print('Wait bla bla bla')
    Return
   else
    UO.UseType(t_Potion, c_Potion)
    Time = UO.Timer()
    UO.SetGlobal('PotionTimer', 'NotReady')
    Repeat
      Wait(100)
    Until Time + 150 <= UO.Timer()
    UO.SetGlobal('PotionTimer', 'Ready')
    UO.Print('Messageeeeeeeeeeeeeeeee') ;  your message here
  Endif
Endsub


We forgot about THEN :mrgreen:

Author:  ZeroDX [ 2011-09-06 15:31:29 ]
Post subject:  Re: Script Request: "timer" to warn you can drink another po

Бывает =)

Page 1 of 1 All times are UTC+02:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/