View difference between Paste ID: eCx9ih0b and ASV943Yk
SHOW: | | - or go back to the newest paste.
1
rednet.open("front")
2
rednet.broadcast("essasi")
3
mon = peripheral.wrap("back")
4
5
shell.run("monitor back outil")
6
7
while close~=1 do 
8
    event, side, xpos, ypos = os.pullEvent("monitor_touch")
9
    
10
    print("xpos:"..xpos.." ypos:"..ypos)
11
    if(((xpos>4) and (xpos<15) ) and ((ypos>1) and (ypos<5))) then
12
        rednet.broadcast("jouer")
13
        shell.run("monitor back go")
14
        close = 1
15
        
16
        
17
    end
18
end
19
mon.setCursorPos(18,1)
20
mon.write("$")
21
while true do 
22
    
23
    event,side,xpos,ypos = os.pullEvent("monitor_touch")
24
    print("xpos:"..xpos)
25
    if(xpos == 18) then
26
    print("envoie")
27
    shell.run("monitor back money")
28
    mon.setCursorPos(1,1)
29
    mon.setBackgroundColor(colors.lime)
30
    mon.write("Attente de credit")
31
32
    mon.setCursorPos(1,2)
33
    mon.setBackgroundColor(colors.red)
34
    mon.write("l'ingot de fer +1")
35
36
    mon.setCursorPos(1,3)
37
    mon.setBackgroundColor(colors.grey)
38
    mon.write("l'ingot d'or +10")
39
40
    mon.setCursorPos(1,4)
41
    mon.setBackgroundColor(colors.yellow)
42
    mon.write("diamant      +80")
43
44
    mon.setCursorPos(1,5)
45
    mon.setBackgroundColor(colors.blue)
46
    mon.write("netherstar +20000")
47
48
        rednet.send(44,"demande")
49
        id,mess = rednet.receive()
50
        
51
        print("vous avez creditez de "..mess)
52
        mon.setCursorPos(2,3)
53
        mon.write("money :"..mess.." credits")
54
    end
55
end