Page 1 of 1
Script Request: "timer" to warn you can drink another potion
Posted: 2011-08-29 21:53:42
by theuoplayerbr
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.
Re: Script Request: "timer" to warn you can drink another po
Posted: 2011-08-29 23:51:05
by ZeroDX
Code: Select all
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
Re: Script Request: "timer" to warn you can drink another po
Posted: 2011-08-30 08:01:33
by Mirage
Code: Select all
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
Кажется мне что он сейчас попросит чтобы таймер отображался в сообщениях.

Re: Script Request: "timer" to warn you can drink another po
Posted: 2011-08-30 08:57:06
by ZeroDX
Проще засунуть туда юз пота, чтобы выводил ещё в секундах
Re: Script Request: "timer" to warn you can drink another po
Posted: 2011-09-05 22:00:11
by theuoplayerbr
UO.Print('Wait bla bla bla') ; <=== для наглядности.
Injection warning a error in the line... what is it?
Re: Script Request: "timer" to warn you can drink another po
Posted: 2011-09-06 06:47:27
by Mirage
Code: Select all
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

Re: Script Request: "timer" to warn you can drink another po
Posted: 2011-09-06 15:31:29
by ZeroDX
Бывает =)