Jump to content
Sign in to follow this  
marselo

autoit command recognition help

Recommended Posts

marselo

iam making a program to send commands to the pc through Messenger.

but i need help to get the commands recognized for example i want to send mousemove(480,431) so how will the computer recognize the command as mousemove(x,y) as x=480 , y=431 ?

Share this post


Link to post
Share on other sites
martin

Easiest way is to read the line into a variable, say $nextline then

Execute($nextline)

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
marselo

nice,this will work.

but how can i do the same but with changing the command name??

for example:

mouseto,[x],[y]

mousemove([x],[y]) ???

Share this post


Link to post
Share on other sites
monoceres

First of all, executing user input is very, very unsecure. Even though in this case it might be okay, make it a rule to never do it! Lets for example play with the thought I figure out how to send these commands to you over messenger, I would have complete control over your computer.

Instead, why not build a simple parser? Much, much more secure. Here's a simple example:

#include <array.au3>


$Input="mouseto,10,10"

$Params=StringSplit($Input,",",2)

$Function=$Params[0]
_ArrayDelete($Params,0)

Switch $Function
    Case "mouseto"
        MouseMove($Params[0],$Params[1])
        
EndSwitch

Broken link? PM me and I'll send you the file!

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  

×