Jump to content

Running function as variable


 Share

Recommended Posts

Ok I need to run any autoit function from a variable for example

$Recv = TCPRecv($Socket, 512)
;$Recv = MsgBox(0, "", "")
AutoItRun($Recv)

This way you can enter functions directly in an excutable from anywhere using tcp. Is this possible?

I am thinking of using AutoItX Dll but you never know, maybe there is a way in script to figure it out.

For Example using AutoItX

$Obj = ObjCreate("AutoItX3.Control")
$Variable = 'Run "notepad.exe"'
$Variable = StringTrimLeft($Variable, 1)
$Variable = StringTrimRight($Variable, 1)
$Obj.$Variable

Is this possible anyway?

Edited by AutoIt Smith
Link to comment
Share on other sites

  • Moderators

$Recv = TCPRecv($Socket, 512)

;$Recv = MsgBox(0, "", "")

Call($Recv)

Anyone else see something wrong with this?

Edit:

I'm not being sarcastic here btw, I'm curious if using "Call" with a variable to call a Function that passes a parameter works.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...