User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Lua+ on require

  1. #1
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua+ on require

    would it be possible to check whenever the require inbuild function is called?

  2. #2
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Lua+ on require

    Just register your own function that calls require

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Lua+ on require

    but I want to use the inbuild require aswell :[

  4. #4
    Clicker Fusion 2.5 DeveloperSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,739
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Lua+ on require

    Loop through the whole script, searching for 'require', excluding string and comments, and replace it by requireX, then register that function

  5. #5
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Lua+ on require

    that would be annoying to do with 53 files spread through 7 folders with an unknown number of subfolders

  6. #6
    No Products Registered

    Join Date
    Aug 2006
    Posts
    984
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Lua+ on require

    or if you had the requires inside another function, like:

    Code:
    function load()
         blah = require("whatever")
         signal()
    end
    it might even be better to do that if you ever need to reload whatever was used by require

  7. #7
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Lua+ on require

    the reason I want it to be require is because its recognized by alot of lua editing programs such as Notepad++. I already thought of that, Xgoff, but I figured having the require function as the one would be better.

  8. #8
    No Products Registered

    Join Date
    Aug 2006
    Posts
    984
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Lua+ on require

    about the only other thing i can think of, then, is overwriting the standard require with your own function after moving the real require to some other variable

    Code:
    require2 = require
    require = function (...)
         alert_function()
         return require2(...)
    end
    that's pretty crude but it might work, though i don't know if modules will use that one or the default require

  9. #9
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Lua+ on require

    That *might* work, I need to test it out. Hold on.

  10. #10
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Denmark
    Posts
    1,812
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Lua+ on require

    ilu Xgoff It worked beautifully. Thanks!

Page 1 of 2 1 2 LastLast

Similar Threads

  1. how to require min. 3letters in EditBox ??
    By Sebzero in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 4th July 2011, 10:47 PM
  2. Almost All New Extensions Here Require
    By RickyRombo in forum Beta Flash Extensions
    Replies: 0
    Last Post: 13th April 2011, 10:21 PM
  3. Hi-Score require name
    By Kracker in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 14th January 2010, 07:13 AM
  4. Require Restart
    By AsmDev in forum Install Creator and Patch Maker
    Replies: 4
    Last Post: 29th September 2009, 12:04 PM
  5. .PNG images require compression?
    By ionside in forum Multimedia Fusion 2 - Technical Support
    Replies: 23
    Last Post: 1st December 2008, 02:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •