This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
 All Forums
 Feature Updates
 Closed or Deferred Requests
 [CLOSED] Reload global script file

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
breakcore Posted - 01/01/2013 : 11:00:32
I recently found out that the global lua script can be nicely edited in notepad++, but for any changes to take effect you need to open S+ config dialog and press ok.
I think it would be good to have the function like acReloadConfig() but for the global script.
Thanks!
4   L A T E S T    R E P L I E S    (Newest First)
Rob Posted - 01/02/2013 : 01:55:57
Ah, I did make a post under Did You Know:

http://www.strokesplus.com/forum/topic.asp?TOPIC_ID=376
Rob Posted - 01/01/2013 : 12:14:25
While I don't have the code, you can create a function which calls the Lua loadfile function:
http://www.lua.org/manual/5.1/manual.html#pdf-loadfile

I used to have a snippet around, but can't seem to find it. Essentially, it executes the Lua code in the file...similar to reloading the state from the tray, but only executes the code, so it's on you if there are conflicts to redefining functions or something.

However, you can have it load a different file, to keep the internal StrokesPlus.lua stuff separate. Maybe have a function in Global Lua which loads this file into Lua and call it in Global Lua (so when S+ opens, it runs the stuff in the file). Then you could create an action which also calls the function, to re-execute the contents of the file whenever you want.

As I said, I'm not sure how well it will work, but there's nothing technically wrong with doing it; really just a matter of how Lua functions/handles things being redefined...it may very well handle it gracefully, replacing any existing functions, etc.
breakcore Posted - 01/01/2013 : 11:50:29
Understood.
Somehow I missed that tray menu item, thanks!
Rob Posted - 01/01/2013 : 11:11:45
Unfortunately this cannot be done via Lua because the Lua state needs to be reloaded to properly reinitialize the Global Lua (and all actions in S+ occur within Lua). Somewhere someone asked something similar, I thought "Yea, that seems like a good idea!" and added it to the code, only to realize that it causes S+ to crash because it's trying to reload the Lua state while the Lua state is executing.

Alternatively, you can right-click the S+ tray icon and click Reload Config and Lua Engine

StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000