Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
SusiKette

"attempt to call field" error

Question

Posted

I'm trying to turn a big/extreme reactor on/off with a simple practice program, but I get a following error when I try to run the program:

/lib/br_control.lua:4: attempt to call field 'setActive' (a boolean value):
stack traceback:
	/lib/br_control.lua:4: in main chunk
	(...tail calls...)
	[C]: in function 'xpcall'
	/lib/process.lua:63: in function </lib/process.lua:59>

A bit more detailed explanation on what each line means might help future troubleshooting.

The test program looks like this:

local br = component.br_reactor

if(br.getEnergyStored() < 9000000) then
  br.setActive(false)
end

if(br.getEnergyStored() > 1000000) then
  br.setActive(true)
end

Simply put if the internal energy buffer of the reactor is 90% full, the reactor turns off and if it goes below 10% it turns on. I've made sure that the computer actually recognizes the reactor.

I don't really know why this doesn't work.

5 answers to this question

Recommended Posts

  • 0
Posted

Im sorry but this one has me stumped. The error is basically saying that 'br.setActive' is a boolean and not a function. From the wiki we know its  a method that takes a boolean so I dunno WTF is going on here. Maybe a version bug between BR and OC or .... I really don't know, sorry :/ 

  • 0
Posted
9 hours ago, BrisingrAerowing said:

Otherwise, you may want to re-download the mod and try again.

I can't really do that since I'm not the one who updates the modpack I'm using. I'll just have to wait for an update and hope that things work as intended :/

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.