mushclient global variable assignment on connect

Disclaimer:  I'm using mushclient as I'm coding for visually impaired players, so please don't answer simply with a suggestion to use a different client!

How do I initialise a global variable on connection?

I understand there is a global script defined in 'Scripts' as "External Script File".

I've defined a function in there called onLoad().

I've named this function in the "World Events - Connect".

However, when I am logged in I test my variable and it still says undefined.

This is my onLoad function...

function onLoad()
boolInCombat = false
end

Comments

  • What I did was set my function to load on the text "Password correct. Welcome to Achaea." That fires onLoad() which assigns all the variables.
  • (Just to let you know that Melini has departed and I have picked up their work)

    This has been resolved.

    Global variables can be declared in the script referenced as 'External Script File' before any function declarations.
Sign In or Register to comment.