 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
emoyasha
Joined: 12 Nov 2007 Posts: 64
|
Posted: Fri Oct 10, 2008 4:33 am Post subject: from autoit to autohotkey |
|
|
i went to using autoit for quite a while and its sytax is like other langauges (VB, C++, ect ect) and im used to the syntax, however i am attempting to create an instant messenger via a php api and a scripting langauge. i got banned from the autoit from for asking for help twice in two months ont he same subject(no one awnsered me).
my problem was that my php page is set to delete all messages once they are echoes out.
the scripting langauge retreives messages by getting the web page source.
i attempted to do this via the dll in windows and via the winhttp.winhttprequest.5.1 object. however it would simply read the message over and over and not delete it, and also a message would only send about once in every 100 trys (no idea why no expeanation) (messages are sent by passing params by the php page as well all works off that php api)
so i was wondering how i could alternitvley get a web pages source code using autohotkey.
if anyone here knows autoit and would like a look at my origninal code please ask (its 878 lines with a ton of UDFs, i hate to re-write it all but autoit just doesnt seem to work and im banend from asking for help int heir forums) _________________ online .ini reader with encryption
[url=http://www.autohotkey.com/forum/viewtopic.php?p=164102]
advanced tetris game many features [/url] |
|
| Back to top |
|
 |
emoyasha
Joined: 12 Nov 2007 Posts: 64
|
Posted: Fri Oct 10, 2008 4:51 am Post subject: got it |
|
|
ok i think i figured it out.. strange..... it works just fine with autohotkey xD
idk it would be nice to make my autoit code work though and find otu whats different instead of having to rewrite, if anyone wants to help out there dont be shy!)
| Code: | #include CoHelper.ahk
var1 := source("http://google.com")
msgbox % var1
source(surl)
{
#NoEnv
CoInitialize()
pWHR := ActiveXObject("WinHttp.WinHttpRequest.5.1") ;
CreateObject
sMethod := "GET", Ansi2Unicode(sMethod, wMethod)
Ansi2Unicode(sUrl, wUrl)
DllCall(VTable(pWHR, 9), "Uint", pWHR, "Str", wMethod,
"Str", wUrl) ; Open
sUserAgent := "A WinHttpRequest"
;sUserAgent := "Mozilla/4.0 (compatible; MSIE 7.0;
Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
pUserAgent := SysAllocString(sUserAgent)
DllCall(VTable(pWHR, 20), "Uint", pWHR, "UInt",
WinHttpRequestOption_UserAgentString := 0 , "int64", 8,
"int64", pUserAgent) ; put_Option
DllCall(VTable(pWHR, 13), "Uint", pWHR) ; Send
If (sMethod != "HEAD") {
DllCall(VTable(pWHR, 16), "Uint", pWHR, "UIntP",
pResponseText) ; ResponseText
Unicode2Ansi(pResponseText, sResponseText)
SysFreeString(pResponseText)
return %sResponseText%
}
Release(pWHR)
CoUninitialize()
} |
_________________ online .ini reader with encryption
[url=http://www.autohotkey.com/forum/viewtopic.php?p=164102]
advanced tetris game many features [/url] |
|
| Back to top |
|
 |
emoyasha
Joined: 12 Nov 2007 Posts: 64
|
Posted: Fri Oct 10, 2008 5:02 am Post subject: highlighting |
|
|
are there any autohotkey editors with syntax highlighting? _________________ online .ini reader with encryption
[url=http://www.autohotkey.com/forum/viewtopic.php?p=164102]
advanced tetris game many features [/url] |
|
| Back to top |
|
 |
Guest
|
Posted: Fri Oct 10, 2008 7:03 am Post subject: Re: highlighting |
|
|
| emoyasha wrote: | | are there any autohotkey editors with syntax highlighting? |
look in the autohotkey install directory under extras\editors - syntax highlighting files are provided for many editors. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|