SHOW:
|
|
- or go back to the newest paste.
| 1 | - | -- Versamenti GELATI |
| 1 | + | --Versamenti ISOTOPI |
| 2 | local maxw, maxh = term.getSize() | |
| 3 | ||
| 4 | - | -- vuota il bancomat |
| 4 | + | --vuota il bancomat |
| 5 | ben = peripheral.wrap("back")
| |
| 6 | ben.getAvailableItems() | |
| 7 | - | i, j = os.pullEvent("available_items_return")
|
| 7 | + | i,j = os.pullEvent("available_items_return")
|
| 8 | ||
| 9 | - | conoStracciatella = 0 |
| 9 | + | Pu238 = 0 |
| 10 | - | conoFiordilatte = 0 |
| 10 | + | Y90 = 0 |
| 11 | - | conoCioccolato = 0 |
| 11 | + | Mo99 = 0 |
| 12 | Ir192 = 0 | |
| 13 | - | conoStracciatellaID = ben.getItemIdentifierIDFor(10292, 0) |
| 13 | + | Am241 = 0 |
| 14 | - | conoFiordilatteID = ben.getItemIdentifierIDFor(10293, 0) |
| 14 | + | Cs137 = 0 |
| 15 | - | conoCioccolatoID = ben.getItemIdentifierIDFor(10290, 0) |
| 15 | + | Co60 = 0 |
| 16 | I131 = 0 | |
| 17 | - | for k, v in pairs(j) do |
| 17 | + | Sr90 = 0 |
| 18 | - | if v[1] == conoStracciatellaID then |
| 18 | + | |
| 19 | - | conoStracciatella = v[2] |
| 19 | + | |
| 20 | - | ben.makeRequest(conoStracciatellaID, v[2]) |
| 20 | + | Pu238ID = ben.getItemIdentifierIDFor(17104, 0) |
| 21 | Y90ID = ben.getItemIdentifierIDFor(17096, 0) | |
| 22 | - | elseif v[1] == conoFiordilatteID then |
| 22 | + | Mo99ID = ben.getItemIdentifierIDFor(17097, 0) |
| 23 | - | conoFiordilatte = v[2] |
| 23 | + | Ir192ID = ben.getItemIdentifierIDFor(17098, 0) |
| 24 | - | ben.makeRequest(conoFiordilatteID, v[2]) |
| 24 | + | Am241ID = ben.getItemIdentifierIDFor(17099, 0) |
| 25 | Cs137ID = ben.getItemIdentifierIDFor(17100, 0) | |
| 26 | - | elseif v[1] == conoCioccolatoID then |
| 26 | + | Co60ID = ben.getItemIdentifierIDFor(17101, 0) |
| 27 | - | conoCioccolato = v[2] |
| 27 | + | I131ID = ben.getItemIdentifierIDFor(17102, 0) |
| 28 | - | ben.makeRequest(conoCioccolatoID, v[2]) |
| 28 | + | Sr90ID = ben.getItemIdentifierIDFor(17103, 0) |
| 29 | - | sleep(0.1) |
| 29 | + | |
| 30 | ||
| 31 | for k,v in pairs(j) do | |
| 32 | if v[1] == Pu238ID then | |
| 33 | Pu238 = v[2] | |
| 34 | - | i, j = os.pullEvent("available_items_return")
|
| 34 | + | ben.makeRequest(Pu238ID, v[2]) |
| 35 | ||
| 36 | - | conoStracciatellaID = ben.getItemIdentifierIDFor(10292, 0) |
| 36 | + | elseif v[1] == Y90ID then |
| 37 | - | conoFiordilatteID = ben.getItemIdentifierIDFor(10293, 0) |
| 37 | + | Y90 = v[2] |
| 38 | - | conoCioccolatoID = ben.getItemIdentifierIDFor(10290, 0) |
| 38 | + | ben.makeRequest(Y90ID, v[2]) |
| 39 | ||
| 40 | - | for k, v in pairs(j) do |
| 40 | + | elseif v[1] == Mo99ID then |
| 41 | - | if v[1] == conoStracciatellaID then |
| 41 | + | Mo99 = v[2] |
| 42 | - | conoStracciatella = v[2] |
| 42 | + | ben.makeRequest(Mo99ID, v[2]) |
| 43 | - | ben.makeRequest(conoStracciatellaID, v[2]) |
| 43 | + | |
| 44 | elseif v[1] == Ir192ID then | |
| 45 | - | elseif v[1] == conoFiordilatteID then |
| 45 | + | Ir192 = v[2] |
| 46 | - | conoFiordilatte = v[2] |
| 46 | + | ben.makeRequest(Ir192ID, v[2]) |
| 47 | - | ben.makeRequest(conoFiordilatteID, v[2]) |
| 47 | + | |
| 48 | elseif v[1] == Am241ID then | |
| 49 | - | elseif v[1] == conoCioccolatoID then |
| 49 | + | Am241 = v[2] |
| 50 | - | conoCioccolato = v[2] |
| 50 | + | ben.makeRequest(Am241ID, v[2]) |
| 51 | - | ben.makeRequest(conoCioccolatoID, v[2]) |
| 51 | + | |
| 52 | - | sleep(0.1) |
| 52 | + | elseif v[1] == Cs137ID then |
| 53 | Cs137 = v[2] | |
| 54 | ben.makeRequest(Cs137ID, v[2]) | |
| 55 | ||
| 56 | elseif v[1] == Co60ID then | |
| 57 | Co60 = v[2] | |
| 58 | ben.makeRequest(Co60ID, v[2]) | |
| 59 | ||
| 60 | elseif v[1] == I131ID then | |
| 61 | - | if conoStracciatella ~= 0 or conoFiordilatte ~= 0 or conoCioccolato ~= 0 then |
| 61 | + | I131 = v[2] |
| 62 | - | clear() |
| 62 | + | ben.makeRequest(I131ID, v[2]) |
| 63 | - | print("Bancomat temporaneamente non disponibile")
|
| 63 | + | |
| 64 | - | sleep(60) |
| 64 | + | elseif v[1] == Sr90ID then |
| 65 | Sr90 = v[2] | |
| 66 | ben.makeRequest(Sr90ID, v[2]) | |
| 67 | end | |
| 68 | sleep(0.1) | |
| 69 | end | |
| 70 | ||
| 71 | ben.getAvailableItems() | |
| 72 | i,j = os.pullEvent("available_items_return")
| |
| 73 | ||
| 74 | Pu238ID = ben.getItemIdentifierIDFor(17104, 0) | |
| 75 | Y90ID = ben.getItemIdentifierIDFor(17096, 0) | |
| 76 | Mo99ID = ben.getItemIdentifierIDFor(17097, 0) | |
| 77 | Ir192ID = ben.getItemIdentifierIDFor(17098, 0) | |
| 78 | Am241ID = ben.getItemIdentifierIDFor(17099, 0) | |
| 79 | Cs137ID = ben.getItemIdentifierIDFor(17100, 0) | |
| 80 | Co60ID = ben.getItemIdentifierIDFor(17101, 0) | |
| 81 | I131ID = ben.getItemIdentifierIDFor(17102, 0) | |
| 82 | Sr90ID = ben.getItemIdentifierIDFor(17103, 0) | |
| 83 | ||
| 84 | ||
| 85 | for k,v in pairs(j) do | |
| 86 | if v[1] == Pu238ID then | |
| 87 | Pu238 = v[2] | |
| 88 | ben.makeRequest(Pu238ID, v[2]) | |
| 89 | ||
| 90 | elseif v[1] == Y90ID then | |
| 91 | Y90 = v[2] | |
| 92 | ben.makeRequest(Y90ID, v[2]) | |
| 93 | ||
| 94 | elseif v[1] == Mo99ID then | |
| 95 | Mo99 = v[2] | |
| 96 | ben.makeRequest(Mo99ID, v[2]) | |
| 97 | ||
| 98 | elseif v[1] == Ir192ID then | |
| 99 | Ir192 = v[2] | |
| 100 | ben.makeRequest(Ir192ID, v[2]) | |
| 101 | ||
| 102 | elseif v[1] == Am241ID then | |
| 103 | Am241 = v[2] | |
| 104 | ben.makeRequest(Am241ID, v[2]) | |
| 105 | ||
| 106 | elseif v[1] == Cs137ID then | |
| 107 | Cs137 = v[2] | |
| 108 | ben.makeRequest(Cs137ID, v[2]) | |
| 109 | ||
| 110 | elseif v[1] == Co60ID then | |
| 111 | Co60 = v[2] | |
| 112 | ben.makeRequest(Co60ID, v[2]) | |
| 113 | ||
| 114 | elseif v[1] == I131ID then | |
| 115 | I131 = v[2] | |
| 116 | ben.makeRequest(I131ID, v[2]) | |
| 117 | ||
| 118 | elseif v[1] == Sr90ID then | |
| 119 | Sr90 = v[2] | |
| 120 | ben.makeRequest(Sr90ID, v[2]) | |
| 121 | end | |
| 122 | sleep(0.1) | |
| 123 | end | |
| 124 | ||
| 125 | ||
| 126 | function clear() | |
| 127 | term.clear() | |
| 128 | term.setCursorPos(1,1) | |
| 129 | end | |
| 130 | ||
| 131 | ||
| 132 | if Pu238 ~= 0 or Y90 ~= 0 or Mo99 ~= 0 or Ir192 ~= 0 or Am241 ~= 0 or Cs137 ~= 0 or Co60 ~= 0 or I131 ~= 0 or Sr90 ~= 0 then | |
| 133 | clear() | |
| 134 | print("Bancomat temporaneamente non disponibile")
| |
| 135 | sleep(60) | |
| 136 | os.reboot() | |
| 137 | end | |
| 138 | ||
| 139 | function clear() | |
| 140 | term.clear() | |
| 141 | term.setCursorPos(1, 1) | |
| 142 | end | |
| 143 | ||
| 144 | function clearRed() | |
| 145 | sfondo(colors.red) | |
| 146 | term.clear() | |
| 147 | term.setCursorPos(1, 1) | |
| 148 | end | |
| 149 | ||
| 150 | function colore(sfumatura) term.setTextColour(sfumatura) end | |
| 151 | ||
| 152 | function sfondo(sfumaturaSfondo) term.setBackgroundColour(sfumaturaSfondo) end | |
| 153 | ||
| 154 | - | print("FRIGOR - VENDITA GELATI")
|
| 154 | + | |
| 155 | ||
| 156 | function fineSfondo() term.setBackgroundColour(colours.black) end | |
| 157 | ||
| 158 | ||
| 159 | -- IMPLEMENTAZIONE DEL DRAWFILLEDBOX | |
| 160 | - | print("1. Accetta SOLO coni gelati. NO vaschette!")
|
| 160 | + | |
| 161 | - | print( |
| 161 | + | |
| 162 | - | "2. In caso di utilizzo del deep, SI DEVE ATTENDERE CHE LO STESSO SIA COMPLETAMENTE VUOTO PRIMA DI PREMERE TASTI SUL COMPUTER.") |
| 162 | + | |
| 163 | - | print( |
| 163 | + | |
| 164 | - | " Per versare usando il deep, piazzarlo davanti al cubo rosso ED ATTENDERE CHE SIA VUOTO") |
| 164 | + | |
| 165 | - | print( |
| 165 | + | |
| 166 | - | " In caso contrario il gelato versato verrà distrutto irrimediabilmente!") |
| 166 | + | |
| 167 | tColourLookup[string.byte("0123456789abcdef", n, n)] = 2 ^ (n - 1)
| |
| 168 | - | sfondo(colours.blue) |
| 168 | + | |
| 169 | ||
| 170 | - | term.setCursorPos(1, 1) |
| 170 | + | |
| 171 | - | titolo("Accredita su Nebraska Pay")
|
| 171 | + | |
| 172 | - | sfondo(colours.blue) |
| 172 | + | |
| 173 | - | colore(colors.white) |
| 173 | + | |
| 174 | - | print( |
| 174 | + | |
| 175 | - | "\n\nInserire i propri dati. Premere Enter per confermare i dati inseriti. \nSe i dati sono corretti, il campo diventerà verde. Se sono errati, il programma chiederà di reinserirli nuovamente.") |
| 175 | + | |
| 176 | ||
| 177 | - | -- nomeutente |
| 177 | + | |
| 178 | - | term.setCursorPos(1, 9) |
| 178 | + | |
| 179 | - | term.write("Nome utente:")
|
| 179 | + | |
| 180 | - | term.setCursorPos(15, 9) |
| 180 | + | |
| 181 | - | fineColore() |
| 181 | + | |
| 182 | - | utenteAccettato = false |
| 182 | + | |
| 183 | - | conteggioErrori = 0 |
| 183 | + | |
| 184 | - | while utenteAccettato == false do |
| 184 | + | |
| 185 | - | utente = read() |
| 185 | + | |
| 186 | - | utente = string.gsub(utente, "%s", "") |
| 186 | + | |
| 187 | - | checkuser = http.get( |
| 187 | + | |
| 188 | - | "http://172.16.20.220/luanet/servlets/nebraskapay.php?auth=no&richiesta=verifica&utente=" .. |
| 188 | + | |
| 189 | - | utente).readAll() |
| 189 | + | |
| 190 | - | tabcheckuser = textutils.unserialize(checkuser) |
| 190 | + | |
| 191 | - | if tabcheckuser.stato == "OK" then |
| 191 | + | |
| 192 | - | term.setCursorPos(15, 9) |
| 192 | + | |
| 193 | - | colore(colours.lime) |
| 193 | + | |
| 194 | - | term.write(utente) |
| 194 | + | |
| 195 | maxX = startX | |
| 196 | - | utenteAccettato = true |
| 196 | + | |
| 197 | end | |
| 198 | - | term.setCursorPos(15, 9) |
| 198 | + | |
| 199 | - | colore(colours.red) |
| 199 | + | |
| 200 | - | term.write("Utente errato! ")
|
| 200 | + | |
| 201 | - | sleep(2) |
| 201 | + | |
| 202 | - | term.setCursorPos(15, 9) |
| 202 | + | |
| 203 | function titolo(testo) | |
| 204 | - | term.write(" ")
|
| 204 | + | |
| 205 | - | term.setCursorPos(15, 9) |
| 205 | + | |
| 206 | - | conteggioErrori = conteggioErrori + 1 |
| 206 | + | |
| 207 | - | if conteggioErrori > 2 then |
| 207 | + | |
| 208 | sfondo(colors.blue) | |
| 209 | end | |
| 210 | - | errore("Troppi tentativi di immissione errati ")
|
| 210 | + | |
| 211 | function errore(errore) | |
| 212 | sfondo(colors.red) | |
| 213 | colore(colors.white) | |
| 214 | - | colore(colours.white) |
| 214 | + | |
| 215 | - | term.setCursorPos(1, 11) |
| 215 | + | |
| 216 | - | term.write("Password:")
|
| 216 | + | |
| 217 | - | term.setCursorPos(15, 11) |
| 217 | + | |
| 218 | - | conteggioErrori = 0 |
| 218 | + | |
| 219 | - | passAccettata = false |
| 219 | + | |
| 220 | - | while passAccettata == false do |
| 220 | + | |
| 221 | print("\n\n\nAttendere qualche secondo...")
| |
| 222 | - | password = read("#")
|
| 222 | + | |
| 223 | - | colore(colours.black) |
| 223 | + | |
| 224 | - | checkuser = http.get( |
| 224 | + | |
| 225 | - | "http://172.16.20.220/luanet/servlets/nebraskapay.php?auth=" .. |
| 225 | + | |
| 226 | - | password .. "&richiesta=addebito&valore=0&utente=" .. |
| 226 | + | |
| 227 | - | utente).readAll() |
| 227 | + | print("CLINICA DI NEW RADEON")
|
| 228 | - | risposta = textutils.unserialize(checkuser) |
| 228 | + | |
| 229 | - | if risposta.stato == "OK" then |
| 229 | + | |
| 230 | - | term.setCursorPos(15, 11) |
| 230 | + | |
| 231 | - | colore(colours.lime) |
| 231 | + | |
| 232 | - | term.write("############## ")
|
| 232 | + | |
| 233 | print("NON RIAVVIARE MAI IL COMPUTER DURANTE IL VERSAMENTO")
| |
| 234 | - | passAccettata = true |
| 234 | + | print("In caso contrario gli isotopi versati verranno distrutti irrimediabilmente!")
|
| 235 | event = os.pullEvent() | |
| 236 | - | term.setCursorPos(15, 11) |
| 236 | + | |
| 237 | - | colore(colours.red) |
| 237 | + | sfondo(colours.blue) |
| 238 | - | term.write("Password errata! ")
|
| 238 | + | |
| 239 | - | conteggioErrori = conteggioErrori + 1 |
| 239 | + | |
| 240 | - | sleep(2) |
| 240 | + | titolo("Accredita su Nebraska Pay")
|
| 241 | - | term.setCursorPos(15, 11) |
| 241 | + | sfondo(colours.blue) |
| 242 | - | term.write(" ")
|
| 242 | + | |
| 243 | - | term.setCursorPos(15, 11) |
| 243 | + | |
| 244 | - | if conteggioErrori > 2 then |
| 244 | + | "\n\nInserire i propri dati. Premere Enter per confermare i dati inseriti. \nSe i dati sono corretti, il campo diventerà verde. Se sono errati, il programma chiederà di reinserirli nuovamente.") |
| 245 | ||
| 246 | -- nomeutente | |
| 247 | - | errore("Troppi tentativi di immissione errati")
|
| 247 | + | term.setCursorPos(1, 9) |
| 248 | term.write("Nome utente:")
| |
| 249 | term.setCursorPos(15, 9) | |
| 250 | fineColore() | |
| 251 | utenteAccettato = false | |
| 252 | conteggioErrori = 0 | |
| 253 | while utenteAccettato == false do | |
| 254 | utente = read() | |
| 255 | utente = string.gsub(utente, "%s", "") | |
| 256 | - | print("Il conto ha un saldo di " .. credito .. " IC.")
|
| 256 | + | checkuser = http.get( |
| 257 | - | print("")
|
| 257 | + | "http://172.16.20.220/luanet/servlets/nebraskapay.php?auth=no&richiesta=verifica&utente=" .. |
| 258 | utente).readAll() | |
| 259 | - | "Per favore scegliere un'opzione utilizzando i tasti numerici e confermare con ENTER:") |
| 259 | + | tabcheckuser = textutils.unserialize(checkuser) |
| 260 | - | print("")
|
| 260 | + | if tabcheckuser.stato == "OK" then |
| 261 | - | print("[1] Versare dei gelati")
|
| 261 | + | |
| 262 | - | print("[2] Annullare il versamento")
|
| 262 | + | colore(colours.lime) |
| 263 | term.write(utente) | |
| 264 | - | num = tonumber(read()) |
| 264 | + | fineColore() |
| 265 | - | if num == 1 then |
| 265 | + | utenteAccettato = true |
| 266 | else | |
| 267 | - | clear() |
| 267 | + | |
| 268 | - | redstone.setOutput("left", true)
|
| 268 | + | |
| 269 | - | print( |
| 269 | + | term.write("Utente errato! ")
|
| 270 | - | "Inserire i gelati nello sportello a destra oppure collocare il Deep Storage di fronte al cubo rosso o posizionare") |
| 270 | + | sleep(2) |
| 271 | - | print("")
|
| 271 | + | |
| 272 | - | print("AVVERTENZA IMPORTANTE:")
|
| 272 | + | fineColore() |
| 273 | - | print("Inserire SOLO questi gelati:")
|
| 273 | + | term.write(" ")
|
| 274 | - | print( |
| 274 | + | |
| 275 | - | "Cono stracciatella, cono fiordilatte, gelato cioccolato, gelato stracciatella, gelato fiordilatte") |
| 275 | + | conteggioErrori = conteggioErrori + 1 |
| 276 | - | print("")
|
| 276 | + | if conteggioErrori > 2 then |
| 277 | - | print("NON RIAVVIARE IL COMPUTER O SI PERDERA' IL VERSAMENTO")
|
| 277 | + | term.setCursorPos(15, 9) |
| 278 | - | print("")
|
| 278 | + | colore(colours.red) |
| 279 | - | print("Quando si è pronti per continuare, premere un tasto qualsiasi.")
|
| 279 | + | errore("Troppi tentativi di immissione errati ")
|
| 280 | - | os.pullEvent("key")
|
| 280 | + | |
| 281 | - | clear() |
| 281 | + | |
| 282 | end | |
| 283 | - | redstone.setOutput("left", false)
|
| 283 | + | colore(colours.white) |
| 284 | term.setCursorPos(1, 11) | |
| 285 | - | print("Conteggio gelati in corso...")
|
| 285 | + | term.write("Password:")
|
| 286 | term.setCursorPos(15, 11) | |
| 287 | - | term.setCursorPos(3, 3) |
| 287 | + | conteggioErrori = 0 |
| 288 | - | term.write("*---")
|
| 288 | + | passAccettata = false |
| 289 | - | sleep(0.5) |
| 289 | + | while passAccettata == false do |
| 290 | - | term.setCursorPos(3, 3) |
| 290 | + | |
| 291 | - | term.write("-*--")
|
| 291 | + | password = read("#")
|
| 292 | - | sleep(0.5) |
| 292 | + | colore(colours.black) |
| 293 | - | term.setCursorPos(3, 3) |
| 293 | + | checkuser = http.get( |
| 294 | - | term.write("--*-")
|
| 294 | + | "http://172.16.20.220/luanet/servlets/nebraskapay.php?auth=" .. |
| 295 | - | sleep(0.5) |
| 295 | + | password .. "&richiesta=addebito&valore=0&utente=" .. |
| 296 | - | term.setCursorPos(3, 3) |
| 296 | + | utente).readAll() |
| 297 | - | term.write("---*")
|
| 297 | + | risposta = textutils.unserialize(checkuser) |
| 298 | - | sleep(0.5) |
| 298 | + | if risposta.stato == "OK" then |
| 299 | - | term.setCursorPos(3, 3) |
| 299 | + | |
| 300 | - | term.write("--*-")
|
| 300 | + | colore(colours.lime) |
| 301 | - | sleep(0.5) |
| 301 | + | term.write("############## ")
|
| 302 | - | term.setCursorPos(3, 3) |
| 302 | + | fineColore() |
| 303 | - | term.write("-*--")
|
| 303 | + | passAccettata = true |
| 304 | - | sleep(0.5) |
| 304 | + | |
| 305 | - | term.setCursorPos(3, 3) |
| 305 | + | |
| 306 | - | term.write("*---")
|
| 306 | + | |
| 307 | - | sleep(0.5) |
| 307 | + | term.write("Password errata! ")
|
| 308 | conteggioErrori = conteggioErrori + 1 | |
| 309 | - | ben = peripheral.wrap("back")
|
| 309 | + | sleep(2) |
| 310 | - | ben.getAvailableItems() |
| 310 | + | |
| 311 | - | i, j = os.pullEvent("available_items_return")
|
| 311 | + | term.write(" ")
|
| 312 | term.setCursorPos(15, 11) | |
| 313 | - | clear() |
| 313 | + | if conteggioErrori > 2 then |
| 314 | term.setCursorPos(15, 11) | |
| 315 | - | conoStracciatellaID = ben.getItemIdentifierIDFor(10292, 0) |
| 315 | + | colore(colours.red) |
| 316 | - | conoFiordilatteID = ben.getItemIdentifierIDFor(10293, 0) |
| 316 | + | errore("Troppi tentativi di immissione errati")
|
| 317 | - | conoCioccolatoID = ben.getItemIdentifierIDFor(10290, 0) |
| 317 | + | |
| 318 | end | |
| 319 | - | for k, v in pairs(j) do |
| 319 | + | |
| 320 | - | if v[1] == conoStracciatellaID then |
| 320 | + | |
| 321 | - | conoStracciatella = v[2] |
| 321 | + | |
| 322 | - | ben.makeRequest(conoStracciatellaID, v[2]) |
| 322 | + | |
| 323 | ||
| 324 | - | elseif v[1] == conoFiordilatteID then |
| 324 | + | |
| 325 | - | conoFiordilatte = v[2] |
| 325 | + | print("Il conto ha un saldo di "..credito.." IC.")
|
| 326 | - | ben.makeRequest(conoFiordilatteID, v[2]) |
| 326 | + | |
| 327 | print("Per favore scegliere un'opzione utilizzando i tasti numerici e confermare con ENTER:")
| |
| 328 | - | elseif v[1] == conoCioccolatoID then |
| 328 | + | |
| 329 | - | conoCioccolato = v[2] |
| 329 | + | print("[1] Versare degli isotopi")
|
| 330 | - | ben.makeRequest(conoCioccolatoID, v[2]) |
| 330 | + | print("[2] Annullare il versamento")
|
| 331 | - | sleep(0.1) |
| 331 | + | |
| 332 | num=tonumber(read()) | |
| 333 | if num == 1 then | |
| 334 | ||
| 335 | - | conoStracciatellaIC = conoStracciatella * 0.25 |
| 335 | + | |
| 336 | - | conoFiordilatteIC = conoFiordilatte * 0.23 |
| 336 | + | redstone.setOutput("left", true)
|
| 337 | - | conoCioccolatoIC = conoCioccolato * 0.29 |
| 337 | + | print("Inserire gli isotopi nello sportello in basso")
|
| 338 | print("")
| |
| 339 | - | contanti = conoStracciatellaIC + conoFiordilatteIC + conoCioccolatoIC |
| 339 | + | print("AVVERTENZA IMPORTANTE:")
|
| 340 | print("Inserire SOLO isotopi.")
| |
| 341 | - | print("Totale versato: " .. contanti .. " IC")
|
| 341 | + | |
| 342 | - | print("")
|
| 342 | + | print("NON RIAVVIARE IL COMPUTER O SI PERDERA' IL VERSAMENTO")
|
| 343 | - | inviaDenaro = http.get( |
| 343 | + | |
| 344 | - | "http://172.16.20.220/luanet/servlets/nebraskapay.php?auth=" .. |
| 344 | + | print("Quando si è pronti per continuare, premere un tasto qualsiasi.")
|
| 345 | - | password .. "&utente=" .. utente .. |
| 345 | + | os.pullEvent("key")
|
| 346 | - | "&richiesta=accredito&valore=" .. contanti) |
| 346 | + | |
| 347 | - | .readAll() |
| 347 | + | |
| 348 | - | risultatoInvio = textutils.unserialize(inviaDenaro) |
| 348 | + | |
| 349 | - | if risultatoInvio.stato == "OK" then |
| 349 | + | redstone.setOutput("left", false)
|
| 350 | - | colore(colors.white) |
| 350 | + | |
| 351 | print("Conteggio isotopi in corso...")
| |
| 352 | - | clear() |
| 352 | + | |
| 353 | - | errore("Errore durante il pagamento")
|
| 353 | + | term.setCursorPos(3, 3) |
| 354 | - | sleep(5) |
| 354 | + | term.write("*---")
|
| 355 | - | os.reboot() |
| 355 | + | sleep(0.5) |
| 356 | term.setCursorPos(3, 3) | |
| 357 | - | if tonumber(contanti) ~= 0 then |
| 357 | + | term.write("-*--")
|
| 358 | - | inviaFisco = http.get( |
| 358 | + | sleep(0.5) |
| 359 | - | "http://172.16.20.220/luanet/servlets/fisco.php?msg=" .. |
| 359 | + | term.setCursorPos(3, 3) |
| 360 | - | contanti .. "%20IC%20di%20gelati%20-%20" .. |
| 360 | + | term.write("--*-")
|
| 361 | - | utente) |
| 361 | + | sleep(0.5) |
| 362 | - | inviaDGFE = http.get( |
| 362 | + | term.setCursorPos(3, 3) |
| 363 | - | "http://172.16.20.220/luanet/servlets/dgfe.php?npay_user=" .. |
| 363 | + | term.write("---*")
|
| 364 | - | utente .. |
| 364 | + | sleep(0.5) |
| 365 | - | "&transaction_type=Gelati%20Frigor&transaction_amount=" .. |
| 365 | + | term.setCursorPos(3, 3) |
| 366 | - | contanti) |
| 366 | + | term.write("--*-")
|
| 367 | sleep(0.5) | |
| 368 | - | sleep(1) |
| 368 | + | term.setCursorPos(3, 3) |
| 369 | - | clear() |
| 369 | + | term.write("-*--")
|
| 370 | - | print("Denaro versato.")
|
| 370 | + | sleep(0.5) |
| 371 | - | print("")
|
| 371 | + | term.setCursorPos(3, 3) |
| 372 | - | print("")
|
| 372 | + | term.write("*---")
|
| 373 | - | print("Grazie!")
|
| 373 | + | sleep(0.5) |
| 374 | - | sleep(1) |
| 374 | + | |
| 375 | - | term.setTextColor(colors.black) |
| 375 | + | |
| 376 | - | shell.run("pastebin get 87bE40Er startup2")
|
| 376 | + | |
| 377 | - | if fs.exists("startup2") then
|
| 377 | + | i,j = os.pullEvent("available_items_return")
|
| 378 | - | shell.run("rm startup")
|
| 378 | + | |
| 379 | - | shell.run("mv startup2 startup")
|
| 379 | + | |
| 380 | ||
| 381 | - | os.reboot() |
| 381 | + | Pu238ID = ben.getItemIdentifierIDFor(17104, 0) |
| 382 | - | elseif num == 2 then |
| 382 | + | Y90ID = ben.getItemIdentifierIDFor(17096, 0) |
| 383 | - | clear() |
| 383 | + | Mo99ID = ben.getItemIdentifierIDFor(17097, 0) |
| 384 | - | break |
| 384 | + | Ir192ID = ben.getItemIdentifierIDFor(17098, 0) |
| 385 | Am241ID = ben.getItemIdentifierIDFor(17099, 0) | |
| 386 | Cs137ID = ben.getItemIdentifierIDFor(17100, 0) | |
| 387 | Co60ID = ben.getItemIdentifierIDFor(17101, 0) | |
| 388 | I131ID = ben.getItemIdentifierIDFor(17102, 0) | |
| 389 | Sr90ID = ben.getItemIdentifierIDFor(17103, 0) | |
| 390 | - | shell.run("pastebin get 87bE40Er startup2")
|
| 390 | + | |
| 391 | - | if fs.exists("startup2") then
|
| 391 | + | |
| 392 | - | shell.run("rm startup")
|
| 392 | + | for k,v in pairs(j) do |
| 393 | - | shell.run("mv startup2 startup")
|
| 393 | + | if v[1] == Pu238ID then |
| 394 | Pu238 = v[2] | |
| 395 | - | os.reboot() -- Versamenti GELATI |
| 395 | + | ben.makeRequest(Pu238ID, v[2]) |
| 396 | ||
| 397 | elseif v[1] == Y90ID then | |
| 398 | - | -- vuota il bancomat |
| 398 | + | Y90 = v[2] |
| 399 | ben.makeRequest(Y90ID, v[2]) | |
| 400 | ||
| 401 | - | i, j = os.pullEvent("available_items_return")
|
| 401 | + | elseif v[1] == Mo99ID then |
| 402 | Mo99 = v[2] | |
| 403 | - | conoStracciatella = 0 |
| 403 | + | ben.makeRequest(Mo99ID, v[2]) |
| 404 | - | conoFiordilatte = 0 |
| 404 | + | |
| 405 | - | conoCioccolato = 0 |
| 405 | + | elseif v[1] == Ir192ID then |
| 406 | Ir192 = v[2] | |
| 407 | - | conoStracciatellaID = ben.getItemIdentifierIDFor(10292, 0) |
| 407 | + | ben.makeRequest(Ir192ID, v[2]) |
| 408 | - | conoFiordilatteID = ben.getItemIdentifierIDFor(10293, 0) |
| 408 | + | |
| 409 | - | conoCioccolatoID = ben.getItemIdentifierIDFor(10290, 0) |
| 409 | + | elseif v[1] == Am241ID then |
| 410 | Am241 = v[2] | |
| 411 | - | for k, v in pairs(j) do |
| 411 | + | ben.makeRequest(Am241ID, v[2]) |
| 412 | - | if v[1] == conoStracciatellaID then |
| 412 | + | |
| 413 | - | conoStracciatella = v[2] |
| 413 | + | elseif v[1] == Cs137ID then |
| 414 | - | ben.makeRequest(conoStracciatellaID, v[2]) |
| 414 | + | Cs137 = v[2] |
| 415 | ben.makeRequest(Cs137ID, v[2]) | |
| 416 | - | elseif v[1] == conoFiordilatteID then |
| 416 | + | |
| 417 | - | conoFiordilatte = v[2] |
| 417 | + | elseif v[1] == Co60ID then |
| 418 | - | ben.makeRequest(conoFiordilatteID, v[2]) |
| 418 | + | Co60 = v[2] |
| 419 | ben.makeRequest(Co60ID, v[2]) | |
| 420 | - | elseif v[1] == conoCioccolatoID then |
| 420 | + | |
| 421 | - | conoCioccolato = v[2] |
| 421 | + | elseif v[1] == I131ID then |
| 422 | - | ben.makeRequest(conoCioccolatoID, v[2]) |
| 422 | + | I131 = v[2] |
| 423 | - | sleep(0.1) |
| 423 | + | ben.makeRequest(I131ID, v[2]) |
| 424 | ||
| 425 | elseif v[1] == Sr90ID then | |
| 426 | Sr90 = v[2] | |
| 427 | ben.makeRequest(Sr90ID, v[2]) | |
| 428 | - | i, j = os.pullEvent("available_items_return")
|
| 428 | + | |
| 429 | sleep(0.1) | |
| 430 | - | conoStracciatellaID = ben.getItemIdentifierIDFor(10292, 0) |
| 430 | + | |
| 431 | - | conoFiordilatteID = ben.getItemIdentifierIDFor(10293, 0) |
| 431 | + | |
| 432 | - | conoCioccolatoID = ben.getItemIdentifierIDFor(10290, 0) |
| 432 | + | Pu238IC = Pu238 * 96 |
| 433 | Y90IC = Y90 * 112 | |
| 434 | - | for k, v in pairs(j) do |
| 434 | + | Mo99IC = Mo99 * 80 |
| 435 | - | if v[1] == conoStracciatellaID then |
| 435 | + | Ir192IC = Ir192 * 144 |
| 436 | - | conoStracciatella = v[2] |
| 436 | + | Am241IC = Am241 * 208 |
| 437 | - | ben.makeRequest(conoStracciatellaID, v[2]) |
| 437 | + | Cs137IC = Cs137 * 27 |
| 438 | Co60IC = Co60 * 96 | |
| 439 | - | elseif v[1] == conoFiordilatteID then |
| 439 | + | I131IC = I131 * 120 |
| 440 | - | conoFiordilatte = v[2] |
| 440 | + | Sr90IC = Sr90 * 136 |
| 441 | - | ben.makeRequest(conoFiordilatteID, v[2]) |
| 441 | + | |
| 442 | contanti = Pu238IC + Y90IC + Mo99IC + Ir192IC + Am241IC + Cs137IC + Co60IC + I131IC + Sr90IC | |
| 443 | - | elseif v[1] == conoCioccolatoID then |
| 443 | + | |
| 444 | - | conoCioccolato = v[2] |
| 444 | + | print("Totale versato: "..contanti.." IC")
|
| 445 | - | ben.makeRequest(conoCioccolatoID, v[2]) |
| 445 | + | |
| 446 | - | sleep(0.1) |
| 446 | + | inviaDenaro = http.get( |
| 447 | "http://172.16.20.220/luanet/servlets/nebraskapay.php?auth=" .. | |
| 448 | password .. "&utente=" .. utente .. | |
| 449 | "&richiesta=accredito&causale=Vendita%20isotopi&valore=" .. contanti).readAll() | |
| 450 | risultatoInvio = textutils.unserialize(inviaDenaro) | |
| 451 | if risultatoInvio.stato == "OK" then | |
| 452 | colore(colors.white) | |
| 453 | else | |
| 454 | clear() | |
| 455 | - | if conoStracciatella ~= 0 or conoFiordilatte ~= 0 or conoCioccolato then |
| 455 | + | errore("Errore durante il pagamento")
|
| 456 | - | clear() |
| 456 | + | sleep(5) |
| 457 | - | print("Bancomat temporaneamente non disponibile")
|
| 457 | + | os.reboot() |
| 458 | - | sleep(60) |
| 458 | + | |
| 459 | if tonumber(contanti) ~= 0 then | |
| 460 | inviaFisco = http.get("http://172.16.20.220/luanet/servlets/fisco.php?msg=" .. contanti .. "%20IC%20di%20isotopi%20-%20" .. utente)
| |
| 461 | inviaDGFE = http.get("http://172.16.20.220/luanet/servlets/dgfe.php?npay_user=" .. utente .. "&transaction_type=Isotopi&transaction_amount=" .. contanti)
| |
| 462 | end | |
| 463 | sleep(1) | |
| 464 | clear() | |
| 465 | print("Denaro versato.")
| |
| 466 | print("")
| |
| 467 | print("")
| |
| 468 | print("Grazie!")
| |
| 469 | sleep(1) | |
| 470 | term.setTextColor(colors.black) | |
| 471 | shell.run("pastebin get NS2nSAY8 startup2")
| |
| 472 | if fs.exists("startup2") then
| |
| 473 | shell.run("rm startup")
| |
| 474 | shell.run("mv startup2 startup")
| |
| 475 | end | |
| 476 | os.reboot() | |
| 477 | elseif num == 2 then clear() break end | |
| 478 | end | |
| 479 | clear() | |
| 480 | print("Attendere")
| |
| 481 | term.setTextColor(colors.black) | |
| 482 | shell.run("pastebin get NS2nSAY8 startup2")
| |
| 483 | if fs.exists("startup2") then
| |
| 484 | shell.run("rm startup")
| |
| 485 | shell.run("mv startup2 startup")
| |
| 486 | end | |
| 487 | os.reboot() |