• January 27, 2023, 09:58:11 pm

Author Topic: VB6 - Bot: Newb Question  (Read 8976 times)

Warden

  • Hero Member
  • *******
  • Posts: 1,745
  • BNTA Admin
    • Battle.net Terrorist Alliance
VB6 - Bot: Newb Question
« on: November 22, 2010, 01:43:05 pm »
Introduction: So I've been messing around with some old old code. l2uthless 2.00e Beta code to be exact, I got my hands on all the required files but Im having problems with the following Function,

Code: [Select]
Public Function CheckProduct() As Boolean
If Username = vbNullString Then AddChat "You must enter a username.": Exit Function
If Password = vbNullString Then AddChat "You must enter a password.": Exit Function
    If Product <> "RATS" And Product <> "PXES" And Product <> "NB2W" And Product <> "VD2D" And Product <> "PX2D" And Product <> "3RAW" And Product <> "PX3W" Then
        AddChat "You have not entered a valid product."
        AddChat "Valid products: RATS, PXES, NB2W, VD2D, PX2D, 3RAW, PX3W"
        Exit Function
    End If
    If (Product = "RATS" Or Product = "PXES") And (Len(cdkey) <> 13) Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    If (Product = "NB2W" Or Product = "VD2D") And (Len(cdkey) <> 16) Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    If Product = "PX2D" And (Len(cdkey) <> 16 Or Len(XPCdKey) <> 16) Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    If Product = "3RAW" And Len(cdkey) <> 26 Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    If Product = "PX3W" And (Len(cdkey) <> 26 Or Len(XPCdKey) <> 26) Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    CheckProduct = True
End Function

Keeps telling me "You have to enter a Username", but the Username is defined in the Config.ini

Perhaps the Config was different in 2.00e than it is now? Anyways any help is welcome.

Myst

  • BotMaster
  • Hero Member
  • *******
  • Posts: 772
  • Clan Null - Op 0x00
    • DarkBlizz
Re: VB6 - Bot: Newb Question
« Reply #1 on: November 22, 2010, 02:29:38 pm »
follow the code from where Username is grabbed and debug from there

Warden

  • Hero Member
  • *******
  • Posts: 1,745
  • BNTA Admin
    • Battle.net Terrorist Alliance
Re: VB6 - Bot: Newb Question
« Reply #2 on: November 22, 2010, 02:59:03 pm »
The only other code I can see relating to the Config file & Username is:

Code: [Select]
Public Function GetStuff(Section As String, Key As String) As String
Dim S As String
S = Space(128)
GetPrivateProfileStringA Section, Key, vbNullString, S, Len(S), App.Path & "\Config.ini"
GetStuff = KillNull(S)
End Function

Public Function WriteStuff(Section As String, Key As String, sString As String)
WritePrivateProfileStringA Section, Key, sString, App.Path & "\Config.ini"
End Function

I need a kick in the right direction.

Vector

  • I am illiterate in fail
  • Sr. Member
  • ******
  • Posts: 382
  • The tech hiding in your PC
Re: VB6 - Bot: Newb Question
« Reply #3 on: November 22, 2010, 03:08:01 pm »
Hit CTRL + F. Type in "Username = " (without quotes), and make sure "Current project" is clicked, and there you can see where Username is being assigned.
Hated for defending his right to enjoy Battle.Net.

Screw every one of you.

Warden

  • Hero Member
  • *******
  • Posts: 1,745
  • BNTA Admin
    • Battle.net Terrorist Alliance
Re: VB6 - Bot: Newb Question
« Reply #4 on: November 22, 2010, 03:24:30 pm »
@Vector - Lol, Yeah I did that.

This is the CheckProduct code which is kill the connection

Code: [Select]
Public Function CheckProduct() As Boolean
If Username = vbNullString Then AddChat "You must enter a username.": Exit Function
If Password = vbNullString Then AddChat "You must enter a password.": Exit Function
    If Product <> "RATS" And Product <> "PXES" And Product <> "NB2W" And Product <> "VD2D" And Product <> "PX2D" And Product <> "3RAW" And Product <> "PX3W" Then
        AddChat "You have not entered a valid product."
        AddChat "Valid products: RATS, PXES, NB2W, VD2D, PX2D, 3RAW, PX3W"
        Exit Function
    End If
    If (Product = "RATS" Or Product = "PXES") And (Len(cdkey) <> 13) Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    If (Product = "NB2W" Or Product = "VD2D") And (Len(cdkey) <> 16) Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    If Product = "PX2D" And (Len(cdkey) <> 16 Or Len(XPCdKey) <> 16) Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    If Product = "3RAW" And Len(cdkey) <> 26 Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    If Product = "PX3W" And (Len(cdkey) <> 26 Or Len(XPCdKey) <> 26) Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    CheckProduct = True
End Function

Below I put AddChat "Checking Product..." before the actual product check, as well I put AddChat "Product Verified" after the actual check is completed.

Code: [Select]
Public Sub mnuConnect_Click()
On Local Error GoTo w_Error
Username = GetStuff("Edited", "Username")
Password = LCase(GetStuff("Edited", "Password"))
cdkey = UCase(GetStuff("Edited", "Cd-Key"))
XPCdKey = UCase(GetStuff("Edited", "XPCd-Key"))
Product = UCase(GetStuff("Edited", "Client"))
Server = LCase(GetStuff("Edited", "Server"))
Home = GetStuff("Edited", "Home Channel")
varProxy = GetStuff("Advanced", "Proxy")
If GetStuff("Misc", "Auto Detect Loads") = "Y" Then ald = True
AddChat "Checking hash files..."
If Not CheckHashes Then Exit Sub
AddChat "All hashes found."
AddChat "Checking Product..."
If Not CheckProduct Then Exit Sub
AddChat "Product Verified."


It never outputs "Product Verified" so the problems seems to be within the first code box.

DavidK

  • Sr. Member
  • ******
  • Posts: 305
  • Death from Above
Re: VB6 - Bot: Newb Question
« Reply #5 on: November 22, 2010, 04:19:09 pm »
There is quite a bit that could go wrong in this, I also lol @ Filip for flooding the public namespace. Please verify all of the variables checked are not null and all if statements evaluate as true.

Try this:

Code: [Select]
Public Function CheckProduct() As Boolean
AddC Username & ";" & Password & ";" & Product & ";" & Len(CDKey) & ";" & Len(XPCdKey)
If Username = vbNullString Then AddChat "You must enter a username.": Exit Function
If Password = vbNullString Then AddChat "You must enter a password.": Exit Function
    If Product <> "RATS" And Product <> "PXES" And Product <> "NB2W" And Product <> "VD2D" And Product <> "PX2D" And Product <> "3RAW" And Product <> "PX3W" Then
        AddChat "You have not entered a valid product."
        AddChat "Valid products: RATS, PXES, NB2W, VD2D, PX2D, 3RAW, PX3W"
        Exit Function
    End If
    If (Product = "RATS" Or Product = "PXES") And (Len(cdkey) <> 13) Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    If (Product = "NB2W" Or Product = "VD2D") And (Len(cdkey) <> 16) Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    If Product = "PX2D" And (Len(cdkey) <> 16 Or Len(XPCdKey) <> 16) Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    If Product = "3RAW" And Len(cdkey) <> 26 Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    If Product = "PX3W" And (Len(cdkey) <> 26 Or Len(XPCdKey) <> 26) Then AddChat "You have not entered a valid cd-key for this product.": Exit Function
    CheckProduct = True
End Function

If you still can't find it out, message back the result and I'll help you figure it out.
« Last Edit: November 22, 2010, 04:23:43 pm by DavidK »


"...fast forward to the end, fast forward to the end, cause i'm the hero in this movie..." - Pastor Shepherd

Loud

  • Banned
  • Hero Member
  • *******
  • Posts: 1,077
Re: VB6 - Bot: Newb Question
« Reply #6 on: November 22, 2010, 04:21:20 pm »
Debug it line by line bro. Like a programmer would do.
Get money.
Rock ice.
Fuck hoes.

eX.Pro

  • Enthusiast
  • ****
  • Posts: 54
  • I'm cool, I'm hot....I'm everything you're not.
Re: VB6 - Bot: Newb Question
« Reply #7 on: November 22, 2010, 04:30:05 pm »
Debug what??? any problem will be added to the chat box....
your config should look like:
Code: [Select]
[Edited]
Username=Warden
Password=fags
Cd-Key=0000000000000
Client=3RAW
etc....

eX.Pro, shut the fuck up, I'm removing your posts for a reason.
[17:23:19] <ZekcaH:0> im following u around the board removing ur posts eX.Pro
[17:23:22] <ZekcaH:0> its nearly a full time job

Warden

  • Hero Member
  • *******
  • Posts: 1,745
  • BNTA Admin
    • Battle.net Terrorist Alliance
Re: VB6 - Bot: Newb Question
« Reply #8 on: November 22, 2010, 04:31:35 pm »
@Helm - Im assuming the first AddC line is suppose to output the Username & Password on screen, but all its outputting is the ;'s

So this code = fail, somewhere thats what I get for trying to avoid BNCSUtil.dll

DavidK

  • Sr. Member
  • ******
  • Posts: 305
  • Death from Above
Re: VB6 - Bot: Newb Question
« Reply #9 on: November 22, 2010, 04:31:36 pm »
Debug it line by line bro. Like a programmer would do.
That's what we call a last ditch effort, which is only used when your programming world breaks down. It's a time consuming anger filled attempt usually ending in a facepalm. :(

@Helm - Im assuming the first AddC line is suppose to output the Username & Password on screen, but all its outputting is the ;'s

So this code = fail, somewhere thats what I get for trying to avoid BNCSUtil.dll
Make sure you have your config in the right place: App.Path & "\Config.ini"

In other words, the same place as the compiled exe.
« Last Edit: November 22, 2010, 04:34:56 pm by DavidK »


"...fast forward to the end, fast forward to the end, cause i'm the hero in this movie..." - Pastor Shepherd

Warden

  • Hero Member
  • *******
  • Posts: 1,745
  • BNTA Admin
    • Battle.net Terrorist Alliance
Re: VB6 - Bot: Newb Question
« Reply #10 on: November 22, 2010, 04:36:30 pm »
Debug it line by line bro. Like a programmer would do.
That's what we call a last ditch effort, which is only used when your programming world breaks down. It's a time consuming anger filled attempt usually ending in a facepalm. :(

@Helm - Im assuming the first AddC line is suppose to output the Username & Password on screen, but all its outputting is the ;'s

So this code = fail, somewhere thats what I get for trying to avoid BNCSUtil.dll
Make sure you have your config in the right place: App.Path & "\Config.ini"

In other words, the same place as the compiled exe.

Everythings lined up wheres its supposed to be, only think I can think of is that where this is l2ops 2.00 source it might be pulling from the config.ini file a little different than the newer versions.

DavidK

  • Sr. Member
  • ******
  • Posts: 305
  • Death from Above
Re: VB6 - Bot: Newb Question
« Reply #11 on: November 22, 2010, 04:54:44 pm »
The problem is with the following code:

Code: [Select]
Username = GetStuff("Edited", "Username")
Password = LCase(GetStuff("Edited", "Password"))
cdkey = UCase(GetStuff("Edited", "Cd-Key"))
XPCdKey = UCase(GetStuff("Edited", "XPCd-Key"))
Product = UCase(GetStuff("Edited", "Client"))
Server = LCase(GetStuff("Edited", "Server"))
Home = GetStuff("Edited", "Home Channel")

The code is looking in a different section than your config uses. In other words, It's looking for "Edited", but you need "MAIN".

do a search for [[ GetStuff(" ]] and make sure they are all go [[ GetStuff("MAIN", ]]
« Last Edit: November 22, 2010, 05:10:53 pm by DavidK »


"...fast forward to the end, fast forward to the end, cause i'm the hero in this movie..." - Pastor Shepherd

Warden

  • Hero Member
  • *******
  • Posts: 1,745
  • BNTA Admin
    • Battle.net Terrorist Alliance
Re: VB6 - Bot: Newb Question
« Reply #12 on: November 22, 2010, 06:43:36 pm »
The problem is with the following code:

Code: [Select]
Username = GetStuff("Edited", "Username")
Password = LCase(GetStuff("Edited", "Password"))
cdkey = UCase(GetStuff("Edited", "Cd-Key"))
XPCdKey = UCase(GetStuff("Edited", "XPCd-Key"))
Product = UCase(GetStuff("Edited", "Client"))
Server = LCase(GetStuff("Edited", "Server"))
Home = GetStuff("Edited", "Home Channel")

The code is looking in a different section than your config uses. In other words, It's looking for "Edited", but you need "MAIN".

do a search for [[ GetStuff(" ]] and make sure they are all go [[ GetStuff("MAIN", ]]

Thanks for spotting it Helm, by the way I changed that value in my config from l2uthless Ops -> ***** -> Edited

Apparently the Source was setup weirdly for single profile use. All that remains now is to define variables from the code in the config and, from what Helm has said, update the login sequence since this source used BnetAuth.dll & NLS.dll

eX.Pro

  • Enthusiast
  • ****
  • Posts: 54
  • I'm cool, I'm hot....I'm everything you're not.
Re: VB6 - Bot: Newb Question
« Reply #13 on: November 22, 2010, 06:43:45 pm »
Took you time to figure it, like i didn't give a hint about that, couple post above...

Apparently the Source was setup weirdly for single profile use.
EDIT: Because its single profile.
« Last Edit: November 22, 2010, 06:46:34 pm by eX.Pro »

eX.Pro, shut the fuck up, I'm removing your posts for a reason.
[17:23:19] <ZekcaH:0> im following u around the board removing ur posts eX.Pro
[17:23:22] <ZekcaH:0> its nearly a full time job

pikachu

  • Administrator
  • Hero Member
  • *******
  • Posts: 3,344
Re: VB6 - Bot: Newb Question
« Reply #14 on: November 22, 2010, 09:12:42 pm »
Solution: don't steal old vb6 code.

DavidK

  • Sr. Member
  • ******
  • Posts: 305
  • Death from Above
Re: VB6 - Bot: Newb Question
« Reply #15 on: November 22, 2010, 09:14:02 pm »
Solution: don't steal old vb6 code.
He didn't steal it, however I can't say the same about your lottery victory!


"...fast forward to the end, fast forward to the end, cause i'm the hero in this movie..." - Pastor Shepherd

NouN

  • NouN
  • Addict
  • *****
  • Posts: 170
Re: VB6 - Bot: Newb Question
« Reply #16 on: November 24, 2010, 12:19:00 pm »
Solution: don't steal old vb6 code.
Yea good idea :)


Mike

  • Asgard Developer
  • Addict
  • *****
  • Posts: 140
    • mikeownage.com
Re: VB6 - Bot: Newb Question
« Reply #17 on: November 24, 2010, 02:39:59 pm »
I don't think it counts as stealing since:
1) The source is public.
2) He mentioned what bot it's from and what he is trying to do (Giving credit)

I do however think it's foolish to even bother to update an old ruthless source especially since your having trouble with the simplest part -.- If you are just trying to learn it's fine but if you have the inclination to actually use what your coding to moderate a channel i'd have to say the end result won't be anywhere near what the newest build of ruthless ops offers in terms of performance.

Warden

  • Hero Member
  • *******
  • Posts: 1,745
  • BNTA Admin
    • Battle.net Terrorist Alliance
Re: VB6 - Bot: Newb Question
« Reply #18 on: November 24, 2010, 04:26:00 pm »
I don't think it counts as stealing since:
1) The source is public.
2) He mentioned what bot it's from and what he is trying to do (Giving credit)

I do however think it's foolish to even bother to update an old ruthless source especially since your having trouble with the simplest part -.- If you are just trying to learn it's fine but if you have the inclination to actually use what your coding to moderate a channel i'd have to say the end result won't be anywhere near what the newest build of ruthless ops offers in terms of performance.

Im pretty much learning as I go, I don't expect it to be superior to l2uthless 2.13c. Hell, it probably won't even compare to 2.11. Its more of a learning project, if I get things working. I might consider doing my own from scratch, etc. I have figured the problem out I was having, thanks to helm and, now all that remains is to swap out the BnetAuth.dll & NLS.dll for BNCSutil. Not to mention I will be able to code in my own things as I see fit, integrate other things that I want in a bot. If I ever get it working, I will release the source for every previous version of the bot. Perhaps even make it as an open source project for the community much like how Linux is done. But these are all ideas, until I get it working they really don't have any validity to them. I will probably need a little help here and there, if anyone is willing to help it would be greatly appreciated. While snobby remarks are frowned upon, as after all I am only trying to learn.

l2k-Shadow

  • l2k-Shadow
  • Hero Member
  • *******
  • Posts: 1,058
Re: VB6 - Bot: Newb Question
« Reply #19 on: November 28, 2010, 01:52:43 am »
Just note that the 2.00e source is from the time when I was learning how to code (more than 5 years ago). I greatly discourage you using it as a base for any serious project. It is inefficient, slow, and shows very childish coding style. That being said, I do encourage you to learn from it, and I hope you succeed in your endeavors. Once you feel comfortable, you definitely should think about starting your own bot from scratch. l2uthless v2.1x does not use any of < v2.1 code. I completely rewrote it.
/)  /)
( -.- )
o_(")(")
This is Bunny. Copy and paste Bunny into your signature to help him gain world domination

Warden

  • Hero Member
  • *******
  • Posts: 1,745
  • BNTA Admin
    • Battle.net Terrorist Alliance
Re: VB6 - Bot: Newb Question
« Reply #20 on: November 28, 2010, 01:54:06 am »
Just note that the 2.00e source is from the time when I was learning how to code (more than 5 years ago). I greatly discourage you using it as a base for any serious project. It is inefficient, slow, and shows very childish coding style. That being said, I do encourage you to learn from it, and I hope you succeed in your endeavors. Once you feel comfortable, you definitely should think about starting your own bot from scratch. l2uthless v2.1x does not use any of < v2.1 code. I completely rewrote it.

Do you have any of the v2.1x Sources kicking around?

Mesiah

  • Addict
  • *****
  • Posts: 165
  • Programmer of StonerBot
Re: VB6 - Bot: Newb Question
« Reply #21 on: December 06, 2010, 12:40:05 pm »
You can have the source to stonerbot, i've run out of time for developing it. The code is good and easy to follow, the connection stuff is current, and it does everythinggg besides multiprofile. I started it, havn't finished. If you know how to index sockets, i'd be glad to forward it to you.

ben_fb

  • Addict
  • *****
  • Posts: 246
Re: VB6 - Bot: Newb Question
« Reply #22 on: January 25, 2011, 11:13:48 am »
The only reason the 2.00 source is available is because it was leaked. The leaked copy had a backdoor of some sort so l2k-shadow released another copy of the 2.00 source. I'm not implying guilt or innocence, I don't know where the leak came from specifically, just that it ended up public at some point. That being said, I wouldn't expect the best work from it.

But seriously everyone, get off the whole 'stop stealing source codes' crap because every one borrows snippets every once in awhile. Why would one spend hours doing research that has already been done? As long as you know HOW to do the work, is all that matters. I wrote the "GetStuff" function, was in my first released source a long long time ago. But guess where I got it from ... api-guide getprivateprofilestring example, it's all there just not in a function.

Point I'm trying to make is: Learning from other source codes is typically good. Also, I would definitely refer to a project that is coded better to help yourself. If you need a current working source my project is available, http://radracer.us/otp/update_checks/ano/files/ano_src.zip - It's not pure genius but everything works and it's very well commented. If Mesiah is offering his source as well I would grab that too.
« Last Edit: January 25, 2011, 11:17:21 am by ben_fb »

pikachu

  • Administrator
  • Hero Member
  • *******
  • Posts: 3,344
Re: VB6 - Bot: Newb Question
« Reply #23 on: January 25, 2011, 01:41:26 pm »
Stop reviving dead threads.

Regardless of whether or not it's "stealing" (we can debate this ad infinitum), the main point is that Visual Basic 6.0 is retired and unsupported as of 2005.  It's been half a decade since Microsoft said nobody should be learning or using this piece of shit.  There's literally no excuse for starting to pick this up as a language now or ever creating a new project in it.  Microsoft has come out with four full versions of Visual Basic since the release of 6.0.  That's pretty much akin to still using Windows 98 (6.0 was released in 1998)--which is just absolutely absurd.

The only two groups of people who still use old versions of Visual Basic are Battle.net bot developers and Microsoft Access developers--all of whom should be shot.

ben_fb

  • Addict
  • *****
  • Posts: 246
Re: VB6 - Bot: Newb Question
« Reply #24 on: January 25, 2011, 04:54:58 pm »
Oops I didn't mean to bring up an old thread, it was on the first page of topics so I thought it was recent without looking at the date - my bad.

 

newBalance by DzinerStudio