Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ timers problem
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Avariel
Portugal (55 posts) Bio
|
Date
| Mon 09 Jun 2003 02:07 AM (UTC) |
Message
| i need some help with some timers...
i try to use some timers in a script...
first i tried to addtimer but im getting an error, this is my function
world.addtimer ( "Name", 0, 0, 3, "", eEnabled | eReplace , "OnTest" );
but it wont do anything. i tried the OnTest function in an alias and it worked fine.
then i tried to add something to send in the timer and i did
world.addtimer ( "Name", 0, 0, 3, "send this", eEnabled | eReplace , "OnTest" );
and it send "send this" in every 3 secs... so i cant understand what is wrong. after that i tried a diferent thing and make a permanent timer that i would enable/disable
<timer
name="Name"
script="OnTest"
second="3"
>
</timer>
the problem is that when i enable the timer it fires 1 sec later and only after that it fires 3 in 3 secs..
any sugestion?
thank you
|
The Avariel Wind Lord | Top |
|
Posted by
| WRTIII
Canada (76 posts) Bio
|
Date
| Reply #1 on Mon 09 Jun 2003 10:41 PM (UTC) |
Message
| I really have no clue what it is you are trying to do the problem that I see which may not be a problem with
world.addtimer ( "Name", 0, 0, 3, "", eEnabled | eReplace , "OnTest" );
Is that where you put the data to be sent you may need to have " " as there is nothing being sent there.
and you said it worked when you put send this
I don't understand what the problem is to be honest so I will just shutup now but you said it worked fine with the "Send This" so I am not sure what the problem is
bleh ok just ignore me
Wish I could help,
WRTIII | Top |
|
Posted by
| Poromenos
Greece (1,037 posts) Bio
|
Date
| Reply #2 on Tue 10 Jun 2003 03:08 AM (UTC) |
Message
| OK, i didn't read the whole post, but VBscript is "Or", not "|" :) |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | Top |
|
Posted by
| Ked
Russia (524 posts) Bio
|
Date
| Reply #3 on Tue 10 Jun 2003 04:56 AM (UTC) |
Message
| Don't think that's vbscript. No parenthesis around arguments or ; at the end of statement there either :P | Top |
|
Posted by
| Magnum
Canada (580 posts) Bio
|
Date
| Reply #4 on Tue 10 Jun 2003 05:51 AM (UTC) |
Message
| I would change the | to a + .
When a timer calls a subroutine, it only passes one argument to the subroutine, which is the name of the timer that fired. If your subroutine does not expect exactly ONE argument, a runtime error will occur in your script.
For example, your subroutine might look like this:
Sub onTimerFired (TimerName)
World.Note "The timer, " & TimerName & " has fired."
End Sub
(That being a Visual Basic Script example).
|
Get my plugins here: http://www.magnumsworld.com/muds/
Constantly proving I don't know what I am doing...
Magnum. | Top |
|
Posted by
| Avariel
Portugal (55 posts) Bio
|
Date
| Reply #5 on Mon 16 Jun 2003 03:37 PM (UTC) Amended on Mon 16 Jun 2003 03:39 PM (UTC) by Avariel
|
Message
| ok! thank you to everyone... i think my post was a LOT confusing *blush* im sorry. i finnaly figure out what was happening.
for some reason an alias/trigger/timer created via script needs that the world have enable script on to call a script, although the other alias/trigger/timer dont. i dont know if its a bug or its ment to be like that.
thank you again for your help..
|
The Avariel Wind Lord | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #6 on Wed 18 Jun 2003 02:23 AM (UTC) |
Message
| If you are planning to script then "enable script" needs to be set, yes. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
21,756 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top