You can read and reply to posts and download all mods without registering.
We're an independent and non-profit fan-site. Find out more about us here.
class zbKeycodeHUD extends SqRootScript { function OnBeginScript() { if (!IsDataSet("Done")) { if (getQB()) { Quest.SubscribeMsg(self, getQB(), eQuestDataType.kQuestDataCampaign); checkQB(); } else { SetData("Done", true); } } } function OnEndScript() { if (!IsDataSet("Done")) { Quest.UnsubscribeMsg(self, getQB()); }; } function OnQuestChange() { checkQB(); } function checkQB() { if (Quest.Get(getQB()) == 1) { SetProperty("HUDUse", ": \"" + Data.GetObjString(self, "huduse") + "\n" + format("%05d", GetProperty("KeypadCode")) + "\""); OnEndScript(); SetData("Done", true); } } function getQB() { if (IsDataSet("CodeQB")) { return GetData("CodeQB"); } local deck, n, qb; local code = format("%05d", GetProperty("KeypadCode")); for (deck = 1; deck <= 9; deck++) { for (n = 1; n <= 32; n++) { qb = "Note_" + deck + "_" + n; if (Data.GetString("notes", qb).find(code)) { SetData("CodeQB", qb); return qb; } } } }}
function OnFrobWorldBegin() { local c; local code = GetProperty("KeypadCode"); local codes = [[45100, "2_4"], [12451, "2_7"], [98383, "2_8"], [59004, "1_11"], [34760, "1_10"], [15061, "1_8"], [94834, "1_12"], [11111, "5_8"], [34093, "5_6"], [13433, "4_6"], [83273, "6_11"]]; foreach (c in codes) if (code == c[0] || code == c[0] * 10) SetProperty("KeypadCode", c[0] * (Quest.Exists("Note_" + c[1]) ? 1 : 10));}
function OnKeypadDone() { if (message().code == GetProperty("KeypadCode") / 10) { print("cheater!"); }}