Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

mushclient global variable assignment on connect

MeliniMelini Member Posts: 9
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

  • AmmarAmmar Member, Secret Squirrel Posts: 21
    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.
  • DdeeDdee Member Posts: 4
    (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.
    Ammar
Sign In to Comment.