Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m=peripheral.wrap("top")
- c=peripheral.wrap("right")
- sn=0 --Shopnumber, ab welchen shop wird begonnen
- nn=30
- id=100
- mem={"Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei","Frei"}
- function writeMem()
- a=fs.open("mem","r")
- for x = 1,nn,1 do
- mem[x]=a.readLine()
- end
- a.close()
- mem[id]=user
- shell.run("delete mem")
- m.clear()
- for x = 1,nn,1 do
- a=fs.open("mem","a")
- a.write(tostring(mem[x]).."\n")
- a.close()
- end
- for x = 1,10,1 do
- m.setCursorPos(1,x)
- m.write(tostring(x+sn).." "..tostring(mem[x]))
- m.setCursorPos(20,x)
- m.write(tostring(x+sn+10).." "..tostring(mem[x+10]))
- m.setCursorPos(40,x)
- m.write(tostring(x+sn+20).." "..tostring(mem[x+20]))
- end
- end
- writeMem()
- while true do
- event, player, message = os.pullEvent("chat")
- if player=="teilch3n" or player=="ecco7777" or player=="Kegler01" or player=="Big_Grantelbart" or player=="erdberbaer11" or player=="CasimirKalfix" or player=="2Zwo2" player=="the_yannik" then
- if string.sub(message,1,4) == "shop" then
- print(player,": ",message)
- id = tonumber(string.sub(message,5,7))
- if id > sn and id <= sn + nn then
- user = string.sub(message,9)
- writeMem()
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement