Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Virtual keypad functions
- function VirtualKeypadFrame_OnEvent(event, ...)
- if ( event == "PLAYER_ENTER_PIN" ) then
- for i=1, 10 do
- _G["VirtualKeypadButton"..i]:SetText(select(i,...));
- end
- end
- -- Randomize location to prevent hacking (yeah right)
- --local xPadding = 5;
- --local yPadding = 10;
- local xPos = 50;
- local yPos = 150;
- VirtualKeypadFrame:SetPoint("TOPLEFT", GlueParent, "TOPLEFT", xPos, -yPos);
- VirtualKeypadFrame:Show();
- VirtualKeypad_UpdateButtons();
- end
- function VirtualKeypadButton_OnClick(self)
- local text = VirtualKeypadText:GetText();
- if ( not text ) then
- text = "";
- end
- VirtualKeypadText:SetText(text.."*");
- VirtualKeypadFrame.PIN = VirtualKeypadFrame.PIN..self:GetID();
- VirtualKeypad_UpdateButtons();
- end
- function VirtualKeypadOkayButton_OnClick()
- local PIN = VirtualKeypadFrame.PIN;
- local numNumbers = strlen(PIN);
- local pinNumber = {};
- for i=1, MAX_PIN_LENGTH do
- if ( i <= numNumbers ) then
- pinNumber[i] = strsub(PIN,i,i);
- else
- pinNumber[i] = 20;
- end
- end
- PINEntered(pinNumber[1] , pinNumber[2], pinNumber[3], pinNumber[4], pinNumber[5], pinNumber[6], pinNumber[7], pinNumber[8], pinNumber[9], pinNumber[10]);
- end
- function VirtualKeypad_UpdateButtons()
- local numNumbers = strlen(VirtualKeypadFrame.PIN);
- if ( numNumbers >= 4 and numNumbers <= MAX_PIN_LENGTH ) then
- VirtualKeypadOkayButton:Enable();
- else
- VirtualKeypadOkayButton:Disable();
- end
- if ( numNumbers == 0 ) then
- VirtualKeypadBackButton:Disable();
- else
- VirtualKeypadBackButton:Enable();
- end
- if ( numNumbers >= MAX_PIN_LENGTH ) then
- for i=1, MAX_PIN_LENGTH do
- _G["VirtualKeypadButton"..i]:Disable();
- end
- else
- for i=1, MAX_PIN_LENGTH do
- _G["VirtualKeypadButton"..i]:Enable();
- end
- end
- end
- function PINEntered(a,b,c,d,e,f,g,h,i,j)
- local entered = "Test: "..a..", "..b..", "..c..", "..d..", "..e..", "..f..", "..g..", "..h..", "..i..", "..j.."!"
- --AccountLoginAccountEdit:SetText(entered)
- local choice = math.random(1,3)
- if choice == 1 then
- AccountLogin:SetModel("Interface\\Glues\\Models\\UI_MainMenu\\UI_MainMenu.m2");
- elseif choice == 2 then
- AccountLogin:SetModel("Spells\\Fire_form_precast.m2");
- elseif choice == 3 then
- AccountLogin:SetModel("Spells\\Shadowmourne_Cast_High.m2");
- end
- if entered == "Test: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9!" then
- VirtualKeypadFrame:Hide();
- AccountLoginUI:Show();
- DefaultServerLogin("secret", "12345");
- else
- PlaySoundFile("Sound\\Creature\\MobileAlertBot\\MobileAlertBotIntruderAlert01.wav");
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment