Yoko

All sides of Injection
It is currently 2024-03-28 19:02:17

All times are UTC+02:00




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 2011-08-29 21:53:42 
Offline

Joined: 2011-08-29 21:49:35
Posts: 2
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.


Top
   
PostPosted: 2011-08-29 23:51:05 
Offline
User avatar

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


Top
   
PostPosted: 2011-08-30 08:01:33 
Offline
User avatar

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

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


Top
   
PostPosted: 2011-08-30 08:57:06 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
Проще засунуть туда юз пота, чтобы выводил ещё в секундах


Top
   
PostPosted: 2011-09-05 22:00:11 
Offline

Joined: 2011-08-29 21:49:35
Posts: 2
Quote:
UO.Print('Wait bla bla bla') ; <=== для наглядности.


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


Top
   
PostPosted: 2011-09-06 06:47:27 
Offline
User avatar

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

_________________
Image
YokoInjection CodeSweeper
Ошибка "Unhandled exception in parser"
Стрелялка для олдов.


Top
   
PostPosted: 2011-09-06 15:31:29 
Offline
User avatar

Joined: 2006-12-08 10:51:50
Posts: 718
Location: Москва
Бывает =)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 7 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 33 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited