Jump to content

ondrajka

Members
  • Posts

    17
  • Joined

  • Last visited

ondrajka's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I've tried help and the forums but don't quite know what I'm looking for so it's hard to search. Looking for something similar to If ProcessExists ("whatever.exe") Then $a=1 Only for a script i.e. If ScriptExists ("scriptname.au3") Then $a=1 I can't use ProcessExists because all au3 have the same process name.
  2. Here is my countdown timer that will also count up after it reaches zero. Was wondering how to do autoit math with remainders and non base 10 numbers. This was my test project just to see if it could be done. #include <Date.au3> $u=0; loop until $date = _DateAdd( 's',864015, _NowCalc()) $time = InputBox("Target Date", "Default 10 Days 15 Seconds" & @CRLF & "YYYY/MM/DD HH:MM:SS", $date) Do Sleep(1000) $td = _DateDiff('s', _NowCalc(), $time) $late = ""; dummy neg no If $td < 0 Then $late = "-"; dummy neg yes If $td < 0 Then $td = -$td; convert neg $td to pos for math $d = 0; Days with remainder math If $td > 86400 Then $dm = $td Do $dm = $dm - 86400 $d = $d + 1 Until $dm < 86400 EndIf $h = 0; Hours with remainder math If $td - ($d * 86400) > 3600 Then $hm = $td - ($d * 86400) Do $hm = $hm - 3600 $h = $h + 1 Until $hm < 3600 EndIf $m = 0; Miutes with remainder math If $td - ($d * 86400) - ($h * 3600) > 60 Then $mm = $td - ($d * 86400) - ($h * 3600) Do $mm = $mm - 60 $m = $m + 1 Until $mm < 60 EndIf $s = $td - ($d * 86400) - ($h * 3600) - ($m * 60); Seconds $db = ""; non zero for 2 digit numbers $hb = "" $mb = "" $sb = "" If $d < 10 Then $db = 0; zero for 1 digit number If $h < 10 Then $hb = 0 If $m < 10 Then $mb = 0 If $s < 10 Then $sb = 0 ToolTip("Target Date " & $time & @CRLF & "Time Left " & $late & $db & $d & ":" & $hb & $h & ":" & $mb & $m & ":" & $sb & $s, 10, 10) Until $u = 1
  3. Just a simple one. Is there a way to change the size of Gui text?
  4. You pointed me in the right direction. Since it isn't an autoit gui that command won't work. Had to use a command that used window title and control ID. $var=ControlGetText ( "(Multiple Monitors) and ATI MOBILITY RADEON Xpress 200 Series Properties", "", 1672) Msgbox (0,"", $var)
  5. I want to capture the text from an edit box and convert it to a $var. Below is the moused over frozen information. >>>> Window <<<< Title: (Multiple Monitors) and ATI MOBILITY RADEON Xpress 200 Series Properties Class: #32770 Position: 1, 4 Size: 484, 577 Style: 0x94C820C4 ExStyle: 0x00010501 Handle: 0x002B0352 >>>> Control <<<< Class: Edit Instance: 1 ClassnameNN: Edit1 Advanced (Class): [CLASS:Edit; INSTANCE:1] ID: 1672 Text: Position: 327, 236 Size: 29, 17 ControlClick Coords: 11, 9 Style: 0x58010080 ExStyle: 0x00000204 Handle: 0x00090540 >>>> Mouse <<<< Position: 342, 278 Cursor ID: 2 Color: 0xE0DFE3 >>>> StatusBar <<<< >>>> Visible Text <<<< Color Brightness: 0.5 3.5 List1 De&faults List1 List1 &Desktop F&ull Screen 3D Profiles for: Desktop &Save All Colors Red Green Blue Gamma: 100 -100 Slider1 Slider1 Slider1 Contrast: 1.00 Spin1 0 Spin1 100 Spin1 Reset D&elete 0 200 &Hotkeys OK Cancel &Apply Help
  6. I was also looking for a way to make a power meter. I didn't find anything on the forums but stumbled on this on my own. I'm posting this on the posts that were talking about power meters. This works on my Compaq running XP. It will import even it the window is hidden. I do have the icon set to always show in the taskbar. $power1 imports the words Batteries or AC Power and $power2 imports the battery life in percent. $power1 = ControlGetText("Power Meter", "", "Static6") $power2 = ControlGetText("Power Meter", "", "Static8") msgbox (0,"", $power1 & " " & $power2)
  7. I was also looking for a way to make a power meter. I didn't find anything on the forums but stumbled on this on my own. I'm posting this on the posts that were talking about power meters. This works on my Compaq running XP. It will import even it the window is hidden. I do have the icon set to always show in the taskbar. $power1 imports the words Batteries or AC Power and $power2 imports the battery life in percent. $power1 = ControlGetText("Power Meter", "", "Static6") $power2 = ControlGetText("Power Meter", "", "Static8") msgbox (0,"", $power1 & " " & $power2)
  8. Yeah thanks it was the scroll wheel, well sorta, I was using my laptop w/o a mouse and must have tapped the edge of the touchpad.
  9. I was using the cut, paste and undo hot keys. Somehow I fat fingered the keyboard and the autoit code text doubled in size. Anyone know how to fix it? I don't see the option in any of the menus.
  10. I am looking for a function to help with clutter in my script. I have a cluster of 47 lines that I have cut and pasted several times. What I want to do is nest them under something like an array and just call for the array and have it execute my nested commands. i.e. Subscript[1]Start $min=PixelGetColor($x,$y) $trig=PixelGetColor($x+$per,$y) $trig2=PixelGetColor($x+$per2,$y) If $min<>2100491 And $trig2=2888206 OR $min<>2100491 And $trig=2888206 Then $gh=$gh+1 Subscript[1]End So if I wanted to run the above 4 lines i could just use a command like. Run Subscript[1]
  11. This here is a bot I use to load web comics every morning. It opens Firefox, types in an address from a list, waits for the word done to appear in the status bar, or times out. It then opens a new tab and types in another address, waits and then loops new tabs/waits until the list of addresses is loaded. It also imports the bytes received from the task manager and writes a Gui box that lists some stats and compares them to the last run. I use it to load 140 web pages. I use Firefox with standard skin because of Adblock and Firefox has no tab limit that I've seen. I use it under XP. Task manager has to open to the networking tab with adapter name, bytes sent, and bytes received checked under view, select columns. Also is included 2 scripts to delete "$Array[#]=" from the list and another to re number it if you were to edit the middle of the list. #cs ------------------------ $a is sleep after tab open $b is loop timeout $c is number of arrays "starts with 0 i.e. last number +1" $x (1st screeb) is horz = 11 $y (1st screen) is vert = vert rez -13 1 start bar + -34 additional bars + -30 x2 (2nd screen) is 1st screen rez +11 y2 (2nd screen) is vert rules above used var = $a $b $c $t $t2 $x $y $x2 $y2 $ar $dif $net $var $var2 $begin $title $hListView $classDetails $02s,e,f $12s,e,f $22s,e,f $loadsc,d,l $runc,d,l $asecc,d,l $tmbc,d,l $ambc,d,l $aksecc,d,l #ce ------------------------ #include <Array.au3> #include <GuiListView.au3> #include <GuiConstantsEx.au3> autoitsetoption ( "SendKeyDelay", 50 ) $a=100 $b=120000 $c=2 $x=11 $y=787 $x2=1291 $y2=755 $ar=0 $begin=TimerInit() Run("C:\WINDOWS\system32\taskmgr.exe") WinWait("Windows Task Manager") $title="Windows Task Manager" $classDetails="SysListView321" $02s=ControlListView($title,"",$classDetails, "GetText",0,2) $12s=ControlListView($title,"",$classDetails, "GetText",1,2) $22s=ControlListView($title,"",$classDetails, "GetText",2,2) Local $Array[$c] $Array[0]="www.comics.com/think/{ENTER}" $Array[1]="www.comics.com/andy_singer/{ENTER}" Run("C:\Program Files\Mozilla Firefox\firefox.exe") WinWait("Mozilla Firefox") $t=TimerInit() Do sleep(250) $t2=TimerDiff($t) $var=PixelGetColor($x,$y) $var2=PixelGetColor($x2,$y2) Until $var=0x40408f OR $var2=0x40408f OR $t2>$b Do send ( "^t" ) WinWait("Mozilla Firefox") Sleep ($a) send ($Array[$ar]) $ar=$ar+1 $t=TimerInit() do sleep (250) $t2 = TimerDiff($t) $var=PixelGetColor($x,$y) $var2=PixelGetColor($x2,$y2) Until $var=0x40408f OR $var2=0x40408f OR $t2>$b Until $ar=$c $02e=ControlListView($title,"",$classDetails, "GetText",0,2) $12e=ControlListView($title,"",$classDetails, "GetText",1,2) $22e=ControlListView($title,"",$classDetails, "GetText",2,2) $02s=StringRegExpReplace($02s, ",", "") $12s=StringRegExpReplace($12s, ",", "") $22s=StringRegExpReplace($22s, ",", "") $02e=StringRegExpReplace($02e, ",", "") $12e=StringRegExpReplace($12e, ",", "") $22e=StringRegExpReplace($22e, ",", "") $02f=$02e-$02s $12f=$12e-$12s $22f=$22e-$22s $net=$02f If $net=0 Then $net=$12f If $net=0 Then $net=$22f $dif = TimerDiff($begin) ProcessClose ( "taskmgr.exe") $loadsc=($ar+1) $loadsl=IniRead("c:\0 Backup\Auto Script Writer\bots\stats.ini", "$loadsc", "key", "NotFound") $loadsd="=" If $loadsc>$loadsl Then $loadsd=">" If $loadsc<$loadsl Then $loadsd="<" $runc=(round ($dif/60000,2)) $runl=IniRead("c:\0 Backup\Auto Script Writer\bots\stats.ini", "$runc", "key", "NotFound") $rund="=" If $runc>$runl Then $rund=">" If $runc<$runl Then $rund="<" $asecc=(round ($dif/1000/($ar+1),2)) $asecl=IniRead("c:\0 Backup\Auto Script Writer\bots\stats.ini", "$asecc", "key", "NotFound") $asecd="=" If $asecc>$asecl Then $asecd=">" If $asecc<$asecl Then $asecd="<" $tmbc=(round ($net/1048576,2)) $tmbl=IniRead("c:\0 Backup\Auto Script Writer\bots\stats.ini", "$tmbc", "key", "NotFound") $tmbd="=" If $tmbc>$tmbl Then $tmbd=">" If $tmbc<$tmbl Then $tmbd="<" $ambc=(round ($net/1048576/($ar+1),2)) $ambl=IniRead("c:\0 Backup\Auto Script Writer\bots\stats.ini", "$ambc", "key", "NotFound") $ambd="=" If $ambc>$ambl Then $ambd=">" If $ambc<$ambl Then $ambd="<" $aksecc=(round ($net/1024/($dif/1000),2)) $aksecl=IniRead("c:\0 Backup\Auto Script Writer\bots\stats.ini", "$aksecc", "key", "NotFound") $aksecd="=" If $aksecc>$aksecl Then $aksecd=">" If $aksecc<$aksecl Then $aksecd="<" IniWrite("c:\0 Backup\Auto Script Writer\bots\stats.ini", "$loadsc", "key", $loadsc) IniWrite("c:\0 Backup\Auto Script Writer\bots\stats.ini", "$runc", "key", $runc) IniWrite("c:\0 Backup\Auto Script Writer\bots\stats.ini", "$asecc", "key", $asecc) IniWrite("c:\0 Backup\Auto Script Writer\bots\stats.ini", "$tmbc", "key", $tmbc) IniWrite("c:\0 Backup\Auto Script Writer\bots\stats.ini", "$ambc", "key", $ambc) IniWrite("c:\0 Backup\Auto Script Writer\bots\stats.ini", "$aksecc", "key", $aksecc) _Main() Func _Main() Local $hListView GUICreate("End Stats", 240, 200) $hListView = GUICtrlCreateListView("", 2, 2, 230, 168) GUISetState() _GUICtrlListView_InsertColumn($hListView, 0, "Item", 105) _GUICtrlListView_InsertColumn($hListView, 1, "Value", 50) _GUICtrlListView_InsertColumn($hListView, 2, "", 20) _GUICtrlListView_InsertColumn($hListView, 3, "Last", 50) _GUICtrlListView_AddItem($hListView, "Loads", 0) _GUICtrlListView_AddSubItem($hListView, 0, $loadsc, 1) _GUICtrlListView_AddSubItem($hListView, 0, $loadsd, 2) _GUICtrlListView_AddSubItem($hListView, 0, $loadsl, 3) _GUICtrlListView_AddItem($hListView, "Runtime Min", 1) _GUICtrlListView_AddSubItem($hListView, 1, $runc, 1) _GUICtrlListView_AddSubItem($hListView, 1, $rund, 2) _GUICtrlListView_AddSubItem($hListView, 1, $runl, 3) _GUICtrlListView_AddItem($hListView, "Average Sec", 2) _GUICtrlListView_AddSubItem($hListView, 2, $asecc, 1) _GUICtrlListView_AddSubItem($hListView, 2, $asecd, 2) _GUICtrlListView_AddSubItem($hListView, 2, $asecl, 3) _GUICtrlListView_AddItem($hListView, "Total MB", 3) _GUICtrlListView_AddSubItem($hListView, 3, $tmbc, 1) _GUICtrlListView_AddSubItem($hListView, 3, $tmbd, 2) _GUICtrlListView_AddSubItem($hListView, 3, $tmbl, 3) _GUICtrlListView_AddItem($hListView, "Average MB", 4) _GUICtrlListView_AddSubItem($hListView, 4, $ambc, 1) _GUICtrlListView_AddSubItem($hListView, 4, $ambd, 2) _GUICtrlListView_AddSubItem($hListView, 4, $ambl, 3) _GUICtrlListView_AddItem($hListView, "Average Kb/Sec", 5) _GUICtrlListView_AddSubItem($hListView, 5, $aksecc, 1) _GUICtrlListView_AddSubItem($hListView, 5, $aksecd, 2) _GUICtrlListView_AddSubItem($hListView, 5, $aksecl, 3) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc sleep(3000) $a=0 Do send("{home}$Array[") send($a) send("]={down}") $a=$a+1 Until $a=140 Sleep (3000) $a=0 Do send ("{home}{del 10}{down}") $a=$a+1 until $a=10;0-9 $a=0 Do send ("{home}{del 11}{down}") $a=$a+1 Until $a=90;10-99 $a=0 Do send ("{home}{del 12}{down}") $a=$a+1 Until $a=42;100- array value +1Array_.au3 ArrayDel.au3 Mozilla_Webpage_Bot.au3
  12. It works now ty.
  13. Cant seem to get it to save the $click var. After a button is pressed you get a yes or no was pressed msgbox. Click on ok and you get Error: varible used without being declared. #include <GUIConstantsEx.au3> Example() Func Example() Local $Button_1, $Button_2, $msg GUICreate("Yes No Box", 220, 75) Opt("GUICoordMode", 2) $Button_1 = GUICtrlCreateButton("Yes", 10, 30, 100) $Button_2 = GUICtrlCreateButton("No", 0, -1) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 MsgBox(0, 'Testing', 'Yes was pressed') $click="Yes" ExitLoop Case $msg = $Button_2 MsgBox(0, 'Testing', 'No was pressed') $click="no" ExitLoop EndSelect WEnd GUIDelete() EndFunc MsgBox(0, 'After', $click)
  14. It worked thanks
  15. Here is a cut and paste from my script. It works, but I would like to use the If...Then without the While If $min=4210712 Or $min=9324617 Then $b=1 While $b=1 Send("{NUMPAD1}5") Sleep($s) $b=0 $c=1 Wend
×
×
  • Create New...