Sign in to follow this  
Followers 0
PerryRaptor

Create JScript on Server for remote automation

13 posts in this topic

Merry Christmas everybody...

I've got an idea but not sure if this is possible...I'm stuck with HTML, CSS, and JScript...My ISP doesn't offer ASP for the server. To make matters even more dificult, I'm not that familar with JScript and I've never used the IE and Web UDFs. Also, I'm thinking I'll need TCP and UDP receive components. Here's the idea:

- Create AutoIT code to automate an application on one of my computers

- The code will need to create, copy, and execute a HTML and JScript application on a remote server

- The server code will provide remote access to the application

- The HTML and JScript will be deleted when the application is closed

I expect to need DropDown ListBoxes, RadioButtons, and buttons created on the web space to automate the application.

Share this post


Link to post
Share on other sites



Your description is confusing to me, primarily because I cannot visualize what you are trying to accomplish. Perhaps you can share a concrete example.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Merry Christmas everybody...

I've got an idea but not sure if this is possible...I'm stuck with HTML, CSS, and JScript...My ISP doesn't offer ASP for the server. To make matters even more dificult, I'm not that familar with JScript and I've never used the IE and Web UDFs. Also, I'm thinking I'll need TCP and UDP receive components. Here's the idea:

- Create AutoIT code to automate an application on one of my computers

- The code will need to create, copy, and execute a HTML and JScript application on a remote server

- The server code will provide remote access to the application

- The HTML and JScript will be deleted when the application is closed

I expect to need DropDown ListBoxes, RadioButtons, and buttons created on the web space to automate the application.

Like DaleHohm said, your description is a bit confusing as far as being able to visualize the concept.

Just post a bit of what you think the code will be (even if it's wrong) so we can wrap our minds around it.

Also is the Jscript going to be the same in each instance or is it dynamic?

The same question applies to the HTML file.

If they are dynamic then there is more involved but not necessarily a lot more. It depends aon the number of differences.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Sorry for the confusion...I'm not as smart as everyone around here. I'm working with _IEDocWriteHTML() right now and marking some progress with creating the web page.

::Web Page::

- DropDown ListBox to change setting "A" in the application running on the computer in my office

- DropDown ListBox to change setting "B" in the application running on the computer in my office

- Send Button // to send the necessary "A" and "B" string settings to the application running on the computer in my office

::Computer running application::

- AutoIT code launches the required application at startup

- AutoIT code opens FTP port and copies HTML/JScript files to web server

- AutoIT code appends the link to the uploaded HTML page; e.g. html table array in the Index.html file

- Closing/Stopping the application causes the link to be removed from the file Index.html

#include <IE.au3>

FTPurl = "myISP.com/~myWebSpace"
FTPport = "44444"
FTPuser = "username"
FTPpass = "password"

Func OpenFTP("FTPurl", "FTPuser", "FTPpass")
  TCPconnect("FTPurl", "FTPport")
  FTPsetproxy(0, , "FTPuser", "FTPpass")
  ?? this doesn't work--should I try mapping a network drive ??
EndFunc

Func CopyFTP("path\filename", "FTPurl")
  ??  copy HTML/JScript files to FTP Server ??
EndFunc

Func add_Server_Link()
 ; adds a link to and existing web page on ISP server
  $oIE = _IECreate("http://myISP.com/~myWebSpace")
  $oBody = _IETagNameGetCollection($oIE, "body", 0)
  _IEDocInsertHTML($oBody, <LI><a _ href="https://myISP.com/~myWebSpace/Server_A_Application.html">Server Application _ A</a>,"afterbegin")
End Func

Func appStart()
 ; commands and automation interface...
End Func

Func Listen_to_WebPage()
 ?? listen for strings being sent from web page ??
End Func

Func appClose()
 ; close application...
End Func

Func delete_Server_Link()
  ?? what command is the opposite of _IEDocInsertHTML() ??
End Func

Share this post


Link to post
Share on other sites

I've got FTP file upload working thanks to w0uter's ftp.au3 and the $ftp_flags modification from /dev/null...

#include "C:\program files\autoit3\include\Ftp.au3"

Const $FTP_TRANSFER_TYPE_ASCII = 0x01
Const $FTP_TRANSFER_TYPE_BINARY = 0x02
Const $INTERNET_FLAG_NO_CACHE_WRITE = 0x4000000
$ftp_flags = $FTP_TRANSFER_TYPE_BINARY + $INTERNET_FLAG_NO_CACHE_WRITE

$server = '....................'
$username = '...............'
$pass = '.......................'

$dllhandle = DllOpen('wininet.dll') 
$Open = _FTPOpen('ftp')
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'X:\Microsoft Games\index.html', 'index.html',$ftp_flags)
$Ftpc = _FTPClose($Open)
DllClose($dllhandle)

Still, I have no clue how to send control strings [data] from the web page to the remote computer running the application. :P

Share this post


Link to post
Share on other sites

If your host does not offer ASP - then I am going to venture a guess that you have a linux server.

Which in that case - unless I have missed something somewhere along the way - AutoIt is not going to work on that server.

I would also venture a guess that PHP would.

Which is what you would need to use on the server.

HTML is text - it is as much a part of development as an image is.

Its GUI only - you look at it - and thats about it (minus maybe button and forms - which will do something if asked - but that is only to hand data to something else)

Javascript ... well - yes you can use it server side. On a windows or a linux box.

But it would not be involved with HTML - unless it was making HTML to be displayed ... and either way - would be about the absolute worse form of scripting you could come up with to do server side simply because hardly anybody does it ... especially on linux... and information on it will not be that easy to find.

PHP will do the stuff you want on the server..... that is - depending on if what you want to do requires security permissions higer than what the user that Apache runs as has... (which in a shared hosting environment.. I doubt that you actually can get any higher permissions anyway) ...

No clue what you are trying to do - could not understand anything other than it looks like you are dramatically offbase on the tools you are trying to use.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

@all

Maybe this can help you out WINDOWS SCRIPT COMPONENTS.

http://www.autoitscript.com/forum/index.php?showtopic=38671

It supports Jscripts and ASP client and server side scritping.

You google to find lot' s of Examples.

Regards,

ptrex

Edited by ptrex

Share this post


Link to post
Share on other sites

Run a webserver on your computer. Theres an easy to setup autoit based one in Example Scripts. So basically you want to replicate a application online, like have inputbox that if you input "Blog.txt" and it enter it will type "Blog.txt" in the application? That seems a bit tedious, use a remote desktop program ish like GotoMyPC theres many of thoses out there.

Imagines Microsoft Office as a html, shudders.

Share this post


Link to post
Share on other sites

Imagines Microsoft Office as a html, shudders.

Why?

It can be done... and be done well.

Share this post


Link to post
Share on other sites

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:::: NEVER AGAIN REMOTE DESKTOP :::: EVER ::::: BIG MISTAKE ::::

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Are you saying that AutoIT doesn't have the capability to listen for and receive ascii or binary strings through a port via TCP or UDP?

OR

Are you saying that .Html/JScript web page does not have the capability to send ascii or binary strings to an IP and Port Address?

OR

Are you saying both are not possible?

Someone, somewhere knows how to do #2 above...I haven't found them yet...

I'll keep Googling til I do...I'll keep trying new code with AutoIT... :P

Share this post


Link to post
Share on other sites

HTML does nothing - its GUI only - thats it.

Javascript can make it move around - change the DOM around - etc - as can Java and COM Objects (Flash, Real, and Media Player being the most common)

Expect to do as much "programming" with HTML as you would do with the contents of your "My Pictures" folder.

Javascript running in a webpage - is not going to interact directly with the server.

Javascript can be used to do calls to a web address on the server - same as you can do in your browser. It can pass values back in a variety of ways - but it can not actually reach down into the server and do something.

Something has to be running server side - that you will never actually see running (unless you have the server beside you)

Also - I can not even pretend to understand what you are trying to do.

Are you saying that .Html/JScript web page does not have the capability to send ascii or binary strings to an IP and Port Address?

Javascript can connect but you are missing one big important detail here I think.

The javascript in the webpage is running on your computer - not on the server.

Share this post


Link to post
Share on other sites

Thanks Zach...

The server located in the office is used to host online game play when the office is closed. I need methods other than remote desktop or remote admin to get the games up and running. I'm not always available to kick the server into action and want give a select few people the ability to do it. I had lost a friend because of his inappropraite actions elsewhere on the server.

I knew that JScript runs on the computer that is connected to the web page. I'll continue searching the net for JScript methods.

I'm also wondering if I can create client to tunnel to the server and get to the automated features that I had built months ago. I could skip the whole webpage piece and have the server's scheduler turn on the server-side piece after the office closes.

Share this post


Link to post
Share on other sites

Perhaps check out hamachi tunnel software http://hamachi.cc

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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  
Followers 0