Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Dyndrilliac on October 19, 2003, 01:46 PM

Title: I dunno whats wrong =(
Post by: Dyndrilliac on October 19, 2003, 01:46 PM
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


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

Any Clues would be appreciated.
Title: Re:I dunno whats wrong =(
Post by: CupHead on October 19, 2003, 01:58 PM
Clue: Instr takes more than one argument.
Title: Re:I dunno whats wrong =(
Post by: Dyndrilliac on October 19, 2003, 02:00 PM
An example would be nice?  :P

EDIT:

You mean like this?
If InStr(Ver, App.Major & "." & App.Minor & "." & App.Revision) <> 0 Then
Title: Re:I dunno whats wrong =(
Post by: Soul Taker on October 19, 2003, 05:53 PM
I believe the params are InStr(<point to start searching from>, <string to search in>, <string to search for>)
Title: Re:I dunno whats wrong =(
Post by: Banana fanna fo fanna on October 19, 2003, 06:24 PM
start index is optional.
Title: Re:I dunno whats wrong =(
Post by: Soul Taker on October 19, 2003, 10:59 PM
All of them seem to be optional.
Title: Re:I dunno whats wrong =(
Post by: bmwrb16 on October 20, 2003, 06:13 PM
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$(). '


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.
Title: Re:I dunno whats wrong =(
Post by: Banana fanna fo fanna on October 20, 2003, 07:21 PM
bmwrb +1 for actually reading something I wrote :)