View difference between Paste ID: sxGjAb7D and ycj3PqUG
SHOW: | | - or go back to the newest paste.
1
--objMolTable{"Phosphate_ion","Ammonium_ion"}
2
--objElTable{"Hydrogen","Helium","Lithium"}
3
pim = peripheral.wrap("left")
4
mon = peripheral.wrap("top")
5
Player = ""
6
7
8
function setupScoreboard()
9
	commands.exec("scoreboard objectives add testname dummy testname")
10
	commands.exec("scoreboard players add @a")
11
	commands.exec("scoreboard objectives setdisplay sidbar testname")
12
end
13
14
function addAllUsers()
15
	--add @a to scoreboard
16
end
17
18
function addScore(item)
19
	--Sets the objective to 1
20
	commands.exec("scoreboard players set "..player.." "..item.." 1")
21
end
22
23
function checkInv()
24
	data = {}
25
	local slot
26
	local name
27
	local slots = pim.getAllStacks()
28
	for i,j in pairs(slots) do
29
		slot = i 
30
		name = j["display_name"]
31
		addScore(name)
32
		data[slot]=name
33
	end
34
	--commands.exec("testfor @a[name="..Player..",score_"..item.."=1,score_"..item.."_min=1]")
35
	--based on game mode check for object_name, formula, molarmass,boilingpt meltingpt molarmas,shortname,neutrons,form
36
end
37
38
function checkUser()
39
	local user = pim.getInventoryName()
40
	if user =='pim' then
41
		Player = ""
42
	else
43
		Player = user
44
	end
45
	return Player
46
end
47
48
function getWin()
49
	--get where all = 1 or get a new objective for total
50
	--commands.exec(
51
	--save to file
52
end
53
54
function printTop()
55
 --pull from file to print to screen
56
end
57
58
function init()
59
	--which game to play
60
	--1 element
61
	--2 molecures
62
63
	--if 1 then
64
	--which game to play
65
		--other nonmetals
66
		--alkali metals
67
		--alkaline earth metals
68
		--noble gasses
69
		--metalloids
70
		--halogends
71
		--transition metals
72
		--post-transition metals
73
		--lanthanoids
74
		--actinoids
75
76
	--chose level
77
	--begginer(element Names/symboles)
78
	--intermediate(atomic Numbers/state)
79
	--advanced(neutrons)
80
--	end
81
	--if 2 then
82
	--chose level
83
	--beginner(name)
84
	--intermediate(formula)
85
	--advanced(molarmass/boilingpt/meltingpt)
86
	--call setupScoreboard()
87
--end
88
end
89
90-
elements{
90+
elements
91-
    	["Hydrogen"]={
91+
{
92
    ["Hydrogen"]={
93
        ["shortName"]= "H",
94
        ["form"]= "gas",
95
        ["type"]= "nonMetal",
96
        ["neutrons"]= "0"
97
    },
98
    ["Helium"]={
99
        ["shortName"]= "He",
100
        ["form"]= "gas",
101
        ["type"]= "nobleGas",
102
        ["neutrons"]= "2"
103
    },
104
    ["Lithium"]={
105
        ["shortName"]= "Li",
106
        ["form"]= "solid",
107
        ["type"]= "alkaliMetal",
108
        ["neutrons"]= "4"
109
    },
110
    ["Beryllium"]={
111
        ["shortName"]= "Be",
112
        ["form"]= "solid",
113
        ["type"]= "alkalineEarth",
114
        ["neutrons"]= "5"
115-
    ["Boron"]={
115+
116-
        ["shortName"]= "B",
116+
117
118-
        ["type"]= "semiMetal",
118+
119-
        ["neutrons"]= "6"
119+
120
	event = os.pullEvent()
121-
    ["Carbon"]= {
121+
122
		Player = checkUser()
123-
        ["shortName"]= "C",
123+
124
		
125
		else
126-
        ["neutrons"]= "6"
126+
127
			checkInv()
128-
    ["Nitrogen"]={
128+
129-
        ["shortName"]= "N",
129+
130
	sleep(0.5)
131
end