Jump to content

jorgeng

Active Members
  • Posts

    120
  • Joined

  • Last visited

Everything posted by jorgeng

  1. Today users have to click manually on four files on the web after login, save as on local disk, ex c:\temp, then on web click on autoit-exe file which run install on a program at users c:\program directory. I want the process to copy the four files on web to c:\temp and then run autoit-exe file on web which uses the four files on c:\temp and install to c:\program.
  2. By mouse manuallay, save file...
  3. But when i am on the web i have no c: directory, so where do i copy from?
  4. Hello! I have a webplace where customers login and download files. I now want them to download files to their disk and run an autoit-script. I have problems with downloading the files from autoit-script: the code in autoit-script/exe: $dir = ("C:\Program\Friendly" ) FileCopy("nordr.dbf", $dir, 1) FileCopy("nordr.dbt", $dir, 1) FileCopy("nscript.dbf", $dir, 1) FileCopy("nscript.dbt", $dir, 1) Is it possible for users to download autoit-exe file which run the filecopy-command and store files on computer-harddisk, i can't get it to function. The user today click on autoit-exe-file which works and install things in the customers program.
  5. Hello! I have managed to do a tcp send. I was happy but then get new info that for every tcp send i will have to store information about customer and data sent in a database, table. I have read help-file that autoit supports sql commands but for what i can see there is only possible to have a table in memory. Is it possible to create an sql table and to insert of rows, update from autoit and store it on disk? I'm thinking of sqlite, see example: #include <SQLite.au3> #include <SQLite.dll.au3> Local $hQuery, $aRow, $sMsg _SQLite_Startup () _SQLite_Open () ; open :memory: Database _SQLite_Exec (-1, "CREATE TABLE aTest (a,b,c);") ; CREATE a Table _SQLite_Exec (-1, "INSERT INTO aTest(a,b,c) VALUES ('c','2','World');") ; INSERT Data _SQLite_Exec (-1, "INSERT INTO aTest(a,b,c) VALUES ('b','3',' ');") ; INSERT Data _SQLite_Exec (-1, "INSERT INTO aTest(a,b,c) VALUES ('a','1','Hello');") ; INSERT Data _SQlite_Query (-1, "SELECT c FROM aTest ORDER BY a;", $hQuery) ; the query While _SQLite_FetchData ($hQuery, $aRow) = $SQLITE_OK $sMsg &= $aRow[0] WEnd ;_SQLite_Exec (-1, "DROP TABLE aTest;") ; Remove the table MsgBox(0,"SQLite","Get Data using a Query : " & $sMsg ) _SQLite_Close() _SQLite_Shutdown() ;~ Output: ;~ ;~ Hello World
  6. I got error when i use this string: $szData = '<?xml version="1.0" encoding="Windows-1252" ?>' & @CRLF & _ '<Signal xmlns="http://borsdata.se/TESSignal.xsd">' & @CRLF & _ '<Version>1.0</Version>' & @CRLF & _ '<SignalType>Entry</SignalType>' & @CRLF & _ '<PositionType>Long</PositionType>' & @CRLF & _ '<Instrument>OMXS30-8GT</Instrument>' & @CRLF & _ '<Strategy>RankorTest</Strategy>' & @CRLF & _ '<Price>1005.00</Price>' & @CRLF & _ '<Weight>1</Weight>' & @CRLF & _ '<Comment>Omx Wampa Test...</Comment>' & @CRLF & _ '</Signal>"' & @CRLF & _ ; We should have data in $szData... lets attempt to send it through our connected socket. TCPSend($ConnectedSocket,$szData) ------------------------------ D:\Program\AutoIt3\RES.au3 (60) : ==> Error in expression.: $szData = '<?xml version="1.0" encoding="Windows-1252" ?>' & @CRLF & '<Signal xmlns="http://borsdata.se/TESSignal.xsd">' & @CRLF & '<Version>1.0</Version>' & @CRLF & '<SignalType>Entry</SignalType>' & @CRLF & '<PositionType>Long</PositionType>' & @CRLF & '<Instrument>OMXS30-8GT</Instrument>' & @CRLF & '<Strategy>RankorTest</Strategy>' & @CRLF & '<Price>1005.00</Price>' & @CRLF & '<Weight>1</Weight>' & @CRLF & '<Comment>Omx Wampa Test...</Comment>' & @CRLF & '</Signal>"' & @CRLF & $szData = ^ ERROR >Exit code: 1 Time: 30.398
  7. Thanks, i will try it.
  8. I'm trying to send an xml-string with the tcp send example in autoit help but it doesn't work, the problem is how i will concatenate the $szData string, how do i do that?: $ConnectedSocket = TCPConnect($szIPADDRESS,$nPORT) Dim $szData ; If there is an error... show it If @error Then MsgBox(4112,"Error","TCPConnect failed with WSA error: " & @error) ; If there is no error loop an inputbox for data to send to the SERVER. Else ; InputBox for data to transmit $szData = "<?xml version="1.0" encoding="Windows-1252" ?>" <Signal xmlns="http://borsdata.se/TESSignal.xsd">" <Version>1.0</Version> <SignalType>Entry</SignalType> <PositionType>Long</PositionType> <Instrument>OMXS308D</Instrument> <Strategy>RankorTest</Strategy> <Price>45.00</Price> <Weight>1</Weight> <Comment>Omx Wampa Test...</Comment> </Signal>" ; We should have data in $szData... lets attempt to send it through our connected socket. TCPSend($ConnectedSocket,$szData) ; If the send failed with @error then the socket has disconnected ; ---------------------------------------------------------------- If @error Then ExitLoop
  9. Ok, i will try it.
  10. Thanks, i think it will work, BUT i can't do an iniwrite since this will destroy my ta-program. I can't change anything in the ini-file since the ta-program owns the file and i can't mess in ini-file. Do you have another solution?
  11. Yes, the EP02 is uppdated every 15 second for different stocks or termins OMXS308E is a termin. The update is from my technical analysis-program. EP02 is updated if market is open every 15 second. Hope this helps...
  12. Sorry, the ORDER row comes from my technical analysis program i can't affect the values sent in row. Is this possible to do with comparing the $var variable?
  13. This is my code: $var = IniRead("D:\Program\FriendlyBörsActiveTrader\FBINET.INI", "SmsSendAs", "EP02", "NotFound") MsgBox(4096, "Result", $var) It will read every 5 second in a while-loop i have to check that the value now isn't the same as 5 seconds ago to prevent sending orders to dealer too often.... The text which came from $var is: 11:34 ORDER "sl) Omx Wampa Sellstop - Kl.11 - Rosa - Okrypterat OMXS308E" kurs 994.2500$
  14. Hello. I have managed to read a header in ini-file which is what i want. This is to send a buy/or sell-order from a technical analysis-program. What i want is to send this by tcp in future to the dealer. I can get information from section in ini-file, but my problem is that the order can't be sent every 15 second (expensive) until next order comes some day later. So how do you think i will solve this? One possibility is to store last message from ini-file with timestamp in a database table. Another one can be to write new value from ini-file to a new file and compare the results, then send the order. The purpose to compare text is that not sending the order to dealer several times... Anyone having done this before?
  15. Martin, i changed checkconnection from 2000 to 10000 and now it works. I also had to do a delay for 24000 in the start of script because my computer with vista is quite slow in startup - takes about 5 minutes to start. Thanks squireely1 too, if i get problems i will check your solution. Regards Jorgen
  16. Can someone check the code please, it doesn't work. Thanks
  17. Hello again. I tried script, goes ok first 15 minutes, then it restart the pc but internet is still up and running, so there is something in code which is not working. What?
  18. I tried the ping and it works, sadly i have many dropouts on my internet connection - adsl 8 mbit so just one dropout is enough to restart the pc. Is there any way to try the ping for example 10 times and if there then isn't any internet connection after 10 times restart the pc? How do i code this?
  19. Hello! I have an important stock-program running daily on my pc which can buy/sell stocks and gets new data every minute. It's critical that the program is running on daytime. Some times a week my pc looses connection to router and adsl 8 mbit connection. Then the stock program can't work. The only way to get connection to internet again for the stock program is to restart the pc with vista ultimate, sad but true. So i need an autoit-script checking internet-connection and if no internet for 5 minutes then force the pc to reboot. Anyone knowing what to theck for, killing certain processes and restart them? Thanks for advice.
  20. Hello. Three years ago i did this autoit-script but it doesn't work as intended. My intention is to have the script in autostart and that it will check the file nntermin.log if it isn't updated in four minutes and then kill the process fbinet.exe - two files named exactly the same and then start the program with some parameters. For some reason it restart fbinet.exe every four minute, anyone knowing what's wrong? ; Kontrollerar om filen nnlog.termin uppdaterats senaste 4 minuterna, om ej omstart Friendly Börs ; 2004-03-22 - Jorgeng Sleep ( 420000 ) $I = 1 While $I < 2 ; Scriptet körs Måndag-Fredag kl.09.30-17.30 när börsen är öppen If @WDAY = 2 Or @WDAY = 3 Or @WDAY = 4 Or @WDAY = 5 Or @WDAY =6 Then ; If @HOUR >= 9 And @MIN > 30 Then ; If @HOUR < 18 And @MIN < 30 Then $t = FileGetTime("D:\Program\FriendlyBörsActiveTrader\nntermin.log", 2) If Not @error Then $filetime=$t[4]+($t[3]*60)+($t[2]*60*24)+($t[1]*30*24*60)+($t[0]*365*24*60) $time=@min+(@hour*60)+(@mday*60*24)+(@mon*30*24*60)+(@year*365*24*60) If $time > $filetime + 2 Then MsgBox(0, "Omstart","Friendly Börs startas om - Nntermin.log ej uppdaterad på 4 minuter",5) If Not @error Then ProcessClose("FBINET.EXE") Sleep ( 2000 ) EndIf If Not @error Then ProcessClose("FBINET.EXE") EndIf If Not @error Then Sleep ( 5000 ) Run("D:\Program\FriendlyBörsActiveTrader\FBINET.EXE /X /P256", "D:\Program\FriendlyBörsActiveTrader\", @SW_MAXIMIZE) EndIf Endif EndIf ; Endif ; Endif Endif Sleep ( 120000 ) Wend
×
×
  • Create New...