Error with index global in Lua recipe for foldit.org -


i starting writing scripts foldit. first experience of lua, status "noob insight". in first script, want print out contactmap data. have copied , pasted functions http://foldit.wikia.com/wiki/foldit_lua_functions. error is:

attempt index global 'structure' (a nil value)

here code:

segmentcount = structure.getcount() print ("segment count: " .. segmentcount)  source = 1, segmentcount   target = source + 1, segmentcount     incontact = contactmap.iscontact(source, target)     heat = contactmap.getheat(source, target)     print("segments "..source..", ".. target..": heat = "..heat)   end end 

thanks in advance enlightenment.


edit

the problem had loaded v1 recipe, , foldit continued treat v1 syntax. solution create new (scriptv2) recipe, , load same code.

you seem doing according documentation. error means contactmap not defined (has nil value) , code fails on accessing elements. i'd check version of foldit using documentation says contactmap new in version 2.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -