http://www.byond.com/developer/Kozuma3/k3S

The source is available on the hub, a simple scripting lanuage with a few features in the example .dm file.
Messing around with Topic()

client
var/tmp/winque
Topic(_,list/l)
if(l && l.len && ("id" in l) && ("hash" in l))
winque = list(l["hash"],l["id"])
proc/WaitFor(i)
winque = null; . = world.tick_lag
while(winque == null || winque[1] != i){sleep(.)}
. = winque[2]
winque = null
usr << browse(null,"window=[i]")
return .

proc
SUBMIT(n){. = {"<input type=submit value=[replacetext(n," ","_")]/>"}}
BTN(a,b,i){. = {"<a href=?id=[replacetext(b," ","_")]&hash=[replacetext(i," ","_")]>[a]</a>"}}
Window(b,t="Popup")
. = {"
<html><head><title>
[t]</title><style>
body {background-color:#000000; color:#FFFFFF;}
</style></head><body>
[b]</body></html>"}
usr << browse(.,"window=[t]")

/* Demo Below */
mob/Login()


// Below a variable is defined containing the HTML we wanna use.
// It includes some procs I included myself to help with readability.
// The 3rd Argument for ---BTN()--- is the ID given to that specific button.
// You can wait for an answer using ---WaitFor(ID)---
var v = \
{"
Hello<hr>
[BTN("Click Here","A","Demo")]<br>
[BTN("Click Here","B","Demo")]<br>
[BTN("Click Here","C","Demo")]<br>
"}



// This displays the HTML to the player.
Window(v,"Demo")

// This waits for you to click a button with the specified ID
var CHOICE = client.WaitFor("Demo")
world << "Your choice was = [CHOICE]"


Feed 2.2.x will be hitting the hub sometime soon - we busted out the snow and lights from last year!
Page: 1 2 3 ... 349 350 351

Login to reply.