Script Request: "timer" to warn you can drink another potion

General Injection issues

Moderators: Murderator+, Murderator

Post Reply
theuoplayerbr
Posts: 2
Joined: 2011-08-29 21:49:35

Script Request: "timer" to warn you can drink another potion

Post 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.
ZeroDX
Posts: 718
Joined: 2006-12-08 10:51:50
Location: Москва
Contact:

Re: Script Request: "timer" to warn you can drink another po

Post 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
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Script Request: "timer" to warn you can drink another po

Post 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

Кажется мне что он сейчас попросит чтобы таймер отображался в сообщениях. :roll:
ZeroDX
Posts: 718
Joined: 2006-12-08 10:51:50
Location: Москва
Contact:

Re: Script Request: "timer" to warn you can drink another po

Post by ZeroDX »

Проще засунуть туда юз пота, чтобы выводил ещё в секундах
theuoplayerbr
Posts: 2
Joined: 2011-08-29 21:49:35

Re: Script Request: "timer" to warn you can drink another po

Post by theuoplayerbr »

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


Injection warning a error in the line... what is it?
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Script Request: "timer" to warn you can drink another po

Post 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 :mrgreen:
ZeroDX
Posts: 718
Joined: 2006-12-08 10:51:50
Location: Москва
Contact:

Re: Script Request: "timer" to warn you can drink another po

Post by ZeroDX »

Бывает =)
Post Reply