A preserved archive of the Logical Gamers community forums, 2009-2025. The original threads and posts, served read-only. Registration, posting and private messages are gone for good.

[Code]Auto PM'er

2.1k views · started by Blazer ·
#1
[Gaia]Auto PM'er
Regular PM 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

PM'er with Captcha:

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

URL Encode:

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
#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.
#3
Chad wrote:
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.


I really don't care in your opinion. Nagger. Everyone has their programming style, so Stop Nagging.
#4
Blazer wrote:
I really don't care in your opinion. Nagger. Everyone has their programming style, so Stop Nagging.


So says the guy that said, "LG is for fags" look were you are now. :D
#5
Chad wrote:
So says the guy that said, "LG is for fags" look were you are now. :D


Hahaha....Chad, well can't we all just get along? Lol.
#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 mine :)
#7
Blazer wrote:
Hahaha....Chad, well can't we all just get along? Lol.


No... xD

Bman wrote:
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 mine :)


The 'Url Encode' is ripped on a lot of bots, if you take the time to decompile them...

Mine is less complicated... Pm's can usually be sent with a simple Post wrapper...
#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.
#9
Artificial wrote:
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.


We were just telling him that he made it more complicated than it had to be...
#10
I don't really see how. He could have condensed it, sure.

Instead of:
 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 could have used:
 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.

I'm really not picking sides, I just feel the guy is being unfairly hassled.
#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.
#12
Thanks Arti for explaining professionally and briefly. If I want to release a special program for Gaia where would I release it?
#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.
#14
Bman wrote:
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.

Aah....okay, Thanks for answering my question Bman =D
#15
Nice code dude! ;D
#16
Blazer wrote:
Aah....okay, Thanks for answering my question Bman =D


No problem :)

Anything to help.

If you need any help or whatever drop me a PM
#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;;
#18
Artificial wrote:
I don't really see how. He could have condensed it, sure.

Instead of:
 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 could have used:
 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.

I'm really not picking sides, I just feel the guy is being unfairly hassled.


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...

Bman wrote:
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.


Well the code for URL encode is commonly used/ripped in Gaia Bots... (Though this one looks slightly different... :D)

.l.-_-.l. wrote:
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;;


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...

Blazer wrote:
Aah....okay, Thanks for answering my question Bman =D


I could put it in UG for you... (I am not in gold yet though...)
#19
I believe anything in Silver and up has to be approved by an Admin (Arti most likely) or another.
#20
Chad wrote:
I believe anything in Silver and up has to be approved by an Admin (Arti most likely) or another.


Why? I have posted bots everywhere without approval...

I was never informed of this... D:
#21
Why? I have posted bots everywhere without approval...

I was never informed of this... D:


I do believe Alex doesn't care for anyone that post anything in the team or special group or what ever. Not to sure. Will check on it. I've always asked him for anything in silver or up. Nothing in bronze however.
#22
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...


If you actually look at the code you'll see he only sends one HTTP request. I fail to see the 4 GET requests.
#23
Artificial wrote:
If you actually look at the code you'll see he only sends one HTTP request. I fail to see the 4 GET requests.


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="


It appears as if he is grabbing a bunch of the code in different 'GetWrappers'...

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...
#24
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="


It appears as if he is grabbing a bunch of the code in different 'GetWrappers'...

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...


Hmm....I guess I could've just maid the code way smaller instead of adding so many lines of useless strings.
#25
Nice
and keep on posting these codes they are usually real helpful for me
#26
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="


It appears as if he is grabbing a bunch of the code in different 'GetWrappers'...

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...


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.

strPost = "blah" & strUsername & "blah"


All he is doing is instead of writing it on one line, spans it over multiple lines.
strPost = "blah" & _
strUsername & _
"blah"


There is nothing wrong with that, and it isn't more complicated.
#27
Artificial wrote:
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.

strPost = "blah" & strUsername & "blah"


All he is doing is instead of writing it on one line, spans it over multiple lines.
strPost = "blah" & _
strUsername & _
"blah"


There is nothing wrong with that, and it isn't more complicated.


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:

                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


Simple, yet gets the job done... (From v1 of my pmer...)

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...
#28
I fail to understand what the code is for (Sorry, I'm such a noob)
#29
Is c++ vb.net or what ?
#30
linzblue wrote:
Is c++ vb.net or what ?


Same here xD