airfell 12 Posted August 7, 2014 (edited) AirFell's Keypad ScriptbyAirFell Description: A quick and easy script/dialog that outputs a string, could have many uses, locks, hacking laptops, who knows. Get Creative! Installation: 1. Copy the folder AF_Keypad directly into your mission.stratus/mission.altis folder. 2. In your init.sqf file copy and paste in the line: _nul = []execVM "AF_Keypad\AF_KP_vars.sqf"; 3. In your description.ext file copy and paste in these two lines: #include "AF_Keypad\AF_KP_defines.hpp" #include "AF_Keypad\AF_KP_dialogs.hpp" 4. ENJOY! Included files: File is a zipped PBO, the file can be ran as a demo or directly pulled out of the file for use. DL Link Usage: Once the keypad files are installed in your mission directory and you have the init.sqf and description.ext set up, you need to call the dialog from somewhere. Most common method would be an addaction, but other methods could be used. Surprise me! Basic Addaction method: player addAction["Open Keypad",{createDialog "AF_Keypad";}]; Once a user hits enter on the dialog keypad, it will return a string (collection of alpha-numeric characters) to the variable name OutputText Change log: V1.0 released as-is. If someone has any suggestions I may come back to this, otherwise it is what it is. Notes: *OutputText is a GLOBAL VARIABLE. From the wiki: https://community.bistudio.com/wiki/Variables#Global_Variables "Global variables are visible on the whole computer where they are defined." *There is no character limit on the string length. You have been warned. Credits & Thanks: Thanks to Iceman77 and h8ermaker on the Dialog tutorial. Sidenote: This is my first completed little script, I know its plain and simple, but I made it in an attempt to learn dialogs a bit better. Edited August 8, 2014 by AirFell 2 Share this post Link to post Share on other sites
kremator 1065 Posted August 7, 2014 A very useful little tool this. Thanks. Share this post Link to post Share on other sites
mamasan8 11 Posted August 8, 2014 Typing the launch-codes for nukes has never been EASIER! :P Now you can do it from the safety of your home. Share this post Link to post Share on other sites
airfell 12 Posted August 8, 2014 Typing the launch-codes for nukes has never been EASIER! :PNow you can do it from the safety of your home. Oh wow, thats a pretty cool idea. I made it for a mission I'm working on to lock/unlock a console, but that is a cool idea too. I've been thinking about some sort of randomizer that could "decode" a password kind of like a bruteforce(simplified) attack to unlock/decode stuff, but I don't personally need it for anything I'm working on. If any suggestions come my way for ways to expand this or whatever, I may take some time out of my bigger project to play with the idea. Share this post Link to post Share on other sites
BlackViperGaming 3 Posted August 8, 2014 Please, please, please. Please if you could please, make this into a script where you can add the action to an already placed object, lets say a sign. You walk up to this sign which is lets say right in front of a large square made by h-barriers, you scroll on the sign, enter the correct code and upon hitting enter the h-barrier directly in front of you is then sent underground for about 30 seconds, thus giving you enough time to get into the compound before it closes behind you, then there is another sign on the other side of the h-barrier allowing you to once again type in the same code and exit the same compound. This was done in takistan life on Arma 2, and I have been trying forever to get this to work in arma 3. Thanks so much for this, and if you can actually get my suggestion to work, I WILL LOVE U FOREVER BRO! Share this post Link to post Share on other sites
airfell 12 Posted August 9, 2014 (edited) I don't think it would be that hard, just a bit of trial and error. The hard part I think would packaging the script in such a way that it would be easy to install for everyone. I'll give it a go in my free time. EDIT: after further thought, I'm not sure what the best method for setting the PW would be... I'm assuming you'd want it side restricted, but if I hard code the PW in, others will find out soon enough... I could make it randomized on mission init, but then again, I'm also not sure how to inform the team since I'm sure right off the bat people would switch sides to figure it out, and, if its set by the players themselves, people would probably troll the gate and change it so nobody could get in. Any thoughts? Edited August 9, 2014 by AirFell Share this post Link to post Share on other sites
BlackViperGaming 3 Posted August 9, 2014 (edited) Well, I know that in takistan life it was set within the init field of the object set as the keypad in the mission editor. Sure it wouldn't stop people from opening up the mission and checking it...kinda how I broke into it in the first place. LOL, but the average person will not figure out how to do that...Oh and I think it would be best if it wasn't side specific, say it there was a mission where you had to infiltrate the enemy base...and the enemies were players as well. But thier armory, where all the ammo is stored would be within an area only accessable by the keypad. You theoretically take one of them out, get the code from them (interrogation). Take thier clothes, walk in plant a bomb and get out of thier. But primarily I would have this on a clan based server where only clan members knew the code to get into the area for the clan specific vehicles and such. Hope this helps, Black Viper P.S. If you could somehow in the future make another version of this script where you would have to use a key-code in order to enter a vehicles...to virtually eliminate vehicle stealing I think that would be pretty cool as well. :D Good Luck! Edited August 9, 2014 by BlackViperGaming Share this post Link to post Share on other sites
airfell 12 Posted August 11, 2014 Anything is possible, but I've also got other things going on too. I'll leave it at "if I get a chance"... If you wanted to create it yourself it really shouldn't be that difficult. You would just want an if statement for the keycode matching whatever is hard coded in and have that launch something like hBarrirer setPos (-5 on the z axis); sleep 30(the time you want it to wait); hBarrier setPos (+5 on the z axis). The hard part is how you want the keycode to match to getting in the game. It could just be randomized on init then the side could get a hint of the code when they are near it or something. Share this post Link to post Share on other sites
Guest Posted August 11, 2014 Thanks for sending us the release :cool: Release frontpaged on the Armaholic homepage. AirFell's KeyPad v1.0 ================================================ We have also "connected" these pages to your account on Armaholic. This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have. When you have any questions already feel free to PM or email me! Share this post Link to post Share on other sites
Undeceived 392 Posted August 19, 2015 Thanks mate, I was looking for a simple keypad without a whole framework around it. :) Share this post Link to post Share on other sites
kremator 1065 Posted August 19, 2015 Looks like today is thread necro day. Third so far! Share this post Link to post Share on other sites
stu81 45 Posted March 11, 2016 Sorry to revive old threads but I want to use this script and would love some help, noob alert!! Would I use this in the object init to lock the gate for server start? ((nearestobjects [this, ["gate_classname"], 5]) select 0) setVariable ['bis_disabled_Door_2',1,true]; Anyone any ideas how I could add this to an editor placed arma3 gate and how I can set it to be....... - locked on server startup. - can be opened with code - can be locked again with code - all done through addaction on the gate? All help greatly appreciated :) Share this post Link to post Share on other sites
zagor64bz 1225 Posted March 21, 2017 Sorry to revive this walking dead thread..but just found this neat script, but I'm getting confused/noobed out: how do I use this to open a gate, for example, with a "1234" code? Thank you all! Share this post Link to post Share on other sites
Dj Rolnik 29 Posted July 11, 2017 Hey all, Sorry if I'm being stupid or what but where is the "folder" that we are supposed to put in the mission directory? I cannot seem to find the download either on armaholic, nor here, nor on steam. It just downloads a .pbo and that's it. On steam workshop it downloads something but I cannot find it anywhere... Any help? Cheers, Adam Share this post Link to post Share on other sites
R0adki11 3949 Posted July 11, 2017 42 minutes ago, Dj Rolnik said: Hey all, Sorry if I'm being stupid or what but where is the "folder" that we are supposed to put in the mission directory? I cannot seem to find the download either on armaholic, nor here, nor on steam. It just downloads a .pbo and that's it. On steam workshop it downloads something but I cannot find it anywhere... Any help? Cheers, Adam Have you checked out the readme in the opening post? Share this post Link to post Share on other sites
Dj Rolnik 29 Posted July 11, 2017 Yes I have and I see no obvious information stating the location of the folder. There is only the pbo. Am I missing something? Share this post Link to post Share on other sites
R0adki11 3949 Posted July 11, 2017 13 minutes ago, Dj Rolnik said: Yes I have and I see no obvious information stating the location of the folder. There is only the pbo. Am I missing something? I think this bit of text holds the answer. Quote File is a zipped PBO, the file can be ran as a demo or directly pulled out of the file for use. The author is suggesting to unpack .pbo file. Share this post Link to post Share on other sites
Dj Rolnik 29 Posted July 11, 2017 Oh God... I had to download a separate tool for handling pbo files. At first I was unaware that you can do that even which is why I misunderstood the instructions. Cheers for clarifying that. 1 Share this post Link to post Share on other sites
R0adki11 3949 Posted July 11, 2017 19 minutes ago, Dj Rolnik said: Oh God... I had to download a separate tool for handling pbo files. At first I was unaware that you can do that even which is why I misunderstood the instructions. You can do it, however before you go looking at other peoples work its best to ask permission. But in this case the author has already given it. Though i am surprised the author just didn't the files normally aswell as in a .pbo Share this post Link to post Share on other sites
Dj Rolnik 29 Posted July 13, 2017 Hey, Coming back to this thread with the hope of finally finding an answer :) I am making a mission in which a hacker is supposed to hack a data terminal and has two (actually three) outcomes. I managed to modify that bit of code from the keypad as I needed a few options the script would go. Basically, depending on whether a hacker input a proper code, an improper code or no code at all, and pressed "enter", the script would either: continue with the first If argument and succeed, fail immediately and shut down the terminal triggering an alarm, or do nothing when there's no code input and wait for either the first or second scenario to occur. Stumbled upon another issue (because why not..?) For some reason the if command does not seem to be ignoring sleep. This is the script: case "enter": { OutputText = InputText; waitUntil { if (((OutputText isEqualTo "361") && (name z == name z))) then {hint "Logging into the system"}; closeDialog 0; InputText = ""; sleep 1; true }; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Logging into the system."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Logging into the system.."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Logging into the system..."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Shutting down."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Shutting down.."}; sleep 1; if ((OutputText isEqualTo "361") && (name z == name z)) then {hint "Shutting down..."}; sleep 1.5; [terminal1,0] call BIS_fnc_dataTerminalAnimate; deleteVehicle box1; if !(OutputText isEqualTo "361") then {hint "bad2."}; closeDialog 0; InputText = ""; sleep 2; Please ignore all the other issues with it for now. What is bugging me is why does the second ifcondition perfectly omits the hints and the other "subifs" when triggered but includes the sleep commands in between them? This results in the second if appearing after the sleeps from the first condition have passed even though I have not triggered the first if. Effectively if I put sleep 50 only in the first if, then the second if would appear 50 seconds later as well no matter which of those two I trigger.. Thanks, Adam Share this post Link to post Share on other sites