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 23 of 23
Thread: [Code]Auto PM'er
-
03-28-2010 06:23 PM #1I'm new
- Join Date
- Mar 2010
- Posts
- 13
- Rep
- 19
[Gaia]Auto PM'er
Last edited by Blazer; 03-28-2010 at 06:31 PM.
-
03-29-2010 02:39 PM #2
- Join Date
- Oct 2009
- Posts
- 1,019
- Rep
- 255
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.
-
03-29-2010 02:48 PM #3Guest
-
03-29-2010 02:52 PM #4
- Join Date
- Oct 2009
- Posts
- 1,019
- Rep
- 255
I don't really see how. He could have condensed it, sure.
Instead of:
He could have used: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="
However, it really is irrelevant. His way is just more spaced out, not necessarily more complicated. If that technique allows him to code and organize his project better, then we're really not in a position to criticize.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.
-
03-29-2010 02:56 PM #5
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; 03-29-2010 at 02:59 PM.
Shh, I'm watching My little pony.
-
03-29-2010 06:04 PM #6I'm new
- Join Date
- Mar 2010
- Posts
- 13
- Rep
- 19
Thanks Arti for explaining professionally and briefly. If I want to release a special program for Gaia where would I release it?
-
03-29-2010 06:35 PM #7
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.
-
03-29-2010 07:14 PM #8I'm new
- Join Date
- Mar 2010
- Posts
- 13
- Rep
- 19
-
03-29-2010 08:55 PM #9Guest
Nice code dude! ;D
-
03-29-2010 09:06 PM #10
-
03-29-2010 10:26 PM #11Guest
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;;
-
03-29-2010 11:58 PM #12Guest
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...)
-
03-30-2010 12:21 AM #13
-
03-30-2010 12:25 AM #14Guest
-
03-30-2010 12:27 AM #15
-
03-30-2010 02:25 AM #16
- Join Date
- Oct 2009
- Posts
- 1,019
- Rep
- 255
-
03-30-2010 02:42 AM #17Guest
It appears as if he is grabbing a bunch of the code in different 'GetWrappers'...Code: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...
-
03-30-2010 02:47 AM #18I'm new
- Join Date
- Mar 2010
- Posts
- 13
- Rep
- 19
-
03-30-2010 03:00 AM #19
Nice
and keep on posting these codes they are usually real helpful for me
-
03-30-2010 03:23 AM #20
- Join Date
- Oct 2009
- Posts
- 1,019
- Rep
- 255
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.
All he is doing is instead of writing it on one line, spans it over multiple lines.Code:strPost = "blah" & strUsername & "blah"
There is nothing wrong with that, and it isn't more complicated.Code:strPost = "blah" & _ strUsername & _ "blah"
-
03-30-2010 03:47 AM #21Guest
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:
Simple, yet gets the job done... (From v1 of my pmer...)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...
-
11-10-2011 10:56 PM #22
-
11-13-2011 12:11 PM #23Je suis le professeur de français à Thomas
- Join Date
- May 2010
- Location
- France, Paris
- Posts
- 1,848
- Rep
- 148


Reply With Quote




Bookmarks