View Single Post
  #5  
Unread 03-04-2013, 04:58 PM
Zinx Zinx is offline
A Young Mystail Rat
 
Join Date: Dec 2012
Server: Unrest
Posts: 7
Default

Quote:
Originally Posted by Drumstix42 View Post
You could probably get around the quotes problem in names if you wrap things in single quotes.

Sometimes in the code you have to use tricks and wrap things in single quotes and then wrap it again later in double quotes, Either way, if it doesn't affect many things it's probably no big deal.
Yeah I think it only does that one item, which I can just special case. I use double quotes specificly because single ones are very common

Edit: Oh, a little background on why this happens. When a spell is added or removed from the tracker, 3 variables get updated - one with code to run when a specific spell is removed from a maintained spell slot, one with code to run when a spell gets a maintained slot, and one to run to build those two/itself with conditionals (for removing), etc. The variables are named with a prefix and the spell name, so the lookup is roughly O(1) as far as the script is concerned.

The only slow part of this is updating the strings, and it's still fairly fast, and that's also the least common operation (you generally do not add/remove tracked spells during game play - this happens for example when changing which spells are tracked with a spell tracker, and when you change the hotbars around).

Last edited by Zinx : 03-04-2013 at 05:16 PM.
Reply With Quote