Switch to edit mode.
Name(s): message1: target = this.master
2: if (callers()[1][3] == #3135)
3: if (args[1] == "QUIT")
4: target.abandoned = target.abandoned + 1
5: elseif (args[1] == "NEW")
6: target.dispensed = target.dispensed + 1
7: elseif (args[1] == "WON")
8: "Note that this verb *will* choke without adequate args:"
9: "A 'WON' call requires: #3388:hs_msg('WON', size, minmoves, moves, time);"
10: target.completed = target.completed + 1
11: "First add to .players, if necessary."
12: score = 0
13: for x in (target.players)
14: if (x[1] == player)
15: score = x[3]
16: target.players = setremove(target.players, x)
17: elseif (time() - x[2] > min(x[3] * 5, 60 * 24) * 3600)
18: "Time's up (5 hrs per maze pt), you're off .players!"
19: target.players = setremove(target.players, x)
20: endif
21: endfor
22: target.players = {@target.players, {player, time(), score + args[2] * args[2]}}
23: "Now, add to .scores if appropriate."
24: tobeat = target.scores[args[2]][2]
25: " for x in ({tobeat, args[3], args[4], args[5]})"
26: " player:tell(toliteral(x));"
27: " endfor"
28: " if (((args[3] * 2) > args[4]) && ((tobeat == 0) || (tobeat > ((args[5] * 1000) / args[4]))))"
29: if (tobeat == 0.0 || tobeat < tofloat(args[5]) / tofloat(args[4]))
30: target.scores[args[2]] = {player, tofloat(args[5]) / tofloat(args[4]), args[4]}
31: $msg:mtell("new_hs", args[2])
32: endif
33: endif
34: endif
35: "Last modified by Lao-Tzu (#8084) on Sun Nov 26 09:19:35 2000 MST."