Mud Scripting
Started by: DubiousDubious
On: 1214369909|%e %b %Y, %H:%M %Z|agohover
Number of posts: 1
rss icon RSS: New posts
Summary:
Aliases, triggers and scripting discussion
Mud Scripting
DubiousDubious 1214369909|%e %b %Y, %H:%M %Z|agohover

Hi again,

The world exits interface discussion page didn't seem appropriate, so I made this new thread to talk about more general scripting stuff.

In a similar theme to the world exits I posted before, I also have almost the same script to check the time on Sosel.
It will tell you the time in Sosel hours, and also how long (in real life Earth minutes) till the next sunrise or sunset.
From what I have observed it is reasonably accurate. Again, it's a terrible hack and comments are welcome.

#ALIAS soseltime {timeprogress = 1
#VARIABLE timeobject %comcreate( "InternetExplorer.Application")
timeurl="http://70.86.15.74:3003/cgi/calendar?=fire"
#CALL @timeobject.Navigate(@timeurl)
#ECHO Looking for Sosel time…
timecheck 0}

#ALIAS timecheck {timeout=15
#IF {!@timeobject || %1 > @timeout} {#ECHO Timed out!
timeprogress=0
timeobject=0} {#IF {@timeobject.ReadyState==4} {timeprogress=0
#ECHO It is %copy( @timeobject.document.body.innertext, 24, 5) on Sosel.
soselminutes = %eval( %copy( @timeobject.document.body.innertext, 24, 2)*88+%copy( @timeobject.document.body.innertext, 27, 2))
#IF (@soselminutes < 235) {#ECHO It is %round( (235-@soselminutes)/12) minutes till sunrise.} {#IF (@soselminutes<620) {#ECHO It is %round( (620-@soselminutes)/12) minutes till sunset.} {#ECHO It is %round( (1035-@soselminutes)/12) minutes till sunrise.}}
timeobject=0} {#ALARM {+1} {timecheck %eval( %1+1)}}}}

unfold Mud Scripting by DubiousDubious, 1214369909|%e %b %Y, %H:%M %Z|agohover
New post
Except where stated otherwise, content is © 2007–2008 RetroWIKI contributors, all rights reserved. Content from the RetroMUD game or the retromud.org website is © 1994–2008 RetroMUD and/or RetroMUD staff, used here only for commentary, without permission.