In response to Jemai1
Jemai1 wrote:
Bad index is more of a list problem. Mind showing KeyUp and KeyDown?

Not at it right now but, its copy and paste from f_a's library.
How are you initializing the keys list?
In response to Jemai1
Jemai1 wrote:
How are you initializing the keys list?

It starts as a string with | separating keyboard key names

when you call set_macros, it splits the keys variable into an actual list, each as a key name minus the separators.

download the library, it takes two seconds.

read the bug report post.

Its easy to reproduce, just run a game with the library in, then reboot while in game, while its rebooting spam keys until you see the error happen in .options output or world.log.
I have it though I have no idea what parts you are copying and what are not.

For debugging it is best to place debugging messages on key points of your code to pinpoint the source of your trouble.

client
proc
KeyUp(k as text)
set instant = 1
src << "KeyUp start with [key] as argument"
ASSERT(keys) // an example check for debugging
// other stuff here
src << "KeyUp end"
In response to FIREking
FIREking wrote:
Its easy to reproduce, just run a game with the library in, then reboot while in game, while its rebooting spam keys until you see the error happen in .options output or world.log.

You do not have access to game verbs when the game is rebooting. What are you trying to do here?

After skimming through the library, I've found out that you are using KeyUp/Down before the keys list gets generated. Initially, keys is a var containing a string so keys[index] will produce errors.

mob
var
test_var = "blah"

verb
test_verb()
test_var["a"] = 0 // will produce bad index error
during set_macros, keys is converted to a list using split().
            if(istext(keys))
keys = split(keys, "|")


You could just do a tiny test here and assign text right before this:
            keys = ALL_KEYS
if(istext(keys))
keys = split(keys, "|")

If you're not getting "Inaccessible verb" when there's bad index and you can initialize keys right before you call set_macros.
Well, a quick workaround for the bad index issue is to have a check on KeyUp/KeyDown.
KeyUp(k as text)
if(!istype(keys)) return
Would it be better to just type out all of the calls?
In response to Jemai1
Jemai1 wrote:
FIREking wrote:
Its easy to reproduce, just run a game with the library in, then reboot while in game, while its rebooting spam keys until you see the error happen in .options output or world.log.

You do not have access to game verbs when the game is rebooting. What are you trying to do here?


Suppress needless error spam.
Page: 1 2