Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Need help with a code that doesn't work correctly


VitinhooxD
 Share

Recommended Posts

Hello.Well this is the third massive bug I have found with my code.I have made a sub that loads a picture on an certain image in frmMainGame based on your hotbar skill number in a certain slot.In the first time I try to use it , it only sets the variables but doesnt load the images.Then I try it again and it works perfectly.Well here is the subs :

PS: YeahHotBar sets the hotbar variable.I dunno why I have put this name into it.
PS2: All the packets are set up.

LoadImages Sub:
```
Sub LoadHotBarImages(ByVal Index As Long)
Dim number As Long
Dim skill As String
Dim i As Long

For number = 1 To 10
LoadHotBar (number)
Next
frmMainGame.picHotBar.Picture = frmMainGame.picTempBank.Picture

For i = 1 To 10
If HotBar(Index).slot(i) <> "0" Then
skill = CLng(HotBar(Index).slot(i))
number = spell(skill).Icon
frmMainGame.Image1(i).Picture = LoadPicture(App.Path & "\data files\graphics\spellicons\" & number & ".gif")
Else
frmMainGame.Image1(i).Picture = frmMainGame.picTempBank.Picture
End If
Next

End Sub
```
Here is how I call it:
```
Private Sub picSpells_DblClick()
    Dim spellnum As Long
Dim i As Long

For i = 1 To 10
LoadHotBar (i)
Next
    spellnum = IsPlayerSpell(SpellX, SpellY)

    If spellnum <> 0 Then
        For i = 1 To 10
        If GetHotBar(MyIndex, i) = "0" Then
        Call YeahHotBar(i, spellnum)
        LoadHotBar (i)
        LoadHotBarImages (MyIndex)
        Exit Sub
        End If
        Next

    End If

End Sub

```
Thanks , Vitin.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...