Jump to content

dbzfanatic

Active Members
  • Posts

    1,076
  • Joined

  • Last visited

About dbzfanatic

  • Birthday 10/29/1988

Profile Information

  • Member Title
    functional psychopath!!
  • Location
    dev/null

dbzfanatic's Achievements

Universalist

Universalist (7/7)

0

Reputation

  1. Sorry for the necro but I've been going through old code and updating it since I have more experience and have some time now. Sharing the full code for this in the OP since I've been able to clean it up a bit (read: a LOT)
  2. Instead of using -1 with your onevent code have you tried using the actual label? Like GuiCtrlSetOnEvent($downloadlates,"DownloadLatest")? You could also try putting a ConsoleWrite or MsgBox in there somewhere after your While Not loop to make sure it's actually going through properly. Let us know if either of those helps and we can go from there.
  3. Thanks Zedna that's just what I needed! Melba thanks for saying it's fine. I'll test this out in a bit and as long as it works properly I'll mark Zedna's answer as what I needed.
  4. This will return the HTML code for you to use. Just embed a webpage in your script and use _IEBodyWriteHTML($IEName,$sCity) ($IEName is the name of your IE object) #include <ie.au3> #include <string.au3> $oIE = _IECreate("http://ig.internetplus.biz/prayertimes/countryegypt/cityfayoom.html") $sHTML = StringStripWS(_IEBodyReadHTML($oIE),4) $sCity = "<div class=""city"">" & _StringBetween($sHTML,"<div class=""city"">","</tbody></table>")[0] & "</tbody></table>" People have said it to you a lot in the past few days but really everything you need is in the helpfile. You've said you don't like it but we won't write a program for you, we'll help you and give you the right direction to go in but you really need to start looking through the helpfile, it's helpful.
  5. ps3netsrv is mainly used to stream games but it also allows the streaming of dvds and bluerays over a network just like a media center except a bit easier (just type in your folder and go) and it will show on your network, no dedicated media streaming server or anything and it's really low overhead so it's almost like XMBC. What I'm trying to do is keep track of which media is mounted/streamed and which ps3(s) are connected as well as the status of each. Instead of running back and forth between programs (granted it's not terribly difficult just tedious) I can look at one window and get all the info I need as well as all management options for mounting or changing the stream, restarting the ps3 if it freezes, whatever. Automation of media streaming apps isn't against the rules last time I checked and I think it'd be a lot easier to stream an ISO of my DVDs and Bluerays than getting up and changing discs every time a movie ends (my daughter is 2 and is in the "ooooo shiney" stage so this option is a real help). Yes I know there are options like vudu and I do have several movies on vudu but my net connection sucks so I want to have this second option to have some family movie time. I can't code this thing to prevent piracy the author of ps3netsrv and/or webman would have to do that but I can make the streaming easier for whatever media is chosen. Specifically with the function I've hijacked the system menu and added a "Check Now" option to it. I need to call _ConsoleCopyText($hWndChild) when that menu item is clicked. This wouldn't be an issue if it was a menu I created myself but as I've hijacked the already existing system menu it's a bit more complicated.
  6. What do you mean make a clock in the input? Like show the date/time in the input box or use a timer to see how long something has been since input was issued?
  7. Hi everyone, I'm writting a program that incorporates a few different elements (ps3netsrv and webman) and I've got most of it knocked out but I can't seem to get the menu item I added to the default system menu to call anything. Here's the script I've got so far (I'm not nearly done but the rest I can probably do once I get this menu thing fixed). #include <GUIConstants.au3> #include <Constants.au3> #include <IE.au3> #include <WinAPI.au3> #include <GUIStatusBar.au3> #include <array.au3> #include <GUIConstantsEx.au3> #include <GuiMenu.au3> #include <timers.au3> $IE_Base = "192.168.1.73" dim $sStatusPrev, $sStatus, $sConsole, $sConsolePrev, $tTimer, $mnuCheck Opt("GUIOnEventMode", 1) ; Change to OnEvent mode $mainWindow = GUICreate("WebManNetSrv", 680, 615, 10, 10) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUISetBkColor(0x00) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") $edtConsole = GUICtrlCreateEdit("",-1,381,683,215,BitOR($ES_WANTRETURN,$WS_VSCROLL,$ES_READONLY)) GUICtrlSetFont($edtConsole,10,400,"","Terminal",5) GUICtrlSetBkColor($edtConsole,0x000000) GUICtrlSetColor($edtConsole,0xC0C0C0) GUICtrlSetState($edtConsole,@SW_DISABLE) GUISetState() $pid = run(@ScriptDir & "\ps3netsrv.exe L:\ 38008 192.168.1.*","",@SW_SHOW) ProcessWait ($pid) ; get the handle of the cmd window as i cannot be certain that there will be only one instance of the cmd running with the same window title or class $cmdHandle = _ProcessGetHWnd($pid, 2) Local $hWndChild = $cmdHandle[1][1] WinSetState($hWndChild, '', @SW_HIDE) WinMove($hWndChild,"",@DesktopWidth + 120,@DesktopHeight/2) $oIE = IECreatePseudoEmbedded(0,0,680,380,$mainWindow) _IENavigate($oIE,$IE_Base) _IELoadWait($oIE) $bStatus = _GUICtrlStatusBar_Create($mainWindow) _GUICtrlStatusBar_SetMinHeight($bStatus,20) _GUICtrlStatusBar_SetText($bStatus,"Waiting...") $hMenu = _GUICtrlMenu_GetSystemMenu($mainWindow) $mnuCheck = _GUICtrlMenu_InsertMenuItem($hMenu, 6, "Check Now") ;~ $sConsole = _ConsoleCopyText($hWndChild) $tTimer = _Timer_Init() While 1 sleep(100) if TimerDiff($tTimer) >= 30000 Then $sConsole = _ConsoleCopyText($hWndChild) $tTimer = _Timer_Init() Endif If $sConsole <> $sConsolePrev Then GUICtrlSetData($edtConsole,$sConsole) $sConsolePrev = $sConsole EndIf If $sStatus <> $sStatusPrev Then _GUICtrlStatusBar_SetText($bStatus,$sStatus) $sStatusPrev = $sStatus EndIf if Ping($IE_Base) = 0 Then _GUICtrlStatusBar_SetText($bStatus,"System shutdown detected. Waiting for reboot...") Sleep(8500) _IENavigate($oIE,$IE_Base) _IELoadWait($oIE) $sStatus = "Client Offline" Else $sStatus = "Client Online" EndIf ; end of event loop WEnd Func CLOSEClicked() WinClose(WinGetTitle($hWndChild)) ProcessClose("ps3netsrv.exe") $oIE.quit $oIE.exit _IEQuit($oIE) Exit EndFunc Func WM_PAINT($hWnd, $Msg, $wParam, $lParam) ;~ Sleep(100) DllCall("user32.dll", "int", "InvalidateRect", "hwnd", $hWnd, "ptr", 0, "int", 0) EndFunc ;==>WM_PAINT Func _ProcessGetHWnd($iPid, $iOption = 1, $sTitle = "", $iTimeout = 2000) Local $aReturn[1][1] = [[0]], $aWin, $hTimer = TimerInit() While 1 ; Get list of windows $aWin = WinList($sTitle) ; Searches thru all windows For $i = 1 To $aWin[0][0] ; Found a window owned by the given PID If $iPid = WinGetProcess($aWin[$i][1]) Then ; Option 0 or 1 used If $iOption = 1 OR ($iOption = 0 And $aWin[$i][0] <> "") Then Return $aWin[$i][1] ; Option 2 is used ElseIf $iOption = 2 Then ReDim $aReturn[UBound($aReturn) + 1][2] $aReturn[0][0] += 1 $aReturn[$aReturn[0][0]][0] = $aWin[$i][0] $aReturn[$aReturn[0][0]][1] = $aWin[$i][1] EndIf EndIf Next ; If option 2 is used and there was matches then the list is returned If $iOption = 2 And $aReturn[0][0] > 0 Then Return $aReturn ; If timed out then give up If TimerDiff($hTimer) > $iTimeout Then ExitLoop ; Waits before new attempt Sleep(Opt("WinWaitDelay")) WEnd ; No matches SetError(1) Return 0 EndFunc ;==>_ProcessGetHWnd Func IECreatePseudoEmbedded($i_Left, $i_Top, $i_Width, $i_Height, $h_Parent) Local $o_IE, $h_HWND $o_IE = ObjCreate("InternetExplorer.Application") $o_IE.theatermode = True $o_IE.fullscreen = True $o_IE.statusbar = False $h_HWND = _IEPropertyGet($o_IE, "hwnd") _WinAPI_SetParent($h_HWND, $h_Parent) _WinAPI_MoveWindow($h_HWND, $i_Left, $i_Top, $i_Width, $i_Height, False) _WinAPI_SetWindowLong($h_HWND, $GWL_STYLE, $WS_POPUP + $WS_VISIBLE) Return $o_IE EndFunc ;==>IECreatePseudoEmbedded Func _ConsoleCopyText($hWin = $hWndChild) $hCurrent = WinActive("") WinActivate($hWin) ControlSend($hWin,"","","!{SPACE}") ControlSend($hWin,"","","ES") ControlSend($hWin,"","","{ENTER}") WinActivate($hCurrent) $sConsole = ClipGet() Return $sConsole EndFunc By the way, before anyone asks, yes I've tried using STDOUT_Read for the "console" and have tried joining the windows as well. STDOUT_Read doesn't return anything until the program closes and joining the windows doesn't give me the control over the console I want/need (sending messages to display on the screen) so this is what I'm left with.
  8. Alright my problem is when I try to scan memory from 00000000 to FFFFFFFF it immediately exits the loop (seemingly) without finding any addresses that match. It works with addresses like 00400000 to 7FFFFFFFF and 80000000 to BFFFFFFFF but not the whole range. The function is this. Func _MemReadLoop($start,$end,$type,$condition) $list = "" $count = 0 GUISetState(@SW_DISABLE,$frmMemoryScanner) For $i = Dec($start) to Dec($end) $length = Dec($end) - Dec($start) GUICtrlSetData($prgScan,(($length - (Dec($end) - $i))/$length) * 100) $cur_code = _MemoryRead("0x" & Hex($i,8), $Mem_Handle, $type) If GUICtrlRead($cboType) <> "Value Between" and GUICtrlRead($cboType) <> "Unknown Initial Value" Then If Execute(GUICtrlRead($txtValue1) & $condition & $cur_code) Then $list &= Hex($i,8) & "|" & $cur_code & ";" $count += 1 EndIf ElseIf GUICtrlRead($cboType) = "Value Between" Then If GUICtrlRead($txtValue1) < $cur_code And $cur_code < GUICtrlRead($txtValue2) Then $list &= Hex($i,8) & "|" & $cur_code & ";" $count += 1 EndIf Else $list &= Hex($i,8) & "|" & $cur_code & ";" $count += 1 EndIf Next GUISetState(@SW_ENABLE,$frmMemoryScanner) GUICtrlSetData($prgScan,"0") $temp = StringSplit($list,";") GUICtrlSetData($lblNumber,"Found: " & $count) Return $list EndFunc Start and End are obvious. Type is ulong and condition is "=". Everything works so far except when I run those values. I've also tried the start being 0000000F, 00000001, and 00000015 to see if it was because it interpreted the 00000000 address as nothing and exited. I've also set the end to 9FFFFFFFF and that makes no difference either. Can anyone help? Edit: typo
  9. No one can help? I'm out of my league with things like this I know there are users here who can do it. Even if someone can't give me a definite answer or script that will open this can someone at least tell me how to start?
  10. Is this a clean install of Vista? Sorry for the delay my VM choked and I had to redo it and install autoit. If it is you might have this problem: 'telnet' is not recognized as an internal or external command, operable program, or batch file. Does the window connect, as in do you have telnet?
  11. No one's going to write this for you. If you're not going to put out the effort to learn for yourself why are you here?
  12. Thanks for reminding me about VMs. I'll boot up my vista VM and try the code to see if I can replicate your error. Give me 5 minutes to post.
  13. I'm not sure why it wouldn't work if it's not a privileges issue. I'd rather not switch my laptop over to vista just to check it out, but I have a question. Are you running the script from SciTe in vista or have you compiled an .exe file that you're using? I've had experiences where an .exe I compiled in XP wouldn't run in vista but when recompiled in vista with identical code it worked.
  14. Like this maybe? $file = FileOpen("shift.txt") $shift_start = FileReadLine($file,5) ;guessing on the line #,should be something like 8 or 13 $shift_end = FileReadLine($file,6) ;same $shift = $shift_end - $shift_start $shift_view = "----" For $i = 1 To $shift $shift_length_view &= $shift_view Next $shift_spacer = " " For $i = 0 To $shift_start $spacers &= $shift_spacer Next $shift_view = $spacers & "|" & $shift_length & "|" I haven't tested this but hopefully you get the idea :S. It's one way and I know you use ini files but you should be able to adapt it fairly easily.
  15. Search for "title" in the helpfile and for vista try adding #RequireAdmin to the top of your code.
×
×
  • Create New...