Jump to content

Pathologic

Members
  • Posts

    4
  • Joined

  • Last visited

Pathologic's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. It seems to me that magnifying a section of the screen might be more resource-intensive than pixelsearching an area and creating a progress bar from that information? Maybe I'm wrong though, Ill look into it. Thanks. I'll give it a go, thanks.
  2. I want to create a much larger status bar that tracks the progress of a very small status bar in an application so that I can see it from far away. I cannot for the life of me work out why this isn't working, I must be missing something obvious. #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> #include <Math.au3> $pix = 0 $pixel = 0 $progress = 100 $state = "" GUICreate("bar", 300, 30, 810, 715,$WS_POPUP+$WS_DISABLED+$GUI_NOFOCUS,$WS_EX_TOPMOST) GUISetState(@SW_SHOWNOACTIVATE) Local $idProgressbar1 = GUICtrlCreateProgress(0, 0, 300, 30) GUICtrlSetColor(-1, 32250) While 1 $pixel = PixelSearch(1724,601,1607,602,0xFFFFFF,0,1) if not @error then $pix = $pixel[0] - 1607 $progress = Round(($pix/117)*100-1,0) $state = "" Else $state = "ERROR" EndIf GUICtrlSetData($idProgressbar1, $progress) Tooltip($state & $pixel[0] & " - " & $pix & " - " & $progress,1920,500) Sleep(100) WEnd Basically, there is a white progress bar stretching from ~1607,600 to ~1724,605. I am trying to pixelsearch for the right-most pixel in the range specified that remains white, work out what percentage of the bar remains, and translate that into a new progress bar. If I comment out the pixelsearch stuff and set the $progress variable with a straight counter ($pixel = $pixel+1 or -1), the progress bar moves just fine, meaning the while loop is looping and the progress bar functions fine. If I start the script with the tooltip in place it shows correct initial numbers (the first pixel found is at 1724, the bar is 117 pixels long which is 100% of the bar). However, then nothing happens. The tooltip never updates again, it doesn't show me that it errored, it doesn't do anything at all. Am I missing something obvious? I really hope so :s Even if the pixelsearch is wrong somehow, why is it not progressing to the @error tooltip?
  3. Hey all, In the general sense, is there any reason why the above commands would interrupt other keys that are currently being held down on the keyboard? I'm using controlsend to send commands via a simplified version of sendex that I used to solve my earlier problem of sticking modifier keys, and a simply while loop with a rundown of if then elseif checks to send specific keys. However, every now and then, I will be holding down a key manually on the keyboard (for example, holding down up or down to scroll through a list), and the key gets "interrupted"; it's as if I've lifted the keypress when I haven't. #include <Misc.au3> #include <MsgBoxConstants.au3> Hotkeyset("{Pause}","Go") Hotkeyset("{Scrolllock}","Bashg") Local $hDLL = DllOpen("user32.dll") $s = 0 $bashg = 0 Func _SendEx($ss) While _IsPressed("10") Or _IsPressed("11") Or _IsPressed("12") Sleep(50) WEnd ControlSend("Listit","","",$ss) EndFunc Func Go() If $s == 1 then $s = 0 Else $s = 1 EndIf EndFunc Func Bashg() If $bashg == 1 then $bashg = 0 Else $bashg = 1 EndIf EndFunc While 1 If $s == 1 and PixelGetColor(1890,429) == 0x00FF00 Then if PixelGetColor(1910,416) == 0x00FF00 and $bashg == 1 Then _SendEx("{TAB}") EndIf if PixelGetColor(1869,394) == 0x00FF00 Then _SendEx("{ENTER}") endif if PixelGetColor(1869,406) == 0x00FF00 Then _SendEx("{F3}") Elseif PixelGetColor(1889,396) == 0x00FF00 Then _SendEx("{F4}") Elseif PixelGetColor(1892,412) == 0x00FF00 Then _SendEx("{F5}") Elseif PixelGetColor(1867,427) == 0x00FF00 Then _SendEx("{F6}") Elseif PixelGetColor(1890,429) == 0x00FF00 Then _SendEx("{F7}") EndIf EndIf Sleep(150) WEnd I hope that's readable, I used the insert code button :s Pause enables the script in general, scrollock enables tabbing (sometimes I dont want that specific action). Everything else I think is pretty basic stuff. Is it a matter of too many keys being sent at the same time or something? It's not at times when I am pressing modifier keys on the keyboard or anything like that; generally speaking it's just while pressing directional keys or numpad keys.. could be any keys but I haven't checked with anything else. I guess I could add the keys I don't want interrupted to the _sendex function, but I kind of want the function to keep running in the background even while I'm holding those keys down. Any ideas?
  4. While trying to create an "xp bar" for a game I play, I am coming up against an annoying problem in splashtexton. I cannot seem to remove the invisible padding in the window I create, meaning that the text is not visible if I try to set the window to too small an area. global $Start_Time = TimerInit() global $firstgrey = (PixelSearch(1240,24,683,24,0xFEF8F0)) global $percent = Round((($firstgrey[0]-682)/557)*100,1) global $currentpercent = Round((($firstgrey[0]-682)/557)*100,1) global $startpercent = Round((($firstgrey[0]-682)/557)*100,1) global $Time_Difference = TimerDiff($Start_Time) global $totalxp = InputBox("Question", "Total xp for level:", "Enter total xp for level", "", _ - 1, -1, 0, 0) global $startxp = $totalxp*$percent/100 global $currentxp = $totalxp*$percent/100 global $gainedxp = 0 global $xprate SplashTextOn("XP", "", 557,40,683,1,1,"",8) While 1 $firstgrey = (PixelSearch(1240,24,683,24,0xFEF8F0)) If Not @error Then $percent = Round((($firstgrey[0]-682)/557)*100,1) $Time_Difference = TimerDiff($Start_Time) $currentxp = $totalxp*$percent/100 $gainedxp = $currentxp/$startxp $xprate = $gainedxp/$Time_Difference*3600 EndIf ControlSetText("XP", "", "Static1", Round($currentxp,1) & "/" & $totalxp & " "& $percent & "% || Xp per hour: " & Round($xprate,1) & " || Session: " & Round($Time_Difference/1000,0)) Sleep(1000) Wend Ideally, I would like that splashtext box to be around 20 pixels high, but if I set it any lower than 40, the text starts being cut off. Is there a way I can get around this?
×
×
  • Create New...