Results 1 to 10 of 10

Thread: [RESOLVED] If statement not catching - Different

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2007
    Location
    Riverton, WY
    Posts
    36

    Resolved [RESOLVED] If statement not catching - Different

    VB Code:
    1. If InStr(comFinder, "!roll") = 1 Then
    2.                     If Len(comFinder) = 7 Or 8 Then
    3.                         numFinder = InStr(comFinder, " ")
    4.                        
    5.                         'Error here.
    6.                         fstNum = Right(comFinder, Len(comFinder) - numFinder)
    7.                         sendToIRC (sendMsgText & " PRIVMSG #shadowfall :" & charName & " rolled " & CStr(fstNum) & " dice: " & diceRoller(fstNum, 0))
    8.                    
    9.                     ElseIf Len(comFinder) = 9 Or 10 Or 11 Then
    10.                         numFinder = InStr(comFinder, " ")
    11.                         numFinder2 = InStr(numFinder + 1, comFinder, " ")
    12.                         fstNum = Mid(comFinder, numFinder + 1, numFinder2 - 1)
    13.                         sndNum = Mid(comFinder, numFinder2 + 1, Len(comFinder) - (numFinder2 + 1))
    14.                    
    15.                         sendToIRC (sendMsgText & " PRIVMSG #shadowfall :" & charName & " rolled " & CStr(fstNum) & " dice: " & diceRoller(fstNum, sndNum))
    16.                     End If
    17.                 End If

    If it is sent "!roll 3" or "!roll 12" it works perfectly.

    If it is sent "!roll 3 2", "!roll 10 2", or "!roll 10 10" it fails. It catches on the marked line of code. It shouldn't even be touching that code at this point. It shouldn't be meeting the requirements and should therefore be skipping over that lil' section to the "ElseIf".

    What's going on?

    Thank you all in advance for your time.
    Last edited by CyberInfantry; Jan 23rd, 2007 at 04:57 PM. Reason: No longer resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width