2015-03-24 01:18 am
Put this in an alias I used IOTA. This could be adjusted to update a window instead using #WIN and #EXECWIN but didn’t go that far.
to use LUA SOCKET CALLS MAKE SURE TO FOLLOW THIS: http://forums.zuggsoft.com/forums/viewtopic.php?t=32901
USE: iota
RESULT: Display valid options
USE: iota ship
RESULT:
<------------------------ Ship Locator -------------------------->
Merdraco Status: En Route to Rune from Sigil at [465, 1210]. [Mon Mar 23 20:19:04 2015]
Hallowhold Ferry Status: En Route to Lowangen from Tellerium at [1695, 696]. [Mon Mar 23 20:17:10 2015]
Riddenmast Ferry Status: En route to Sigil at [695, 782]. [Mon Mar 23 20:18:40 2015]
The airship Inconvenience is flying over 269, 829. (Oceanus Ingenii) [Mon Mar 23 20:19:54 2015]
USE: iota moon
RESULT:
<--------- MOON Locator -------->
Trigael: crescent waning
Marabah: gibbous waxing
USE: iota
RESULT:
<------------------------ WG Locator -------------------------->
A worldgate has appeared in Alyria, coordinates [502, 1281].
A worldgate has appeared in Great Alyrian Underground, coordinates [1752, 986].
ALIAS SCRIPT:
iotaparam={}
iotaparam.iota = zs.param(1)
if not http then http = require("socket.http") end;
local page, retcode, header = http.request("http://iota.materiamagica.com/online/sysinfo.txt")
if iotaparam.iota == "ship" then
if (retcode == 200) then
wstart = string.find(page, "Merdraco", 0, true)
wend = string.find(page, "#END", 0, true)
where = string.sub(page, wstart, wend - 1)
zs.print("\n")
zs.print("\027[1;37m<------------------------ Ship Locator -------------------------->")
zs.print("\027[1;37m"..where)
else
zs.print("\027[1;37mSorry, couldn't read sysinfo page");
end
elseif iotaparam.iota == "moon" then
if (retcode == 200) then
wstart = string.find(page, "Trigael", 0, true)
wend = string.find(page, "Alyrian", 0, true)
where = string.sub(page, wstart, wend - 1)
zs.print("\n")
zs.print("\027[1;37m<--------- MOON Locator -------->")
zs.print("\027[1;37m"..where)
else
zs.print("\027[1;37mSorry, couldn't read sysinfo page");
end
elseif iotaparam.iota == "worldgate" then
if (retcode == 200) then
wstart = string.find(page, "A worldgate", 0, true)
wend = string.find(page, "Merdraco", 0, true)
where = string.sub(page, wstart, wend - 1)
zs.print("\n")
zs.print("\027[1;37m<------------------------ WG Locator -------------------------->")
zs.print("\027[1;37m"..where)
else
zs.print("\027[1;37mSorry, couldn't read sysinfo page");
end
else
zs.print("\027[1;37mValid Commands are ship, moons, worldgate")
end
Edited by Tamlin on Sun, 29 Mar 2015 06:28:53 +0000 |