
Jujo
Active Members-
Posts
20 -
Joined
-
Last visited
Jujo's Achievements

Seeker (1/7)
0
Reputation
-
Today I made a simple program that updates IP address using AutoIt and PHP. PHP keeps track of IPs, and AutoIt submits it. Note: You need hosting account with PHP support Heres AutoIt code: #Include <Constants.au3> #Include <IE.au3> #NoTrayIcon HotKeySet("{ESC}", "die") HotKeySet("{^F5}", "refresh") $wait = InputBox("Updater", "Waiting time: ", "21600", "", "", "", "", "", 10) $port = InputBox("Updater", "Port to submit: ", "1004", "", "", "", "", "", 10) If $wait = 0 Or $wait = "" Then $wait = 21600 EndIf If $port = 0 Or $port = "" Then $port = 1004 EndIf $wait = $wait * 1000 refresh() While 1 Sleep($wait) refresh() WEnd Func refresh() $object = _IECreate("URL/update.php?port=" & $port, 0, 1) _IEQuit($object) EndFunc Func die() Exit EndFunc You have to change URL to some URL where is your update.php script located. Here is update.php script source: <? $myFile = "data.txt"; $fh = fopen($myFile, 'w') or die("ERROR FILE 1"); $stringData = $_SERVER['REMOTE_ADDR'].':'.$_GET['port']; fwrite($fh, $stringData); fclose($fh); ?> And, for reading, you just need to load data.txt file in your browser. Save this PHP file as update.php and create empty file called data.txt I also recommend you to password protect the whole folder, but thats your choise
-
I get error running this: *****\lotto.au3 (11) : ==> Variable used without being declared.: $My_list = GUICreate($Title & " - My Numbers", 350, 340, 10, 10, $WS_POPUP + $WS_CAPTION) $My_list = GUICreate($Title & " - My Numbers", 350, 340, 10, 10, ^ ERROR
-
Never mind, it works perfectly now Thanks once again
-
I tried this, but I get error, I think that I need to include a DLL, but dont know where and which... ERROR: If _IsPressed("{LEFT}", $hUser32_Dll) Then If _IsPressed("{LEFT}", ^ ERROR EDIT: I looked help and included the misc.aue3 file like in help example, but still the same error EDIT2: I changed {LEFT} to 25, like the help says. Still error. Error says "Variable used without beign declared". It means $hUser32_DLL variable
-
Thanks, hope it works
-
Hi again, I need help for my program. I want to have function called on key press (e.g. Left arrow), but to exit function and call another one when that key is released. I now use HotKeySet, but I can't use it with key release: HotKeySet("{LEFT}", "left") HotKeySet("{RIGHT}", "right") HotKeySet("{UP}", "up") HotKeySet("{DOWN}", "down") HotKeySet("{SPACE}", "wait") I want that while {LEFT} is pressed, the left() function is called, and when {LEFT} is released, up() is called back. Thanks
-
Hi every1. It's me again I need some more help with my Velleman P8055 (K8055) board. In one topic I found how to load its functions to AutoIt from DLL. That is all clean without problem: Func USBOpenDevice($CardAddress) $result = DLLCall("k8055d.dll", "int", "OpenDevice", "int", $CardAddress) Return $result[0] EndFunc Func USBCloseDevice() $result = DLLCall("k8055d.dll", "none", "CloseDevice") Return;;$result[0] EndFunc Func USBReadAnalogChannel($Channel) $result = DLLCall("k8055d.dll", "int", "ReadAnalogChannel", "int", $Channel) Return $result[0] EndFunc Func USBOutputAnalogChannel($Channel, $Data) $result = DLLCall("k8055d.dll", "none", "OutputAnalogChannel", "int", $Channel, "int", $Data) EndFunc Func USBOutputAllAnalog($Data1, $Data2) $result = DLLCall("k8055d.dll", "none", "OutputAllAnalog", "int", $Data1, "int", $Data2) EndFunc Func USBClearAnalogChannel() $result = DLLCall("k8055d.dll", "none", "ClearAnalogChannel") EndFunc Func USBSetAllAnalog() $result = DLLCall("k8055d.dll", "none", "SetAllAnalog") EndFunc Func USBClearAllAnalog() $result = DLLCall("k8055d.dll", "none", "ClearAllAnalog") EndFunc Func USBSetAnalogChannel($Chanel) $result = DLLCall("k8055d.dll", "none", "SetAnalogChannel", "int", $Channel) EndFunc Func WriteAllDigital($Data) $result = DLLCall("k8055d.dll", "none", "WriteAllDigital", "int", $Data) EndFunc Func USBClearDigitalChannel($Channel) $result = DLLCall("k8055d.dll", "none", "ClearDigitalChannel", "int", $Channel) EndFunc Func USBClearAllDigital() $result = DLLCall("k8055d.dll", "none", "ClearAllDigital") EndFunc Func USBSetDigitalChannel($Channel) $result = DLLCall("k8055d.dll", "none", "SetDigitalChannel", "int", $Channel) EndFunc Func USBSetAllDigital() $result = DLLCall("k8055d.dll", "none", "SetAllDigital") EndFunc Func USBReadDigitalChannel($Channel) $result = DLLCall("k8055d.dll", "bool", "ReadDigitalChannel", "int", $Channel) Return $result[0] EndFunc Func USBReadAllDigital() $result = DLLCall("k8055d.dll", "int", "ReadAllDigital") Return $result[0] EndFunc Func USBReadCounter() $result = DLLCall("k8055d.dll", "int", "ReadCounter") Return $result[0] EndFunc Func USBResetCounter($count) $result = DLLCall("k8055d.dll", "none", "ResetCounter", "int", $count) EndFunc Func USBSetCounterDebounceTime($count, $detime) $result = DLLCall("k8055d.dll", "none", "SetCounterDebounceTime", "int", $count,"int", $detime) EndFunc But, now, I typed a very simple program: USBOpenDevice(0) USBSetDigitalChannel(1) At the top, I added include function, which successfully includes functions file. The problem is that this program DOES NOT WORK - it doesn't turn on LD1, which it is supposed to do when USBSetDigitalChannel(x) is called (x is channel # - from1 to 8 ) Please, help me if anyone can. Also, if any1 uses this interface for robotics, can u tell me how do u control it thru AutoIt? Thanks
-
Thanks
-
Hi, folks. I have become very familiar with AutoIt, and I just love it I use it for everyday actions while starting up PC and that stuff, as well as in school. So, today I need some help. I have function that has 8 parameters named $1, $2, $3, etc. and in that function I have a For chain that is supposed to do an action depending on parameter's value (0 or 1). This is what I have: For $i = 1 To 7 Step 1 If ($[$i] = 1) Then USBSetDigitalChannel($i) ElseIf ($[$i] = 0) Then USBClearDigitalChannel($i) EndIf Next As you can see, I have the whole code except the $[$i] part, since I have no idea how to use current $i value as variable name. So, please help me. Thanks P.S. I now use If... Else for every parameter (that is 8 loops), but that is pretty slow and I don't think it will work. Also, what would happen if I have random number of variables, or 100 variables TY
-
Many thanks for the first code (declaring functions), nfwu. Just needed that AutoIt is just gr8! THX once again
-
I know this is old topic but I need this I get error when indexing....
-
I would like to see this program working (I play OGame), but I get error when running this code: **********ogame.au3 (145) : ==> Variable used without being declared.: GuiCreate("How Much Longer? V3.5.2", 1000, 360,(@DesktopWidth-1000)/2, (@DesktopHeight-360)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) GuiCreate("How Much Longer? V3.5.2", 1000, 360,(@DesktopWidth-1000)/2, (@DesktopHeight-360)/2 , ^ ERROR >Exit code: 1 Time: 0.627 What is the problem?
-
Still same thing Any way that u upload it somewhere normal? Like rapidshare, or even better - here... EDIT: I did use right click etc...
-
Download link DOWN!!! Please reupload
-
Thanks for help I tought it will be problem with same names, but...