Include enquiry...

Discuss, ask for help, share ideas, give suggestions, read tutorials, and tell us about bugs you have found with MicroMacro in here.

Do not post RoM-Bot stuff here. There is a subforum for that.
Forum rules
This is a sub-forum for things specific to MicroMacro.

This is not the place to ask questions about the RoM bot, which uses MicroMacro. There is a difference.
Post Reply
Message
Author
DarkP
Posts: 5
Joined: Wed Oct 08, 2008 12:37 pm

Include enquiry...

#1 Post by DarkP » Thu Oct 09, 2008 9:58 pm

Can I actually do like this?

main code

Code: Select all

[bla bla bla]

if (class == MELEE) then
   include("melee.lua");
elseif (class == RANGED) then
   include("ranged.lua");
end

[bla bla bla]

function main()
   while(1) do
      mainloop()
   end
end
While the mainloop function resides in both melee.lua and ranged.lua? So different mainloop can be created for each class...

melee.lua & ranged.lua

Code: Select all

function mainloop()
    [bla bla bla]
end

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Include enquiry...

#2 Post by Administrator » Thu Oct 09, 2008 10:06 pm

Yes. Lua can be strange when it comes to prototyping functions, so I would suggest NOT creating a default mainloop() and to do exactly like in your own example.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests