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

[EO3.0] Hotbar Subscript out of range


lurv
 Share

Recommended Posts

Ever since i changed my MAX_HOTBAR = 12 to MAX_HOTBAR = 8 it has given me subscript out of range if i use any of the keys 9, 0, - or =

The subscript out of range highlights this

![](http://puu.sh/j2bxh/08abcc1305.png)

**FIXED. CHECK OUT THE THREAD IN CASE YOU HAVE THE SAME ERROR AFTER CHANGING HOTBAR NUMBER.**
Link to comment
Share on other sites

Subscript out of range means that a value for something like an index, is higher or lower than an array's Boundaries(like below 0 or higher than for example, your max hotbar value)

What is the value of Slot withing that line? you can hover over any variable within that sub if you pause or it errors and press Debug.
Link to comment
Share on other sites

I stumbled upon the code by accident, but i've fixed it. I changed 9 to MAX_HOTBAR but there was still a code that said SendHotbarUse 9,10,11,12

in Sub HandleKeyUp

```
' hotbar
   If Not chatOn Then
       For I = 1 To MAX_HOTBAR
           If KeyCode = 48 + I Then
               SendHotbarUse I
           End If
       Next
       If KeyCode = 48 Then ' 0
           'SendHotbarUse 10           - Disabled, causes subcript out of range because max hotbar is 8
       ElseIf KeyCode = 189 Then ' -
           'SendHotbarUse 10           - Disabled, causes subcript out of range because max hotbar is 8
       ElseIf KeyCode = 187 Then ' =
           'SendHotbarUse 10           - Disabled, causes subcript out of range because max hotbar is 8
       End If
   End If

```
That is my fixed code. I just disabled the sendhotbaruses in case i want them in the future.
for some reason For I = 1 To MAX_HOTBAR was 1 To 9\. Weird.
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...