Valhalla Legends Forums Archive | Battle.net Bot Development | Demos don't work.

AuthorMessageTime
register
1. http://cuphead.valhallalegends.com/tutorials/lesson1.htm
2. http://cuphead.valhallalegends.com/ocx.htm
3. http://cuphead.valhallalegends.com/ocx_me.txt
4. http://cuphead.valhallalegends.com/files/source/keytester_source.zip

Viewed the above.

1. #1 above gives conflicting examples.

[QUOTE]
from #1

When this is done, you’re ready to go. Press the play button towards the top of the Visual Basic interface. (Figure 1.8) Check your home channel, because unless something went wrong… Your bot is there.

[/QUOTE]
I notice that neither has a .Connect

Should I believe the quote to be truthful, and it should work?

2. Tried the Quick Demo in #3 above.

Test resulted in same as #1

3. Viewed and copied applicable source from keytester_source.zip form.

Test resulted in same as #1

All examples were edited to correct values. ( user/pass/server, etc.

Please Advise.

P.S.

If I'm using any pre-release pages and/or pre-release source code, let me know.

If these pages haven't had any volunteers read and test the code, report the author's conflicting examples and incompleteness, let me know.

and anything else.

P.S.S. I'd like a cut/paste example to work before I continue any farther.
May 29, 2004, 5:56 AM
Dyndrilliac
CleanSlateBot does have a Connect() Function, however, if you had read the documentation, you'd know that.

[code]With CleanSlateBot1
.BNLSBotID = "CupChat"
.BNLSBotPassword = "IsSexy"
.CDKey = "XXXXYYYYYZZZZ"
.ChangePassword = False
.Character = ""
.HomeChannel = "Clan [vL]"
.LODKey = "AAAABBBBCCCCDDDD"
.NewPassword = "None"
.Password = "YourPassword"
.Product = "PXES"
.Realm = "USEast"
.Server = "useast.battle.net"
.UseRealm = False
.Username = "YourUsername"
.UseUDP = False
End With

Me.CleanSlateBot1.Connect
[/code]

Try that, replacing the information above with your own. Note you should put the above code in the same place it was in the screen shots, within the Form_Load() Procedure.
May 29, 2004, 6:08 AM
register
[QUOTE]
CleanSlateBot does have a Connect() Function, however, if you had read the documentation, you'd know that.
[/QUOTE]
1. Where are you getting Connect() from?
2. It's a Method, and I'd guess a Sub, not a Function.
3. Did you read my post, or the documentation. ( Refer to #1 above )?
4. Why are you using .Connect, and not Connect(), as you refer to in the above quote?
Edit Add: 5. You have omitted .Accept ( forget, or obsolete? )
Edit Add: 6. Did you test what you posted, or just assumned?

I replaced the information above with my own, and no change.
May 29, 2004, 6:22 AM
Eli_1
[quote author=register link=board=17;threadid=7020;start=0#msg62583 date=1085811776]
[QUOTE]
CleanSlateBot does have a Connect() Function, however, if you had read the documentation, you'd know that.
[/QUOTE]
1. Where are you getting Connect() from?
2. It's a Method, and I'd guess a Sub, not a Function.
3. Did you read my post, or the documentation. ( Refer to #1 above )?
4. Why are you using .Connect, and not Connect(), as you refer to in the above quote?
Edit Add: 5. You have omitted .Accept ( forget, or obsolete? )
Edit Add: 6. Did you test what you posted, or just assumned?

I replaced the information above with my own, and no change.
[/quote]

1: Connect() is the .Connect function of the CleanSlateBot control.
2: No, it's a function. You don't need to worry about the events the Winsock control raises, such as Connect and Close.
3: Of course not...
4: Refer to #1
5: Refer to #6
6: His information is correct, except that it lacks an Accept. I suggest you use the search feature to find the correct accept number, because it's not -65 or whatever the documentation tells you it is (maybe some nice person will post it for you).
May 29, 2004, 4:54 PM
Stealth
Accept's value needs to be 579728.
May 29, 2004, 5:49 PM
register
1: Meaning .Connect calls Function Connect(). I understand this, but the demos stated "When this is done, you’re ready to go." and "That's all it takes." If the demo doesn't work, I can't trust the accuracy of anything else on the page. So I ask questions here, because Cuphead states "no technical support is provided, please do not ask for help with this software", or I'd ask him directly.

2: If it's a function, result = CleanSlateBot1.Connect, will return what?

Using 579728 doesn't change anything.

Perhaps someone has a link to a page or thread with a demo that is complete and has been tested to work?

Here is the entire contents of Form1.frm

[QUOTE]
VERSION 5.00
Object = "{450F7869-D4E1-4A4F-AF9A-E0DE906B576B}#1.0#0"; "cleanslatebot.ocx"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 'Windows Default
Begin CleanSlateBotOCX.CleanSlateBot CleanSlateBot1
Left = 480
Top = 480
_ExtentX = 1085
_ExtentY = 450
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Form_Load()

With CleanSlateBot1
.BNLSBotID = ""
.BNLSBotPassword = ""
.CDKey = ""
.ChangePassword = False
.Character = ""
.HomeChannel = ""
.LODKey = "AAAABBBBCCCCDDDD"
.NewPassword = "None"
.Password = ""
.Product = "PXES"
.Realm = ""
.Server = ""
.UseRealm = False
.Username = ""
.UseUDP = False
.Accept = "579728"
End With

Me.CleanSlateBot1.Connect

End Sub
[/QUOTE]
With values for bnlsbotid, bnlsbotpassword, cdkey, homechannel, password, realm, server, and username removed.
May 29, 2004, 6:18 PM
R.a.B.B.i.T
What Stealth means is that you should set the .Accept value before doing anything else:
[code]With CleanSlateBot1
'This first...
.Accept = 579728

'The the rest
.BNLSBotID = "CupChat"
.BNLSBotPassword = "IsSexy"
.CDKey = "XXXXYYYYYZZZZ"
.ChangePassword = False
.Character = ""
.HomeChannel = "Clan [vL]"
.LODKey = "AAAABBBBCCCCDDDD"
.NewPassword = "None"
.Password = "YourPassword"
.Product = "PXES"
.Realm = "USEast"
.Server = "useast.battle.net"
.UseRealm = False
.Username = "YourUsername"
.UseUDP = False
End With

Me.CleanSlateBot1.Connect[/code]
May 29, 2004, 6:35 PM
Dyndrilliac
[quote author=register link=board=17;threadid=7020;start=0#msg62623 date=1085854715]
2: If it's a function, result = CleanSlateBot1.Connect, will return what?
[/quote]

Silly person, a function does not always have to return a value(I.E., void).

Also, the documentation IS kind of outdated, cut it some slack.

Below is my LoadConfig() and my call to Connect(). My old CSB Bot which this was taken from works without any issues.[code]Public Sub LoadConfig()
Version = App.ProductName & " v" & App.Major & "." & App.Minor & "." & App.Revision

Dim pfNum As Integer

With frmMain
.C.UserName = GetStuff("Config.ini", "Main", "UserName")
.C.Password = GetStuff("Config.ini", "Main", "Password")
.C.NewPassword = GetStuff("Config.ini", "Main", "New Password")
.C.Product = GetStuff("Config.ini", "Main", "Product")
.C.Server = GetStuff("Config.ini", "Main", "Server")
.C.Character = GetStuff("Config.ini", "Main", "Realm Character")
.C.CDKey = GetStuff("Config.ini", "Main", "CDKey")
.C.LODKey = GetStuff("Config.ini", "Main", "LOD CDKey")
.C.HomeChannel = GetStuff("Config.ini", "Main", "Home Channel")
End With

'// Options
varChangePassword = GetStuff("Config.ini", "Options", "Change Password")
varUseRealm = GetStuff("Config.ini", "Options", "UseRealm")
varUDPPlug = GetStuff("Config.ini", "Options", "LagPlug")
varJLMsg = GetStuff("Config.ini", "Options", "Join/Leaves")
varSongSwitch = GetStuff("Config.ini", "Options", "SongDisplay")
'varFilter = GetStuff("Config.ini", "Options", "ClientFilter")

If varChangePassword = "1" Then frmMain.C.ChangePassword = True Else frmMain.C.ChangePassword = False
If varUseRealm = "1" Then frmMain.C.UseRealm = True Else frmMain.C.UseRealm = False
If varUDPPlug = "1" Then frmMain.C.UseUDP = False Else frmMain.C.UseUDP = True
If varJLMsg = "1" Then varJoinLeave = True Else varJoinLeave = False
If varSongSwitch = "1" Then varShowSong = True Else varShowSong = False
'If varFilter = "1" Then varFilD1 = True Else varFilD1 = False

varServer = frmMain.C.Server
Select Case (varServer)
Case "uswest.battle.net"
frmMain.C.Realm = "USWest"
Case "useast.battle.net"
frmMain.C.Realm = "USEast"
Case "europe.battle.net"
frmMain.C.Realm = "Europe"
Case "asia.battle.net"
frmMain.C.Realm = "Asia"
End Select
End Sub[/code]

Call event:[code]Private Sub mnuConnect_Click()
On Error Resume Next

Me.C.BNLSBotID = "<Snipped>"
Me.C.BNLSBotPassword = "<Snipped>"
Me.C.Accept = 579728

If Me.C.Connected = True Then
AddC Chat, vbRed, "Already Connected!"
Exit Sub
Else
Me.C.Connect
End If

End Sub[/code]
May 29, 2004, 7:13 PM
Stealth
[quote author=register link=board=17;threadid=7020;start=0#msg62623 date=1085854715]
[code]
.Accept = "579728"
[/code]
[/quote]

Accept is a numeric value - when you're using numbers, you shouldn't put them in quotes. Quotes are for string literals.

I don't think that made a huge difference above, because the VB IDE makes that conversion for you.
May 29, 2004, 9:38 PM
register
Two changes made.

.Accept is now the first property being set.
.Accept = 579728 ' quotes removed

No change.

And by Dyndrilliac's example, ( although not a bad idea for alphabetical reading sake ), does accept need to be the first property set?
May 29, 2004, 10:11 PM
register
Here's more information on what's happening.

[QUOTE]

Private Sub CleanSlateBot1_BnetConnected()
Text1.Text = Text1.Text & "BnetConnected." & vbCrLf
End Sub

Private Sub CleanSlateBot1_BnetConnecting()
Text1.Text = Text1.Text & "BnetConnecting..." & vbCrLf
End Sub

Private Sub CleanSlateBot1_BnetError(ErrorNumber As Integer, Description As String)
Text1.Text = Text1.Text & "BnetError :" & ErrorNumber & Description & vbCrLf
End Sub

Private Sub CleanSlateBot1_BNLSAuthEvent(Success As Boolean)
Text1.Text = Text1.Text & "AuthEvent: " & Success & vbCrLf
End Sub

Private Sub CleanSlateBot1_BNLSConnected()
Text1.Text = Text1.Text & "BNLS Connected." & vbCrLf
End Sub

Private Sub CleanSlateBot1_BNLSConnecting()
Text1.Text = Text1.Text & "BNLS Connecting..." & vbCrLf
End Sub

Private Sub CleanSlateBot1_BNLSDataError(Message As Byte)
Text1.Text = Text1.Text & "BNLSData Error: " & Message & vbCrLf
End Sub

Private Sub CleanSlateBot1_BNLSDisconnected()
Text1.Text = Text1.Text & "BNLS Disconnected." & vbCrLf
End Sub

Private Sub CleanSlateBot1_BNLSError(ErrorNumber As Integer, Description As String)
Text1.Text = Text1.Text & "BNLSError: " & ErrorNumber & Description & vbCrLf
End Sub

Private Sub CleanSlateBot1_LoggedOnAs(Username As String, Product As String)
Text1.Text = Text1.Text & "LoggedOnAs: " & Username & Product & vbCrLf
End Sub

Private Sub CleanSlateBot1_LogonEvent(Message As Byte)
Text1.Text = Text1.Text & "LogonEvent: " & Message & vbCrLf
End Sub

Private Sub CleanSlateBot1_ServerError(ByVal Message As String, SimulatedEvent As Boolean)
Text1.Text = Text1.Text & "ServerError: " & Message & vbCrLf
End Sub

Private Sub CleanSlateBot1_ServerInfo(ByVal Message As String, SimulatedEvent As Boolean)
Text1.Text = Text1.Text & "ServerInfo: " & Message & vbCrLf
End Sub

Private Sub CleanSlateBot1_VersionByte(VersionByte As Long)
Text1.Text = Text1.Text & "VersionByte: " & VersionByte & vbCrLf
End Sub

Private Sub CleanSlateBot1_VersionCheck(Message As Byte, ExtraInfo As String)
Text1.Text = Text1.Text & "VersionCheck: " & Message & ExtraInfo & vbCrLf
End Sub
[/QUOTE]
and this gives me

[QUOTE]
BNLS Connecting...
BNLS Connected.
AuthEvent: True
VersionByte: 201
BnetConnecting...
BnetConnected.
VersionCheck: 7
VersionCheck: 0
BNLS Disconnected.
[/QUOTE]

The LogonEvent and LoggedOnAs events never happen.

May 29, 2004, 11:45 PM
Dyndrilliac
No, accept does not have to be the first value set.

One important thing I see is that your events are not parsing correctly, for some of them at least. You really should read the documentation. When the event has the parameter "Message As Byte" in CSB, this means that there are several messages that can be recieved depending on what occurs during the logon process. I use a Select Case statement to output a message depending on the Byte Identifier for the message. Here's an example:

[code]Private Sub C_LogonEvent(Message As Byte)
Select Case (Message)
Case "0"
AddC Me.Chat, vbYellow, "BNET: Account Doesn't Exist!"
Case "1"
AddC Me.Chat, vbRed, "BNET: Invalid Password!"
Case "2"
AddC Me.Chat, vbGreen, "BNET: Login Successful!"
Case "3"
AddC Me.Chat, vbYellow, "BNET: Attempting To Create Account.."
Case "4"
AddC Me.Chat, vbGreen, "BNET: Account Creation Was A Success!"
End Select
End Sub[/code]

Using this, you can get a more detailed idea of what error is occuring and where.
May 30, 2004, 2:34 AM
register
[QUOTE]
One important thing I see is that your events are not parsing correctly, for some of them at least. You really should read the documentation.
[/QUOTE]
I have printouts of the links in my first post, and am following the documentation to interpret the Message As Byte. Following the Keep It Simple Stupid phrase, by not getting ahead of myself when the base doesn't work.

Before making any change, I attempted to connect again, and now it works.

[QUOTE]
BNLS Connecting...
BNLS Connected.
AuthEvent: True
VersionByte: 201
BnetConnecting...
BnetConnected.
VersionCheck: 7
VersionCheck: 0
LoggedOnAs: #####PXES 0 0 1 0 0 0 0 0 PXES
ServerInfo: Welcome to Battle.net!
ServerInfo: This server is hosted by AT&T.
ServerInfo: There are currently 84555 users playing 20653 games of Starcraft Broodwar, and 255146 users playing 89252 games on Battle.net.
ServerInfo: Last logon: Sat May 29 8:55 PM
[/QUOTE]
Maybe we'll never know what the problem was.
May 30, 2004, 4:17 PM
Gangz
If something works out of luck it does you know good. You should try to recreate the error so you know how to fix something like that in the future. Just a suggestion though.
May 30, 2004, 5:52 PM
register
Chance, not luck.

I've tried to recreate the error, even creating a new project, but each time I was unable to get an error.

Good suggestion though, that I hope everyone that doesn't already do, starts doing.
May 30, 2004, 10:45 PM

Search