Jump to content




API runs and loads, but can't use.


3 replies to this topic

#1 Tiberium_117

  • Members
  • 23 posts

Posted 27 November 2020 - 02:21 AM

hello there fellow programmers, After attempting over and over again to find a program that will manage a draconic energy core, and run a extreme reactor with the possibility of multiple turbines I decided to take a crack at it... so a wrote a modified API that contains bits of Direwolfs Button api as well as other elements to easy the creation of a full gui with progress bars ect. I got it to the point where the code compiles and will run if you use the OS.loadAPI but if I try and use it, any function with in it, it crashes and gives me

Attempt to call global 'function' (a nil value)

My main code isn't started yet, i am just messing about with testing the api first. but here is a link to my api... https://pastebin.com/eqJyz49j

any help or pointers to show me where i went wrong or if any updates are needed will be very much apricated

if it helps, its minecraft 1.12.2 computercraft CCtweaks craft os 1.8 on the FTB Revelation mod pack

Edited by Tiberium_117, 27 November 2020 - 02:22 AM.


#2 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 27 November 2020 - 07:39 AM

Assuming that you are loading the button API in another file and that the API is called button, you are hiding it on line 3. It still exists, but because you have another variable with the same name Lua doesn't know which button table you mean and so assumes that you mean the one 'closer' in scope, which is your local variable declared on line 3.

#3 Tiberium_117

  • Members
  • 23 posts

Posted 27 November 2020 - 11:20 PM

View PostLupus590, on 27 November 2020 - 07:39 AM, said:

Assuming that you are loading the button API in another file and that the API is called button, you are hiding it on line 3. It still exists, but because you have another variable with the same name Lua doesn't know which button table you mean and so assumes that you mean the one 'closer' in scope, which is your local variable declared on line 3.

no, direwolfs code is not installed on the computer, i was saying that out of my API I incorporated Direwolfs button api in it, so this is a all in one gui building api.

#4 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 28 November 2020 - 09:52 AM

You have code that uses this API, where is that code?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users