Results 1 to 7 of 7

Thread: looping...

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2005
    Posts
    238

    looping...

    Ok i have this code
    VB Code:
    1. If intExp > llevel Then
    2.     If intLevel = (level - 1) Then
    3.     llevel = llevel * 1.7
    4.     level = level + 1
    5.     intLevel = intLevel + 1
    6.     frmRPG.S.Enabled = True
    7.     intHeal = intHeal + 10
    8.     intHP = intMaxHP
    9.     frmRPG.cmdFlee.Caption = "Use Heal (" & intHeal & ")"
    10.     intSet = intSet + 15
    11.     frmRPG.Label1.Caption = "Skill Credits: " & intSet
    12.     frmRPG.Label4.Caption = "LVL"
    13.     statp = statp + 2
    14.     If intLevel = 15 Then
    15.     frmRPG.Option8.Visible = True
    16.     End If
    17.     End If
    18.     End If

    and i want that to loop until intExp > llevel that is not true anymore.... How would i do that?
    The Tempest Shall Never Die.

  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: looping...

    VB Code:
    1. Do While intExp > llevel
    2.     If intLevel = (level - 1) Then
    3.     llevel = llevel * 1.7
    4.     level = level + 1
    5.     intLevel = intLevel + 1
    6.     frmRPG.S.Enabled = True
    7.     intHeal = intHeal + 10
    8.     intHP = intMaxHP
    9.     frmRPG.cmdFlee.Caption = "Use Heal (" & intHeal & ")"
    10.     intSet = intSet + 15
    11.     frmRPG.Label1.Caption = "Skill Credits: " & intSet
    12.     frmRPG.Label4.Caption = "LVL"
    13.     statp = statp + 2
    14.     If intLevel = 15 Then
    15.     frmRPG.Option8.Visible = True
    16.     End If
    17.     End If
    18.     Loop

    I think...


    Has someone helped you? Then you can Rate their helpful post.

  3. #3
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: looping...

    That would work except, he is not actually changing the value intExp anywhere within the loop.
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  4. #4
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: looping...

    Quote Originally Posted by DKenny
    That would work except, he is not actually changing the value intExp anywhere within the loop.
    He is changing llevel though
    Last edited by manavo11; Feb 9th, 2006 at 04:13 PM.


    Has someone helped you? Then you can Rate their helpful post.

  5. #5
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: looping...

    I'll get my coat...
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Mar 2005
    Posts
    238

    Re: looping...

    lol :P that totally just froze my game
    The Tempest Shall Never Die.

  7. #7
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: looping...

    Maybe intExp is much bigger than llevel so it just takes a lot of time?


    Has someone helped you? Then you can Rate their helpful post.

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