Jump to content




Computer Controlled Seed Analyzer Weird method?


  • You cannot reply to this topic
2 replies to this topic

#1 gheotic

  • Members
  • 64 posts
  • LocationDenmark

Posted 20 July 2016 - 02:59 PM

Recently I found out about the Computer Controlled Seed Analyzer from agricraft where you get analyze and get stats of the seeds. My problem with it is that when ever you run the method called: "getSpecimenStats()" in lua mode, it's printing out 3 lines on the screen with the 3 different stats, or thats what it looks like.

Just as a example:
Stats of a seed:
- Growth: 1
- Gain: 2
- Strength: 3

Program run in lua:
m = peripheral.wrap("back")

-- Running directly
m.getSpecimenStats()
1
2
3

-- Saving it as a variable
stats = m.getSpecimenStats()
stats -- Btw this comes out as a number variable
1

How can i save all variables when its, not really returning them in a array or dictionary, but just kinda printing 3 lines.

#2 Lupus590

  • Members
  • 2,028 posts
  • LocationUK

Posted 20 July 2016 - 03:26 PM

Recommended method:
stats = { m.getSpecimenStats() }

stats[1] --# 1
stats[2] --# 2
stats[3] --# 3

Alternative method:
stat1, stat2, stat3 = m.getSpecimenStats()

stats1 --# 1
stats2 --# 2
stats3 --# 3

Edited by Lupus590, 20 July 2016 - 03:26 PM.


#3 gheotic

  • Members
  • 64 posts
  • LocationDenmark

Posted 20 July 2016 - 08:17 PM

Thank you! Exactly what i was looking for :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users