Valhalla Legends Forums Archive | Battle.net Bot Development | I dunno whats wrong =(

AuthorMessageTime
Dyndrilliac
[code]If InStr(Ver) <> 0 Then
MsgBox "Error while checking version. Version check not passed, but you are allowed to proceed.", vbInformation, "Error"
Ver = App.Major & "." & App.Minor & "." & App.Revision
NewsS = "Server Temporarily Unavailable"
End If
If Ver <> App.Major & "." & App.Minor & "." & App.Revision Then
MsgBox " It has been detected you are running an old version of this bot. Please check for updates."
NewVersion
End If
If Form5.Text1.text <> KeyBC Then
MsgBox " You have entered an invalid SmartBot KeyCode. This program will now close, as unauthorized personel have been detected."
Form5.Text1.text = vbNullString
End
Else
MsgBox " You have entered a valid SmartBot KeyCode. Welcome to " & App.ProductName & " v" & Ver & "."
Form5.Text1.text = vbNullString
Unload Form5
End If[/code]

It errors saying something about needing a list seperator @ InStr(Ver)

Any Clues would be appreciated.
October 19, 2003, 6:46 PM
CupHead
Clue: Instr takes more than one argument.
October 19, 2003, 6:58 PM
Dyndrilliac
An example would be nice? :P

EDIT:

You mean like this?
[code]If InStr(Ver, App.Major & "." & App.Minor & "." & App.Revision) <> 0 Then[/code]
October 19, 2003, 7:00 PM
Soul Taker
I believe the params are InStr(<point to start searching from>, <string to search in>, <string to search for>)
October 19, 2003, 10:53 PM
St0rm.iD
start index is optional.
October 19, 2003, 11:24 PM
Soul Taker
All of them seem to be optional.
October 20, 2003, 3:59 AM
bmwrb16
[code]Dim strHi As String
strHi = "Hi, my name is Brian!"

' Having InStr(strHi, "Hi") not =, <>, >, < anything is the same thing as InStr(strHi, "Hi") <> 0; InStr is a function so it returns an integer of the position where it was found, 0 = not found and any other integer means it did find it and thats the position. '

If InStr(strHi, "Hi") Then ' We're Going to search through string 'strHi' for string "Hi". '
MsgBox "InStr is fun!" ' If found create a message box containing "InStr is fun!". '
End If

' Note: InStr is also case sensitive so to eliminate that problem just put InStr(LCase$(String1), LCase$(String2)) or UCase$(). '[/code]

Like St0rm.iD said that start index is optional so you just put the string your searching and then what you want to find, like in the above example (Just check the arguments that the function is asking for if your not sure!).

Hope this helps or teaches someone something new!

PS.

Lol yes Soul Taker they all seem to be optional, but theres a default for each one.
October 20, 2003, 11:13 PM
St0rm.iD
bmwrb +1 for actually reading something I wrote :)
October 21, 2003, 12:21 AM

Search