I am just starting writing scripts for Foldit. I have no experience of Lua, but I have been a professional programmer for many years, so my status is "noob with insight". In my first script, I want to print out contactMap data. I have copied and pasted the functions from http://foldit.wikia.com/wiki/Foldit_Lua_Functions. The error I get is:
*** attempt to index global 'contactmap' (a nil value) ***
Here is my code:
segmentCount = get_segment_count() print ("Segment count: " .. segmentCount) for source = 1, segmentCount do for target = source + 1, segmentCount do inContact = contactmap.IsContact(source, target) heat = contactmap.GetHeat(source, target) print("Segments "..source..", ".. target..": in contact = "..inContact..", heat = "..heat) end end
Thanks in advance for any enlightenment.