Jump to content
Sign in to follow this  

How would one store a key as a variable?

Recommended Posts

Alright so I have a series of input boxes for a bot im making for maple story... yes sounds so very important eh well to me it is. Anyway so here I have these input boxes attached to a series of macros for auto buffing currently I have only the delay boxes in the script I scraped the others because they would produce 4 rather than produce the characters I wanted them to.

What I wish to do in short is allow the bot's user to configure their keys as to which key is used in game to buff the hotkeys are static but if this works I might just be able to fix that. Id also like to understand how the .ini functions work and weather it might be possible to store the values people will put through my configuration setup wizard even though its not a whole lot.

I tried this method of doing it:

Send("{$var}") hoping that that would successfully give me the right result. Such as a user puts in the word Insert or Home or PGDN and then that variable should be populated with the correct value resulting in.

Send("{Home}") of course this didnt work and now im stumped im sure theirs a GUI way to do this however im not quite ready to dive into the complexities of that. I also thought about the ACII way of doing things yet I think it would prove to be the same result as ASC must be placed before the number so you cant simply have an ASCII Chart conversion in the script.

079 = "{SPACE}" Im not even sure I can do that in AutoIt anyway its probably not a part of the syntax as "Space" isnt expressed as a variable and if it was it would do me no good since thats the output im trying to achive.

Share this post

Link to post
Share on other sites

I'm not %100 sure I know what you are asking (sorry) but I think this is what you want...

$varinput = InputBox("Hotkey", "Enter your hotkey", "")
$varinputhotkey = ("{" & $varinput & "}")

$var = ("{SPACE}")

That will 'format' your inputbox to make a hotkey correctly. I typed space and when notepad comes you see 2 spaces have been typed. Let us know if this isn't what you wanted

While ProcessExists('Andrews bad day.exe')

Share this post

Link to post
Share on other sites

I did end up doing this though in a less clean way... Saving the values to text is all well and good but how would I get autoit to pull those values from the file or read from the file.

Now that I successfully saved it as a configuration file their surely must be a way to load it so that my users don't have to run my configuration editor every time the bot loads. Kinda defeats the purpose of having a customized configuration no? And thank you for your help your code is alot cleaner than what I was using.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...