ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Neo on August 16, 2011, 09:52:07 PM

Title: #time var
Post by: Neo on August 16, 2011, 09:52:07 PM
I'm having a problem... I was trying to get a "clock" to use in a script, and I came up with something like this:

Code: [Select]
set %string #time
str left %string 2
set %h #strRes
str Mid %string 3 2
set %m #strRes
set Right %string 2
set %s #strRes
set %hour %h , h
set %min %m , m
set %sec %s , s
set %ctime %hour , %min , %sec
Display %ctime

The thing is, if you keep looping this, you'll notice that the time displayed won't change for 1 whole minute...
It islike it doesn't read the #time var for 1 minute until it reads again...

Or maybe I'm doing sth wrong?

Anyway, I'd appreciate some insight!

Cheers!

neo
Title: Re: #time var
Post by: Crome969 on August 17, 2011, 02:57:12 AM
Used this and working for me;)
Code: [Select]
str mid #time 1 2
set %H #strres
str mid #time 3 2
set %M #strres
str mid #time 5 2
set %S #strres
set %Time %H , #spc , : , #spc , %M , #spc , : , #spc , %S
display %time

Crome
Title: Re: #time var
Post by: Neo on August 17, 2011, 03:10:44 AM
Thank you Crome... I guess my %string var isn't getting updated or something...

neo
Title: Re: #time var
Post by: Crome969 on August 17, 2011, 03:16:10 AM
Thank you Crome... I guess my %string var isn't getting updated or something...

neo
Seems like but i cant tell you why:/
Title: Re: #time var
Post by: Neo on August 17, 2011, 03:21:40 AM
Just figured it out...

There was a typo:

set Right %string 2

I guess I really need some sleep lol...

Cheers!

neo