; NetFirewallPolicy2 COM UDF Library for AutoIt3
; AutoIt Version : 126.96.36.199
; Description ...: Windows Firewall Policy2 Interface, Provides access to the firewall policy for Windows Vista+
Including Test Script
_NetFw_Get_CurrentProfileTypes Retrieves the currently active firewall profile(s) _NetFw_Get_FirewallEnabled Indicates whether a firewall is enabled locally _NetFw_Put_FirewallEnabled Specifies whether a firewall is enabled locally _NetFw_Get_ExcludedInterfaces Indicates a list of interfaces on which firewall settings are excluded _NetFw_Put_ExcludedInterfaces Specifies a list of interfaces on which firewall settings are excluded _NetFw_Get_BlockAllInboundTraffic Indicates whether the firewall should not allow inbound traffic _NetFw_Put_BlockAllInboundTraffic Specifies whether the firewall should not allow inbound traffic _NetFw_Get_NotificationsDisabled Indicates whether interactive firewall notifications are disabled _NetFw_Put_NotificationsDisabled Specifies whether interactive firewall notifications are disabled _NetFw_Get_UnicastResponsesToMulticastBroadcastDisabled Indicates whether the firewall should not allow unicast responses to multicast and broadcast traffic _NetFw_Put_UnicastResponsesToMulticastBroadcastDisabled Specifies whether the firewall should not allow unicast responses to multicast and broadcast traffic _NetFw_Get_Rules Retrieves the interface to collection of firewall rules _NetFw_Get_ServiceRestriction Retrieves the interface used to access the Windows Service Hardening store _NetFw_EnableRuleGroup Enables or disables a specified group of firewall rules _NetFw_IsRuleGroupEnabled Determines whether a specified group of firewall rules are enabled or disabled for the current profile _NetFw_RestoreLocalFirewallDefaults Restores the local firewall configuration to its default state _NetFw_Get_DefaultInboundAction Indicates the default action for inbound traffic _NetFw_Put_DefaultInboundAction Specifies the default action for inbound traffic _NetFw_Get_DefaultOutboundAction Indicates the default action for outbound traffic _NetFw_Put_DefaultOutboundAction Specifies the default action for outbound traffic _NetFw_Get_IsRuleGroupCurrentlyEnabled Determines whether a specified group of firewall rules are enabled or disabled for the current profile _NetFw_Get_LocalPolicyModifyState Determines if adding or setting a rule or group of rules will take effect in the current firewall profile
I'm trying to get data from http://poe.trade/ - disclaimer, although this site is about a game, my script will not in any way interact directly with the game in any way. The script is just to get data from the site.
To explain how it works - you submit a POST request and a custom URL is returned, then you do a GET request on that URL and you get the final URL you want.
Now, I've tried doing so by using https://apitester.com/ and the first phase works. Here's how it looks like at APITester:
Request Headers POST /search HTTP/1.1 Host: poe.trade Accept: */* User-Agent: Rigor API Tester Content-Length: 43 Content-Type: application/x-www-form-urlencoded Request Body online=x&name=kaom%27s%20heart&league=incursion When I submit this, the response I get is this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>Redirecting...</title> <h1>Redirecting...</h1> <p>You should be redirected automatically to target URL: <a href="http://poe.trade/search/ioritewoteteme">http://poe.trade/search/ioritewoteteme</a>. If not click the link. So I then do a GET request for 'http://poe.trade/search/ioritewoteteme', which results in this response:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>Redirecting...</title> <h1>Redirecting...</h1> <p>You should be redirected automatically to target URL: <a href="http://poe.trade/search/inamotezuakito">http://poe.trade/search/inamotezuakito</a>. If not click the link. Great, this link (http://poe.trade/search/inamotezuakito) is exactly what we want.
However, when I try to do the same in autoit, the result is quite different:
Global Const $HTTP_STATUS_OK = 200 $test = HttpPost("http://poe.trade/search", "/online=x&name=kaom%27s%20heart&league=incursion") ClipPut($test) MsgBox(1, "", $test) Func HttpPost($sURL, $sData = "") Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHTTP.Open("POST", $sURL, False) If (@error) Then Return SetError(1, 0, 0) $oHTTP.SetRequestHeader("Host", "poe.trade") $oHTTP.SetRequestHeader("User-Agent", "Rigor API Tester") $oHTTP.SetRequestHeader("Accept", "*/*") $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") $oHTTP.Send($sData) If (@error) Then Return SetError(2, 0, 0) If ($oHTTP.Status <> $HTTP_STATUS_OK) Then Return SetError(3, 0, 0) Return SetError(0, 0, $oHTTP.ResponseText) EndFunc The code above returns: ' 謟 '
Any ideas as to what I am doing incorrectly?
Once I get the final link using APITester and do a GET on that i get a bunch of hieroglyphs. A friend of mine advised that the data is GZiped, which is a pain in the butt to be honest. However, apparently curl can uncompres that.
How would I go about it?
$oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("GET", "link", False) $oHTTP.Send() $oReceived = $oHTTP.ResponseText $oStatusCode = $oHTTP.Status Global $DataArray If $oStatusCode <> 200 Then Exit MsgBox(1, "Error", "Status Code <> 200") EndIf FileWrite(@ScriptDir & "\output.txt", $oReceived) ; //////// #include <IE.au3> Local $FullLink = "link" Local $oIE = _IECreate($FullLink, 0, 0) _IELoadWait($oIE) Local $sText = _IEBodyReadHTML($oIE) FileWrite(@ScriptDir & "\output.txt", $sText)
Hi, I am stuck on a GUI problem and would like your help to solve it.
I am trying to automate the SoundWire Server app to match my current system volume level while it is minimized to the notification area (so no clicking or stealing focus),
I can already get the handle and alter the tracker position by sending a WM_SETPOS message, but somehow the actual volume is not changed: I think I need to do something else to trigger the event handler for the value change and propagate it correctly.
This is the control summary from Au3 info:
>>>> Window <<<< Title: SoundWire Server Class: #32770 Position: 441, 218 Size: 566, 429 Style: 0x94CA00C4 ExStyle: 0x00050101 Handle: 0x0000000000510E12 >>>> Control <<<< Class: msctls_trackbar32 Instance: 4 ClassnameNN: msctls_trackbar324 Name: Advanced (Class): [CLASS:msctls_trackbar32; INSTANCE:4] ID: 6002 Text: Position: 51, 222 Size: 47, 126 ControlClick Coords: 1, 101 Style: 0x5001000A ExStyle: 0x00000000 Handle: 0x00000000001234C8 >>>> Mouse <<<< Position: 496, 567 Cursor ID: 2 Color: 0xF0F0F0 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Default multimedia device Tray on Start Static Server Address: 192.168.1.8 Status: Connected to B9K~OP3 Audio Output Audio Input Level Record to File Input Select: 44.1 kHz Minimize to Master Volume Mute >>>> Hidden Text <<<< Slider2 Mute OK Cancel Label Balance Slider1 Volume Front L/R Fr C/LFE Side L/R Back L/R
I am attaching the program in question so you don't have to install it (i don't know if it is portable enough, tough):
Thanks in advance and I hope I didn't post in the wrong section
ITypeInfo to extract information about the characteristics and capabilities of objects from type librariesBy Bilgus
I was Playing around With AutoIt this evening and wondered how hard it would be to get typeinfo like the COM Viewers do only using AutoIt
Turns out it was pretty easy.
A Few Notes:
CAarray info is unfinished I didn't have any objects to test it on so I left it Limited.
The Object must have IDispatch exposed (ITypeInfo is derivative)
Its Just a proof of concept Run with it but don't carry scissors