Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mani=peripheral.wrap("manipulator_0")
- local mani2=peripheral.wrap("manipulator_1")
- local joueurs={}
- local pasAccepter={
- ["item"]=true,
- ["Item"]=true,
- ["Sheep"]=true,
- ["Boat"]=true
- }
- local ecran1=peripheral.wrap("monitor_13")
- local ecran2=peripheral.wrap("monitor_14")
- function boucleDepart()
- while true do
- local liste=mani.sense()
- local listeT=#liste
- for i=1,listeT do
- if pasAccepter[liste[i].name] then
- else
- if joueurs[liste[i].name] then
- else
- if liste[i].y<1 and liste[i].y>-4 and liste[i].x<1 and liste[i].x>-3 and liste[i].z<-1 and liste[i].z>-8 then
- joueurs[liste[i].name]=true
- http.request("http://www.adslhoube.fr/boat.php?type=depart&pseudo="..liste[i].name)
- end
- end
- end
- end
- end
- end
- function boucleFin()
- while true do
- local liste=mani2.sense()
- local listeT=#liste
- for i=1,listeT do
- if joueurs[liste[i].name] then
- if liste[i].y<1 and liste[i].y>-4 and liste[i].x<13.5 and liste[i].x>10.5 and liste[i].z<0 and liste[i].z>-7 then
- joueurs[liste[i].name]=false
- http.request("http://www.adslhoube.fr/boat.php?type=arriver&pseudo="..liste[i].name)
- end
- end
- end
- end
- end
- function eventboucle()
- while true do
- local event, url, sourceText = os.pullEvent()
- if event == "http_success" then
- local donne= sourceText.readAll()
- donne=textutils.unserialize(donne)
- ecranGo(ecran1,donne)
- ecranGo(ecran2,donne)
- sourceText.close()
- end
- end
- end
- function ecranGo(ecran,donne)
- ecran.clear()
- ecran.setCursorPos(1,1)
- local y=1
- ecran.write("Record")
- for i=1,#donne.record do
- y=y+1
- ecran.setCursorPos(1,y)
- ecran.write(i.." "..donne.record[i].pseudo.." "..donne.record[i].scoreMin)
- end
- y=y+2
- ecran.setCursorPos(1,y)
- ecran.write("dernier score")
- for i=1,#donne.dernier do
- y=y+1
- ecran.setCursorPos(1,y)
- ecran.write(donne.dernier [i].pseudo.." "..donne.dernier[i].score)
- end
- end
- http.request("http://www.adslhoube.fr/boat.php?type=affichage")
- parallel.waitForAll(boucleDepart, boucleFin,eventboucle)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement