Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Jscript ➜ reduce the MUSHclient variables

reduce the MUSHclient variables

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Avariel   Portugal  (55 posts)  Bio
Date Sat 01 Mar 2003 12:39 AM (UTC)
Message
i read about using the less number of MUSHclient variables possible increases the speed of processing and i would like some help in doing it... i only use this variables when i dont know how to use inside language variables so im a little stucked..

ok this is what i want do do...

trigger1 set affliction0 to 1
trigger2 set affliction1 to 1

trigger3 delete affliction0
trigger4 delete affliction1

now i have the trigger5 that will check this variables and chose what do do...

to set priorities the vars are grouped in an array

var affliction = new Array()

affliction [0] = affliction0
affliction [1] = affliction1

trigger5 will run a cicle through the array and cure the first afflition with value = 1


this works with the use of MUSHclient variables but i would like to do it without the use of them if possible..


thank you

The Avariel Wind Lord
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 04 Mar 2003 01:13 AM (UTC)
Message
Put your Jscript variables outside a function - they should then persist throughout the session (but they won't be saved from one session to another).

eg.


var affliction0 = 0;

function mysub (name, output, wildcards)
  {

// blah blah - some processing here 

  }  // end of function



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


11,602 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.