blurredfrenzy Posted October 10, 2017 Share Posted October 10, 2017 Hello, I got the following problem: I wrote the follwing script: Func a() Local $sAnswer = InputBox("Question", "Amount ", "", "", _ - 1, -1, 0, 0) Send($var) Sleep(2) WEnd EndFunc In a database are vars deposited with the following templates: $var1, $var2 etc. If the user enters a number into the box, the script should send the text from the var to a chat (eg. he enters a 5, the script should send $var5). After a lot of googling im not able to get the Send($var) the correct way. Link to comment Share on other sites More sharing options...
spudw2k Posted October 10, 2017 Share Posted October 10, 2017 Well, not much information to go on here, so here's something to chew on... Assuming (a lot here) that you already have variables defined and you want the user to be able to select one based on a number. Well, you can append the number to a variable name to create a reference to and evaluate an expression/variable by using the Execute function. Alternatively, you could create an array of "templates" and call them by referencing the index of the array using a number. Question: Chat....is this for a chat bot? Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
blurredfrenzy Posted October 10, 2017 Author Share Posted October 10, 2017 thanks for the quick answer. first: no, this is not for a chat bot. It should be more like a tool for shortcuts. second: I am not rly experienced with AutoIt and trying to get as far as possible with my knowledge. I got the script that far, that it sends the keys to the notepad without the InputBox, but I have no clue how to express the "Send(*****)" execute properly. I tried it with the mentioned execute funtion ($text= Execute("$var+$sAnswer") that the command should look like "Send($var5) as $text=$var5 but it did not work. And I think that I will get the same problem with the index of the array u mentioned Link to comment Share on other sites More sharing options...
blurredfrenzy Posted October 10, 2017 Author Share Posted October 10, 2017 Edit: ok works fine with the array. thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now