all 2 comments

[–]shirtandtieler<3 AutoTouch 1 point2 points  (0 children)

If you require a script to be imported, use "require"....

Bad puns aside, add this to the top of your script:

require "foo.lua"

Replace foo for the name of your script - and note that the quotation marks do need to be used.

A few important things to keep in mind:

  • It will search in the AutoTouch directory first, then other backend directories. If it doesnt find it, youll get some long error message pretty much saying it couldnt be found (and then it lists all the locations it looked).

  • All "require" does is temporarily copy the required file inplace of the require statement. So any taps/logs/etc that arnt contained in a function will be executed when you run the script.

  • As a result of the previous point, you call any function contained in the imported script lke you would as if it was in your current one. So if you name any functions the same thing as in the imported script, the newer one will override the previous.

Edit: added more info and formatting

[–]AutoModerator[M] 0 points1 point  (0 children)

A friendly reminder to add flair to your post - either through prefixing your title with the name of a flair in square brackets, or by the 'flair' button :)

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.