
Dead_Man
Active Members-
Posts
41 -
Joined
-
Last visited
Dead_Man's Achievements

Seeker (1/7)
0
Reputation
-
See when 12 hours have passed since last run
Dead_Man replied to Dead_Man's topic in AutoIt General Help and Support
I see, thank you -
I feel like this is really simple and I'm missing something, here what i have so far. if FileExists("Time.ini") = 0 Then $FirstRun = 1 IniWrite("Time.ini","Time","Time",TimerInit()) EndIf while 1 Sleep(1000) if $FirstRun = 1 or TimerDiff(IniRead("Time.ini","Time","Time",0)) > 43210000 Then ; 12 hours = 43210000ms ;~~ Script here IniWrite("Time.ini","Time","Time",TimerInit()) Exit EndIf WEnd Works until i restart my pc and the handle dies
-
Counting in Multidimensional Arrays
Dead_Man replied to Dead_Man's topic in AutoIt General Help and Support
Its pretty much a score for another project of mine, every time their name is listed add a point, so I'm just making it a tree for how many people are there for the first [0], and the second is their name and how many times they've been listed. Also this is my first time working with multidimensional arrays so i just wanted to get some practice using them even if there was another way. Thank you for all your help, i really appreciate it! Edit: NM just got what you meant, bad programming i guess. thanks for pointing that out. -
I'm working on a script at the moment for practice but i think I've taken a wrong turn, the intended result is to keep adding names to this array and if two or more names match it'll just increase a count next to their name. Heres what i have so far: Global $Names[3] = ["Harry Potter","Harry Potter","Hermione Granger"] Global $NameCount[1][2] ; [Index][Name, Count] $NameCount[0][0] = 0 For $a = 0 to UBound($Names)-1 step 1 $Input = $Names[$a] $iSize = UBound($NameCount, 1) ReDim $NameCount[$iSize + 1][2] $NameCount[0][0] = $iSize $NameCount[$iSize][0] = $Input for $i = 1 to $NameCount[0][0] if $Input = $NameCount[$i][0] Then $NameCount[$i][1] += 1 ;ReDim $NameCount[$iSize+1][2] EndIf Next For $i = 1 to $NameCount[0][0] ConsoleWrite($NameCount[$i][0] & ": " & $NameCount[$i][1] & @CRLF) Next ConsoleWrite(@CRLF) next Expected Output: Current Output:
-
Anyway to work with style sheets? I'd usually share the source of where am at, but I'm stuck at _IEAttach'ing to the window & staring at MSDN
-
Default Menu: Icon Selected: Menu after select: Can I do something like this in Autoit? I'm just looking for the functions if it is possible
-
That seems to do the trick, I'll post again if it starts happening again, thank
-
When i open the 2nd FileOpenDialog in this script sometimes it will crash without an error other then "!>18:12:18 AutoIT3.exe ended.rc:-1073741819", what could be causing it? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("GIF to JPG", 373, 65, 191, 124) $GIF_InputBox = GUICtrlCreateInput("", 8, 8, 297, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $JPG_InputBox = GUICtrlCreateInput("", 8, 36, 297, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY)) $GIF_Button = GUICtrlCreateButton(".GIF", 315, 8, 49, 21, 0) $JPG_Button = GUICtrlCreateButton(".JPG", 315, 36, 49, 21, 0) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GIF_Button $GIF_Location = FileOpenDialog("Select .GIF",@DesktopDir, "GIF Files (*.GIF)",1) GUICtrlSetData($GIF_InputBox,$GIF_Location) Case $JPG_Button $JPG_Location = FileOpenDialog("Select .JPG",@DesktopDir, "JPG Files (*.JPG)",1) GUICtrlSetData($JPG_InputBox,$JPG_Location) EndSwitch WEnd
-
so far this script is ~86% done, just have some problems ( the biggest being the background function ) general things i cant figure out: Gray out the tray option 'Show Main Console' until in background modeBackground mode bugs: Resume music after returning from background mode ( it just plays once and quits instead of going back to a loop )Tray commands dont work when in background mode ( maybe because i use sleep(30000) for check delay? )( i also sometimes get "IE.au3 V2.3-1 Warning from function _IECreate (Foreground Window Unlock Failed!)" when using the Refresh function but it still works )also if you know a better way to write something then i wrote it please share #include <GUIConstants.au3> #include <Date.au3> #include <IE.au3> #Include <XSkin.au3> ;http://www.autoitscript.com/forum/index.php?showtopic=32494 #Include <Sound2.au3> ;http://www.autoitscript.com/forum/index.php?showtopic=30123 #Include <Constants.au3> #NoTrayIcon Opt("TrayMenuMode", 1) $Skin_Folder = @ScriptDir & "\Skin\" $sLongMonthName = _DateToMonth(@MON) ;@Mon returned "01" when i needed just "1", this is just a workaround if $sLongMonthName = "January" Then $Month = 1 ElseIf $sLongMonthName = "February" Then $Month = 2 ElseIf $sLongMonthName = "March" Then $Month = 3 ElseIf $sLongMonthName = "April" Then $Month = 4 ElseIf $sLongMonthName = "May" Then $Month = 5 ElseIf $sLongMonthName = "June" Then $Month = 6 ElseIf $sLongMonthName = "July" Then $Month = 7 ElseIf $sLongMonthName = "August" Then $Month = 8 ElseIf $sLongMonthName = "September" Then $Month = 9 ElseIf $sLongMonthName = "October" Then $Month = 10 ElseIf $sLongMonthName = "November" Then $Month = 11 ElseIf $sLongMonthName = "December" Then $Month = 12 EndIf Global $sHTML Global $CACHE Global $Count Global $Tray_Restore Global $Month Global $Website = "http://mavenswowaccounts.110mb.com/" & $Month & "-" & @MDay & "-08" & ".html" Global const $Backgroundcolor = 0x313131 Global Const $Fontcolor = 0x23A795 ConsoleWrite("Current URL: " & $Website & @LF) $XSkinGui = XSkinGUICreate( "Account Grabber", 600, 200, $Skin_Folder) GUISetState(@SW_SHOW) $refresh = XSkinButton("Refresh" ,20,50,90,20,"Refresh") $Background_Mode = XSkinButton("B",500,12,13,17,"Background") $Minimize = XSkinButton("_",515,12,13,17,"Minimize") $Close = XSkinButton("X",530,12,13,17,"Close") $Manage = XSkinButton("Change Password",120,50,100,20,"Password") $Debug = GUICtrlCreateCheckbox("",480,12,13,17) $Tray_Restore = TrayCreateItem("Show Main Console") TrayCreateItem("") $Tray_Close = TrayCreateItem("Exit") $sound = _SoundOpen(@scriptdir & "/Sound/90d.wav", "loop") _SoundPlay($sound, 0) TraySetState() while 1 If _SoundPos($sound, 2) = _SoundLength($sound, 2) Then _SoundPlay($sound) $msg = GUIGetMsg() $traymsg = TrayGetMsg() MouseOver() Select Case $traymsg = 0 ContinueLoop Case $traymsg = $Tray_Restore GUISetState(@SW_Show) Case $traymsg = $Tray_Close exit EndSelect WEnd func Refresh() if GUICtrlRead($Debug) = $GUI_CHECKED then $Website = "http://mavenswowaccounts.110mb.com/" & $Month & "-" & @MDay-2 & "-08" & ".html" ConsoleWrite("Using Website: " & $Website & "(DEBUGGER)" & @CRLF) ElseIf GUICtrlRead($Debug) = $GUI_UNCHECKED then $Website = "http://mavenswowaccounts.110mb.com/" & $Month & "-" & @MDay & "-08" & ".html" ConsoleWrite("Using Website: " & $Website & @CRLF) EndIf $oIE = _IECreate($Website,"",0) $size = InetGetSize($Website) $sHTML = _IEBodyReadText ($oIE) ProcessClose("iexplore.exe") $Edit = GUICtrlCreateEdit($sHTML,20,75,500,90,$ES_READONLY+$WS_VSCROLL) GUICtrlSetBkColor($edit,$Backgroundcolor) GUICtrlSetColor(-1,$Fontcolor) $CACHE = IniRead("Cache.ini","Website Cache","Filesize","") if $size = 6311 or $size = 0 Then TrayTip("Account Grabber", "Daily Accounts Have Not Been Uploaded.", 5, 1) elseif $size <> $CACHE then TrayTip("Account Grabber", "Website Updated!", 5, 1) IniWrite("Cache.ini","Website Cache","Filesize",$size) EndIf EndFunc func Background() $hide = GUISetState(@SW_Hide) ; HotKeySet("{F6}","Restore") Would rather have it so you use the tray icon then pressing F6 _SoundPause($sound) while $hide sleep(30000) ConsoleWrite("30 seconds" & @LF) $size = InetGetSize($Website) $CACHE = IniRead("Cache.ini","Website Cache","Filesize","") if $size = 6311 or $size = 0 Then GUIGetMsg() elseif $size <> $CACHE then TrayTip("Account Grabber", "Website Updated, loading new page now", 5, 1) IniWrite("Cache.ini","Website Cache","Filesize",$size) $oIE = _IECreate($Website,"",0) $size = InetGetSize($Website) $sHTML = _IEBodyReadText ($oIE) ProcessClose("iexplore.exe") ExitLoop EndIf WEnd EndFunc #cs func Restore() GUISetState(@SW_SHOW) _SoundResume($sound) while 1 If _SoundPos($sound, 2) = _SoundLength($sound, 2) Then _SoundPlay($sound) WEnd EndFunc #ce Func Password() $oIE = ObjCreate("Shell.Explorer.2") $XSkinChildGUI = XSkinGUICreate("", 500, 500, $Skin_Folder) $Minimize = XSkinButton("_",415,12,13,17,"Minimize") $Close = XSkinButton("X",430,12,13,17,"Close2") $GUIActiveX = GUICtrlCreateObj ( $oIE, 20,50,460,420 ) $oIE.navigate("https://www.worldofwarcraft.com/login/login?service=https%3A%2F%2Fwww.worldofwarcraft.com%2Faccount%2Fchange-password.html") GUISetState(@SW_SHOW) EndFunc Func Minimize() GUISetState(@SW_MINIMIZE) EndFunc Func Close() exit EndFunc func close2() GUISetState(@SW_hide) EndFunc if you want me make a rar with the files needed to run just ask
-
Easy to fix error yet cant figure it out
Dead_Man replied to Dead_Man's topic in AutoIt General Help and Support
thanks a lot and i don't mind at all, i never learned switches and thats why i didn't do them, guess its time to learn -
Easy to fix error yet cant figure it out
Dead_Man replied to Dead_Man's topic in AutoIt General Help and Support
thanks for the tip on how to update labels without creating new ones, but it wont help me with the problem im having -
im making this for myself to play with GUI functions, my problem is the ""Next keypress will be" section, it displays the most recent key pressed instead of the next one to be pressed #include <GUIConstants.au3> GUICreate("Bot Status",250,110,"","","",$WS_EX_STATICEDGE) $font="Comic Sans MS" GUISetFont(10,"","",$font) GUISetState (@SW_SHOW) GUICtrlCreateLabel("The Bot is Idle. ","","") WinSetOnTop("Bot Status","",1) HotKeySet("{F1}", "moveon") if not ProcessExists("wow.exe") Then GUICtrlCreateLabel("Please start wow.","","") While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd func moveon() GUICtrlCreateLabel("The Bot is Moving Around.","","") HotKeySet("{F1}", "rest") While 1 $rand = Random(1,5,1) ; 1 = up, 2 = left, 3 = right, 4 = down, 5 = jump $timer = Random(30000,120000,1) ; 30 seconds to 2min GUICtrlCreateLabel("Next keypress will be:",1,+52) if $rand = 1 then GUICtrlCreateLabel("up. ",147,+52) ElseIf $rand = 2 Then GUICtrlCreateLabel("left. ",147, +52) ElseIf $rand = 3 then GUICtrlCreateLabel("right. ",147,+52) Elseif $rand = 4 Then GUICtrlCreateLabel("down. ",147,+52) ElseIf $rand = 5 Then GUICtrlCreateLabel("Space. ",147,+52) EndIf if round($timer/1000) > 61 Then GUICtrlCreateLabel("Time until next action: 1min " & round($timer/1000-60,0) & " seconds. ",0,+30) ElseIf round($timer/1000) < 61 Then GUICtrlCreateLabel("Time until next action: " & round($timer/1000,0) & " seconds. ",0,+30) EndIf if $rand = 1 Then Send("{up down}") sleep(200) Send("{up up}") Sleep($timer) Elseif $rand = 2 Then Send("{left down}") sleep(200) Send("{left up}") sleep($timer) ElseIf $rand = 3 Then Send("{Right down}") sleep(200) Send("{right up}") sleep($timer) ElseIf $rand = 4 then Send("{down down}") sleep(200) Send("{down up}") Sleep($timer) Elseif $rand = 5 Then Send("{space}") Sleep($timer) EndIf WEnd EndFunc func rest() GUICtrlCreateLabel("The Bot is Idle. ","","") GUICtrlCreateLabel(" ",0,20) GUICtrlCreateLabel(" ",0,52) HotKeySet("{F1}", "moveon") while 1 sleep(100) WEnd EndFunc
-
first of all I'm making this for wow, its a basic bot to move you around that i gave a GUI to, my problem is when i try and make the window count down until the next function is performed, the script doesnt work ( my progress is commented out ) this is what i have so far. Problems i have from the progress I've made so far 1) most of the time the timer doesn't show ( ~80%) 2) if it does show, it doesn't count down ; use F1 to turn on and off #include <GUIConstants.au3> GUICreate("Bot Status",250,100,"","","",$WS_EX_STATICEDGE) $font="Comic Sans MS" GUISetFont(10,"","",$font) GUISetState (@SW_SHOW) GUICtrlCreateLabel("The Bot is Idle. ","","") WinSetOnTop("Bot Status","",1) HotKeySet("{F1}", "moveon") HotKeySet("{F2}", "Spamheal") HotKeySet("{F3}", "Vanishdown") While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop if not ProcessExists("wow.exe") Then ExitLoop WEnd func moveon() GUICtrlCreateLabel("The Bot is Moving Around.","","") HotKeySet("{F1}", "rest") While 1 $rand = Random(1,5,1) ; 1 = up, 2 = left, 3 = right, 4 = down, 5 = jump $timer = Random(30000,120000,1) ; 30 seconds to 2min if $rand = 1 Then ControlSend("World of Warcraft", "","","{up down}") sleep(200) ControlSend("World of Warcraft", "","","{up up}") Sleep($timer) ;for $timer = $timer to 1 step -1 ; GUICtrlCreateLabel("Time Until Next Action: " & Round($timer/1000,0) & " seconds.",0,+30) ;Next ;ExitLoop Elseif $rand = 2 Then ControlSend("World of Warcraft", "","","{left down}") sleep(200) ControlSend("World of Warcraft", "","","{left up}") sleep($timer) ElseIf $rand = 3 Then ControlSend("World of Warcraft", "","","{Right down}") sleep(200) ControlSend("World of Warcraft", "","","{right up}") sleep($timer) ElseIf $rand = 4 then ControlSend("World of Warcraft", "","","{down down}") sleep(200) ControlSend("World of Warcraft", "","","{down up}") Sleep($timer) Elseif $rand = 5 Then ControlSend("World of Warcraft", "","","{space}") Sleep($timer) EndIf WEnd EndFunc func Spamheal() GUICtrlCreateLabel("The Bot is Spamming Heal. ","","") HotKeySet("{F2}", "rest") while 1 $rand3 = random(1,20,1) $rand2 = Random(1,20,$rand3) $sleep = Random(100,200,$rand2) ControlSend("World of Warcraft", "","","{1}") sleep($sleep) MouseClick("left") sleep($sleep) WEnd EndFunc func rest() GUICtrlCreateLabel("The Bot is Idle. ","","") GUICtrlCreateLabel(" ",0,+20) HotKeySet("{F1}", "moveon") HotKeySet("{F2}", "Spamheal") while 1 sleep(100) WEnd EndFunc func vanishdown() HotKeySet("{F3}","vanishup") for $stealth = 255 to 0 step -2 WinSetTrans("Bot Status","",$stealth) Next EndFunc func vanishup() HotKeySet("{F3}","vanishdown") for $stealth = 0 to 255 step +2 WinSetTrans("Bot Status","",$stealth) Next EndFunc