Regular PM code.
PM'er with Captcha:Code:Public Function SendMessage(ByVal strRecipient As String, _ ByVal strTitle As String, _ ByVal strMessage As String _ ) As Boolean Dim strHTML As String, _ strURL As String, _ strReferer As String, _ strPost As String strURL = "http://www.gaiaonline.com/profile/privmsg.php" strReferer = "http://www.gaiaonline.com/profile/privmsg.php?mode=post" strPost = "username=" & _ strRecipient & "&subject=" & _ URLEncode(strTitle) & "&message=" & _ URLEncode(strMessage) & "&area_code=&pn1=&pn2=&selected_options=post&btn_send=true&preview=&post=&mode=post&src=&folder=inbox&id=" SecondsToWait (3) strHTML = Form1.wrapper.PostWrapper(strURL, _ strPost, _ strReferer) If (InStr(1, strHTML, "Your Private Message has been sent to", vbTextCompare) <> 0) Then SendMessage = True Else SendMessage = False End If End Function
URL Encode:Code:Public Function Captcha(ByVal strUserName As String, _ ByVal strSubject As String, _ ByVal strMessage As String, _ ByVal strCaptcha As String _ ) As Boolean Dim strHTML As String, _ strURL As String, _ strReferer As String, _ strPost As String strCaptcha = Replace(strCaptcha, " ", "+") strURL = "http://www.gaiaonline.com/profile/privmsg.php" strReferer = "http://www.gaiaonline.com/profile/privmsg.php" strPost = "username=" & _ strUserName & "&subject=" & _ URLEncode(strSubject) & "&message=" & _ URLEncode(strMessage) & "&recaptcha_response_field=" & _ strCaptcha & "&placeholder=&preview=&post=&mode=post&src=&folder=inbox&id=&area_code=&pn1=&pn2=&recaptcha_challenge_field=" & _ strCapURL & "&selected_options=post&btn_send=true" strHTML = Form1.wrapper.PostWrapper(strURL, _ strPost, _ strReferer) If (InStr(1, strHTML, "Your Private Message has been sent to", vbTextCompare) <> 0) Then Captcha = True Else Captcha = False End If End Function
Code:Public Function URLEncode(ByVal Text As String) As String Dim i As Integer Dim acode As Integer Dim char As String URLEncode = Text For i = Len(URLEncode) To 1 Step -1 acode = Asc(Mid$(URLEncode, i, 1)) Select Case acode Case 48 To 57, 65 To 90, 97 To 122 ' don't touch alphanumeric chars Case 32 ' replace space with "+" Mid$(URLEncode, i, 1) = "+" Case Else ' replace punctuation chars with "%hex" URLEncode = Left$(URLEncode, i - 1) & "%" & Hex$(acode) & Mid$ _ (URLEncode, i + 1) End Select Next End Function
Results 1 to 30 of 30
Thread: [Code]Auto PM'er
- 28 Mar. 2010 06:23pm #1
[Gaia]Auto PM'er
Last edited by Blazer; 28 Mar. 2010 at 06:31pm.
- 28 Mar. 2010 07:45pm #2
Lol'd. Go back to EBU.
You made it harder then it needed to be.
There is no need for that many strings as well.
Also, you programed the first two code boxes of the code not the URL encode. How can I tell. The way it's programmed. It's tabbed.
- 28 Mar. 2010 08:04pm #3
- 28 Mar. 2010 08:48pm #4
- 28 Mar. 2010 08:55pm #5
- 29 Mar. 2010 10:35am #6
LOL... Sorry blazer.. but i must agree, once saying LG is for fags. Not cool.
Nice code, Url encode is ripped. give credits...
Also, I still like mineShh, I'm watching My little pony.
- 29 Mar. 2010 02:10pm #7
- 29 Mar. 2010 02:39pm #8
Invisi'd all of the drama posts. If you want to whine with each other, do it over MSN.
As for the code, looks good. Hopefully we can see more of your releases in the future. Welcome to Logicalgamers.
@ the comment on programming style, have to agree with Blazer: everybody has their own style. I could comment on poor programming practices in almost every thread created in source code section, this too. For the most part, his code is fine. Only thing I could really criticize is the indentation, but each to their own.
- 29 Mar. 2010 02:48pm #9
- 29 Mar. 2010 02:52pm #10
I don't really see how. He could have condensed it, sure.
Instead of:
Code:strPost = "username=" & _ strRecipient & "&subject=" & _ URLEncode(strTitle) & "&message=" & _ URLEncode(strMessage) & "&area_code=&pn1=&pn2=&selected_options=post&btn_send=true&preview=&post=&mode=post&src=&folder=inbox&id="
Code:strPost = "username=" & strRecipient & "&subject=" & URLEncode(strTitle) & "&message=" & URLEncode(strMessage) & "&area_code=&pn1=&pn2=&selected_options=post&btn_send=true&preview=&post=&mode=post&src=&folder=inbox&id="
I'm really not picking sides, I just feel the guy is being unfairly hassled.
- 29 Mar. 2010 02:56pm #11
Yea, I was just saying the Url Encode was ripped.
Sorry about my earlier post, it is a nice code nonetheless.
And we all mature sometime, I guess hes starting now.
We all make mistakes.
I guess he said something unfair to/about us. But thats alright, we all get overwhelmed.Last edited by Bman; 29 Mar. 2010 at 02:59pm.
Shh, I'm watching My little pony.
- 29 Mar. 2010 06:04pm #12
Thanks Arti for explaining professionally and briefly. If I want to release a special program for Gaia where would I release it?
- 29 Mar. 2010 06:35pm #13
Since your not in the underground bronze,silver, or anything like that. You would as someone to post it for you.
Me, chad, or anyone in the underground Ranks.Shh, I'm watching My little pony.
- 29 Mar. 2010 07:14pm #14
- 29 Mar. 2010 08:55pm #15
Nice code dude! ;D
- 29 Mar. 2010 09:06pm #16
- 29 Mar. 2010 10:26pm #17
Some one good to lak that in UG would be an Admin put in all 3 of em (since no ones in gold yet o3o;;
- 29 Mar. 2010 11:58pm #18
Chad was more correct, "You made it more complicated than it needed to be."
It is more complicated... All he had to address was a Simple GetWrapper and PostWrapper, but he made like 4 GetWrapper's and 1 Post Wrapper...
Making it one Get and one post is simpler, not more professional but simpler...
We are simply stating this fact...
Well the code for URL encode is commonly used/ripped in Gaia Bots... (Though this one looks slightly different... )
Moderators also, Basically any member with a site rank (That would be my suggestion...)
No use in putting it in gold if there is no one in Gold...
I could put it in UG for you... (I am not in gold yet though...)
- 30 Mar. 2010 12:21am #19
- 30 Mar. 2010 12:25am #20
- 30 Mar. 2010 12:27am #21
- 30 Mar. 2010 02:25am #22
- 30 Mar. 2010 02:42am #23Code:
strURL = "http://www.gaiaonline.com/profile/privmsg.php" strReferer = "http://www.gaiaonline.com/profile/privmsg.php?mode=post" strPost = "username=" & _ strRecipient & "&subject=" & _ URLEncode(strTitle) & "&message=" & _ URLEncode(strMessage) & "&area_code=&pn1=&pn2=&selected_options=post&btn_send=true&preview=&post=&mode=post&src=&folder=inbox&id="
He doesn't need to 'Get' all that...
I did look at the code, I just don't see why you would add so many 'GetWrapper' 's to slightly shorten the 'PostWrapper' ...
Just stating the fact that it could be done more efficiently and with less code...
- 30 Mar. 2010 02:47am #24
- 30 Mar. 2010 03:00am #25
Nice
and keep on posting these codes they are usually real helpful for me
- 30 Mar. 2010 03:23am #26
All he is doing is assigning the URL to post data, the referrer and post data to three different strings. He isn't using different GetWrappers at all. What he is doing is perfectly fine - I infact do it a lot when programming applications that interact with the web.
It seems more than anything that you're confused about what he's doing.
Code:strPost = "blah" & strUsername & "blah"
Code:strPost = "blah" & _ strUsername & _ "blah"
- 30 Mar. 2010 03:47am #27
It seem's more complicated than the way I coded it... Is all I am saying...
I see what he is doing perfectly fine... I just would do it like:
Code:StrHTML = Wrapper.GetWrapper("http://www.gaiaonline.com/profile/privmsg.php?mode=post") StrHTML = Wrapper.PostWrapper("http://www.gaiaonline.com/profile/privmsg.php", "username=" & lstaccounts.Items.Item(IntAcct) & "&subject=" & txtSubject.Text & "&message=" & txtMessage.Text & "&folder=inbox&mode=post&btn_send=true") If (InStr(1, StrHTML, "Your Private Message has been sent to: ")) Then MsgBox("Message sent to : " & lstaccounts.SelectedItem) Else MsgBox("Failed to send message...") End If
Yes it is a personal preference, I understand that it may seem less complicated to you than to me, or vice a versa... I am simply expressing my opinion on the topic...
- 18 Apr. 2010 06:54am #28
I fail to understand what the code is for (Sorry, I'm such a noob)
- 10 Nov. 2011 11:56pm #29
Is c++ vb.net or what ?
- 13 Nov. 2011 01:11pm #30