Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitor=peripheral.wrap("back")
- sensor=peripheral.wrap("right")
- --shell.run("delete Button")
- --shell.run("pastebin get pBfWqGm2 Button")
- os.loadAPI("Button")
- monitorX,monitorY=monitor.getSize()
- Button.monitorSetSide("back")
- weaponIDs={[23557]=true,[23559]=true,[23561]=true,[23563]=true,[23565]=true,[23567]=true,[23569]=true,[23587]=true,[23589]=true,[23590]=true,[23592]=true,[23594]=true,[23597]=true,[23617]=true,[23619]=true,[23621]=true,[23623]=true,[23625]=true,[23627]=true,
- [23629]=true,[23631]=true,[23647]=true,[23649]=true,[23651]=true,[23652]=true,[23667]=true,[23668]=true,[23670]=true,[23672]=true,[23674]=true,[23801]=true,[23803]=true,[23805]=true,[23807]=true,[23809]=true,[23811]=true,[23813]=true,[23815]=true,[23817]=true,
- [23819]=true,[23821]=true,[23823]=true,[23825]=true,[23827]=true,[23829]=true,[23831]=true,[23833]=true,[23835]=true,[23837]=true,[23839]=true,[23841]=true,[23843]=true,[23845]=true,[23847]=true,[23848]=true,[23850]=true}
- blackList={["Doc_Jason"]=true,["iTzBruin"]=true,["darkbobo00"]=true,}
- weaponNames={"sword","rapier","bow","paxel"}
- function getArmor(playerName)
- allArmor=sensor.getPlayerData(playerName)['armor']
- armorFormat={}
- for armorSlot,information in pairs(allArmor) do
- armorFormat[armorSlot]={['name']=information['rawName']}
- end
- return armorFormat
- end
- function getInventorySlot(playerName,slot)
- allSlots=sensor.getPlayerData(playerName)['inventory']
- currentSlot=allSlots[slot]
- slotInfo={}
- slotInfo[armorSlot]={['name']=currentSlot['name']}
- return slotInfo
- end
- function getWeapons(playerName)
- allSlots=sensor.getPlayerData(playerName)['inventory']
- weapons={}
- for id,data in pairs(allSlots) do
- if weaponIDs[data['id']] then
- weapons[data['name']]=true
- else
- loweredString=string.lower(data['name'])
- for id,name in pairs(weaponNames) do
- if string.find(loweredString,name)~=nil then
- weapons[loweredString]=true
- end
- end
- end
- end
- return weapons
- end
- function mainScreen()
- playerIndex=1
- Button.clearButtons()
- for player,__ in pairs(blackList) do
- Button.addButton(player,5,playerIndex*5-2,0,512,256,playerScreen)
- playerIndex=1+1
- end
- end
- function armorScreen()
- armorDetails=getArmor(selectedPlayer)
- armorIndex=1
- Button.clearButtons()
- Button.addButton(" Back ",5,monitorY-4,0,512,256,mainScreen)
- for slot,name in pairs(armorDetails) do
- monitor.setCursorPos(5,armorIndex*3+1)
- monitor.write(slot.." : "..name['name'])
- armorIndex=armorIndex+1
- end
- sleep(5)
- end
- function inventoryScreen()
- inventoryDetails=getInventorySlot(selectedPlayer)
- inventoryIndex=1
- Button.clearButtons()
- Button.addButton(" Back ",5,monitorY-4,0,512,256,mainScreen)
- for slot,name in pairs(inventoryDetails) do
- monitor.setCursorPos(5,inventoryIndex*3+1)
- monitor.write(slot.." : "..name['name'])
- inventoryIndex=inventoryIndex+1
- end
- sleep(5)
- end
- function weaponsScreen()
- weaponDetails=getWeapons(selectedPlayer)
- weaponIndex=1
- Button.clearButtons()
- Button.addButton(" Back ",5,monitorY-2,0,512,256,mainScreen)
- for weaponName,name in pairs(weaponDetails) do
- monitor.setCursorPos(5,weaponIndex*2+1)
- monitor.write(weaponName)
- print(weaponName)
- weaponIndex=weaponIndex+1
- end
- sleep(5)
- end
- function playerScreen(name)
- selectedPlayer=name
- Button.clearButtons()
- Button.addButton(" Armor ",5,3,0,512,256,armorScreen)
- Button.addButton("Weapons",5,7,0,512,256,weaponsScreen)
- Button.addButton(" Items ",5,11,0,512,256,armorScreen)
- Button.addButton(" Back ",5,monitorY-3,0,512,256,mainScreen)
- end
- mainScreen()
- while true do
- Button.monitorPressed()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement