Valhalla Legends Forums Archive | Battle.net Bot Development | [VB6] Cuphead Errors

AuthorMessageTime
RyDeOrDiE1190
Hey guys, I'm having a little trouble with my vb bot. Here is the code:
'ver
If Message = ".ver" And GetStuff("access", Username, App.Path & "\users.ini") >= 10 Then
CleanSlateBot1.Send "ÁQ.:ÁRaÁPKÁRaÁQ)ÁYOpZÁQ(:. ÁQ:.ÁRBy aKa.OpTiXÁQ:. .:Version " & App.Major & "." & App.Minor & ":."
End If
'say
Dim cmdSay As String, X As String
cmdSay = Message
If InStr(1, cmdSay, ".say", vbBinaryCompare) And GetStuff("access", Username, App.Path & "\users.ini") >= 10 Then
X = Replace(cmdSay, ".say", "")
CleanSlateBot1.Send X
End If
'home
If Message = ".home" And GetStuff("access", Username, App.Path & "\users.ini") >= 30 Then
CleanSlateBot1.Send "/join clan aka"
End If
'time
If Message = ".time" And GetStuff("access", Username, App.Path & "\users.ini") >= 0 Then
CleanSlateBot1.Send "ÁYThe time is " & Time & " On " & Date
End If
'ban
If InStr(1, cmdSay, ".ban", vbBinaryCompare) And GetStuff("access", Username, App.Path & "\users.ini") >= 80 Then
X = Replace(cmdSay, ".ban", "")
CleanSlateBot1.Send "/ban " & X
End If
'kick
If InStr(1, cmdSay, ".kick", vbBinaryCompare) And GetStuff("access", Username, App.Path & "\users.ini") >= 40 Then
X = Replace(cmdSay, ".kick", "")
CleanSlateBot1.Send "/kick " & X
End If
'des
If InStr(1, cmdSay, ".des", vbBinaryCompare) And GetStuff("access", Username, App.Path & "\users.ini") >= 80 Then
X = Replace(cmdSay, ".des", "")
CleanSlateBot1.Send "/designate " & X
CleanSlateBot1.Send "ÁYUser " & X & " designated"
Pause 1.9
End If

This code occurs when a message is sent to the chatroom.


I get a runtime error 13, a type mismatch, everytime someone talks. Its strange though, because it only seems to happen when there is a group of users larger then 3.
July 6, 2004, 1:22 AM
Dyndrilliac
Put it in code tags please.

Edit: Also, it would probably easier, and more efficient to use Select Case in this situation instead of several If statements.
July 6, 2004, 1:25 AM
crashtestdummy
[code]'ver
If Message = ".ver" And GetStuff("access", Username, App.Path & "\users.ini") >= 10 Then
CleanSlateBot1.Send "ÁQ.:ÁRaÁPKÁRaÁQ)ÁYOpZÁQ(:. ÁQ:.ÁRBy aKa.OpTiXÁQ:. .:Version " & App.Major & "." & App.Minor & ":."
End If
'say
Dim cmdSay As String, X As String
cmdSay = Message
If InStr(1, cmdSay, ".say", vbBinaryCompare) And GetStuff("access", Username, App.Path & "\users.ini") >= 10 Then
X = Replace(cmdSay, ".say", "")
CleanSlateBot1.Send X
End If
'home
If Message = ".home" And GetStuff("access", Username, App.Path & "\users.ini") >= 30 Then
CleanSlateBot1.Send "/join clan aka"
End If
'time
If Message = ".time" And GetStuff("access", Username, App.Path & "\users.ini") >= 0 Then
CleanSlateBot1.Send "ÁYThe time is " & Time & " On " & Date
End If
'ban
If InStr(1, cmdSay, ".ban", vbBinaryCompare) And GetStuff("access", Username, App.Path & "\users.ini") >= 80 Then
X = Replace(cmdSay, ".ban", "")
CleanSlateBot1.Send "/ban " & X
End If
'kick
If InStr(1, cmdSay, ".kick", vbBinaryCompare) And GetStuff("access", Username, App.Path & "\users.ini") >= 40 Then
X = Replace(cmdSay, ".kick", "")
CleanSlateBot1.Send "/kick " & X
End If
'des
If InStr(1, cmdSay, ".des", vbBinaryCompare) And GetStuff("access", Username, App.Path & "\users.ini") >= 80 Then
X = Replace(cmdSay, ".des", "")
CleanSlateBot1.Send "/designate " & X
CleanSlateBot1.Send "ÁYUser " & X & " designated"
Pause 1.9
End If[/code]
July 6, 2004, 1:26 AM
RyDeOrDiE1190
ok guys I figured it out, IM SO DUMB! First of all, I definitely should have used Select Case, but what was giving me errors, was that the names that were talking weren't on the INI, so when VB looked up the names, it got an error. Anybody got a function to verify if the ini key actually exists?
something like
CheckINI(app$, key$, filename$) as boolean
July 6, 2004, 1:31 AM
Dyndrilliac
If GetStuff(...) = vbNullString Then
July 6, 2004, 2:07 AM
RyDeOrDiE1190
o yeah, im so dumb ;D thanks alot dude.
July 6, 2004, 3:29 AM

Search