SHOW:
|
|
- or go back to the newest paste.
| 1 | -- Variables | |
| 2 | ||
| 3 | CMO = 0 -- Counter Metal Input | |
| 4 | CES = 0 -- Counter Empty Smeltery | |
| 5 | ||
| 6 | -- Button Variable for showing button list! | |
| 7 | CML = 0 -- Counter Metal List | |
| 8 | CAL = 0 -- Counter Alloy List | |
| 9 | CLL = 0 -- Counter Liquid List | |
| 10 | CBL = 0 -- Counter Block List | |
| 11 | CMML = 0 -- Counter Menu List | |
| 12 | -- \Button Variable for showing button list! | |
| 13 | ||
| 14 | -- Filling Variables | |
| 15 | CFM = 0 -- Counter Filling Metal | |
| 16 | CFA = 0 -- Counter Filling Alloy | |
| 17 | CFL = 0 -- Counter Filling Liquid | |
| 18 | CFB = 0 -- Counter Filling Block | |
| 19 | ||
| 20 | -- MouseWidth/Height Variables | |
| 21 | mouseWidth = 0 -- mouseWidth Variable | |
| 22 | mouseHeight = 0 -- mouseHeight Variable | |
| 23 | -- \MouseWidth/Height Variables | |
| 24 | ||
| 25 | -- \Variables | |
| 26 | ---------------------------------------------------------------------------------------------- | |
| 27 | -- Computercraft Monitor wrapping | |
| 28 | ||
| 29 | monitor = peripheral.wrap("right") -- insert Monitor position here
| |
| 30 | ||
| 31 | -- \Computercraft Monitor wrapping | |
| 32 | ---------------------------------------------------------------------------------------------- | |
| 33 | -- Monitor Clearing + Background color change and cursor Positioning | |
| 34 | ||
| 35 | monitor.setBackgroundColour((colors.black)) -- Return to standart color BEFORE clearing the screen | |
| 36 | monitor.clear() -- Clear Monitor | |
| 37 | monitor.setCursorPos(1,1) -- Set Cursor to Position 1,1 | |
| 38 | ||
| 39 | -- \Monitor Clearing + Background color change and cursor Positioning | |
| 40 | ---------------------------------------------------------------------------------------------- | |
| 41 | -- Debug text for Display Size | |
| 42 | ||
| 43 | w,h=monitor.getSize() -- set w to Width of the monitor and h to Height in Pixels | |
| 44 | ||
| 45 | print(w) -- Print width of monitor | |
| 46 | print(h) -- print Height of monitor | |
| 47 | ||
| 48 | -- \Debug text for Display Size | |
| 49 | ---------------------------------------------------------------------------------------------- | |
| 50 | -- Create Buttons for Metals, Alloys etc. | |
| 51 | ||
| 52 | function listMenu() -- Create function | |
| 53 | ||
| 54 | monitor.clear() | |
| 55 | monitor.setBackgroundColour((colours.lime)) -- Set monitor Background Color for Button Creation | |
| 56 | ||
| 57 | monitor.setCursorPos(2,2) -- Set Cursor Position to 2,2 | |
| 58 | monitor.write("Metals") -- Write "Metals" at Current Cursor Position
| |
| 59 | ||
| 60 | monitor.setCursorPos(2,4) | |
| 61 | monitor.write("Alloys")
| |
| 62 | ||
| 63 | monitor.setCursorPos(2,6) | |
| 64 | monitor.write("Liquids")
| |
| 65 | ||
| 66 | monitor.setCursorPos(2,8) | |
| 67 | monitor.write("Blocks")
| |
| 68 | ||
| 69 | monitor.setBackgroundColour((colors.black)) -- Reset Monitor Background Color back to black | |
| 70 | ||
| 71 | CML = 0 | |
| 72 | CAL = 0 | |
| 73 | CLL = 0 | |
| 74 | CBL = 0 | |
| 75 | ||
| 76 | end -- End Function | |
| 77 | ||
| 78 | listMenu() | |
| 79 | ||
| 80 | -- \Create Buttons for Metals, Alloys etc. | |
| 81 | ----------------------------------------------------------------------------------------------- | |
| 82 | -- Functions for right clicking on monitor and what it is supposed to do. | |
| 83 | ||
| 84 | function listMetals() -- Metal listing function. | |
| 85 | ||
| 86 | monitor.clear() -- Clear Monitor | |
| 87 | print("CLEARED")
| |
| 88 | ||
| 89 | monitor.setBackgroundColour((colours.lime)) -- Set Monitor Background color to Lime for button creation | |
| 90 | ||
| 91 | monitor.setCursorPos(2,2)------------------- row 1 | |
| 92 | monitor.write("Back")
| |
| 93 | ||
| 94 | monitor.setCursorPos(2,4) | |
| 95 | monitor.write("Cobalt")
| |
| 96 | ||
| 97 | monitor.setCursorPos(2,6) | |
| 98 | monitor.write("Glold")
| |
| 99 | ||
| 100 | monitor.setCursorPos(2,8) | |
| 101 | monitor.write("Coal")
| |
| 102 | ||
| 103 | monitor.setCursorPos(2,10) | |
| 104 | monitor.write("Unstable")
| |
| 105 | ||
| 106 | monitor.setCursorPos(2,12) | |
| 107 | monitor.write("Silver")
| |
| 108 | ||
| 109 | monitor.setCursorPos(2,14) | |
| 110 | monitor.write("Yellorium")
| |
| 111 | ||
| 112 | monitor.setCursorPos(15,2)------------------- row 2 | |
| 113 | monitor.write("Aluminium")
| |
| 114 | ||
| 115 | monitor.setCursorPos(15,4) | |
| 116 | monitor.write("Copper")
| |
| 117 | ||
| 118 | monitor.setCursorPos(15,6) | |
| 119 | monitor.write("Iron")
| |
| 120 | ||
| 121 | monitor.setCursorPos(15,8) | |
| 122 | monitor.write("Emerald")
| |
| 123 | ||
| 124 | monitor.setCursorPos(15,10) | |
| 125 | monitor.write("Nickel")
| |
| 126 | ||
| 127 | monitor.setCursorPos(15,12) | |
| 128 | monitor.write("Steel")
| |
| 129 | ||
| 130 | --monitor.setCursorPos(15,14) | |
| 131 | --monitor.write("")
| |
| 132 | ||
| 133 | monitor.setCursorPos(28,2)------------------ row 3 | |
| 134 | monitor.write("Ardite")
| |
| 135 | ||
| 136 | monitor.setCursorPos(28,4) | |
| 137 | monitor.write("Dark Iron")
| |
| 138 | ||
| 139 | monitor.setCursorPos(28,6) | |
| 140 | monitor.write("Lead")
| |
| 141 | ||
| 142 | monitor.setCursorPos(28,8) | |
| 143 | monitor.write("Mana Metal")
| |
| 144 | ||
| 145 | monitor.setCursorPos(28,10) | |
| 146 | monitor.write("Res Ender")
| |
| 147 | ||
| 148 | monitor.setCursorPos(28,12) | |
| 149 | monitor.write("Tin")
| |
| 150 | ||
| 151 | --monitor.setCursorPos(28,14) | |
| 152 | --monitor.write("")
| |
| 153 | ||
| 154 | monitor.setCursorPos(41,2)------------------ row 4 | |
| 155 | monitor.write("Bedrockium")
| |
| 156 | ||
| 157 | monitor.setCursorPos(41,4) | |
| 158 | monitor.write("Des Redstone")
| |
| 159 | ||
| 160 | monitor.setCursorPos(41,6) | |
| 161 | monitor.write("Redstone")
| |
| 162 | ||
| 163 | monitor.setCursorPos(41,8) | |
| 164 | monitor.write("Mithril")
| |
| 165 | ||
| 166 | monitor.setCursorPos(41,10) | |
| 167 | monitor.write("Shiny")
| |
| 168 | ||
| 169 | monitor.setCursorPos(41,12) | |
| 170 | monitor.write("Uranium")
| |
| 171 | ||
| 172 | --monitor.setCursorPos(41,14) | |
| 173 | --monitor.write("")
| |
| 174 | ||
| 175 | monitor.setBackgroundColour((colours.black)) -- Set Background color back to black | |
| 176 | ||
| 177 | CML = 1 -- Counter Metal List is now 1 | |
| 178 | CFM = 1 -- Counter Filling Metal is now 1 | |
| 179 | ||
| 180 | end -- Ends the function | |
| 181 | ||
| 182 | function listAlloys() -- Alloy listing function. | |
| 183 | ||
| 184 | monitor.clear() -- Clear Monitor | |
| 185 | ||
| 186 | monitor.setBackgroundColour((colours.lime)) -- Set monitor background color to lime for button creation | |
| 187 | ||
| 188 | monitor.setCursorPos(2,4)------------------- row 1 | |
| 189 | monitor.write("Back")
| |
| 190 | ||
| 191 | monitor.setCursorPos(2,6) | |
| 192 | monitor.write("Red Alloy")
| |
| 193 | ||
| 194 | monitor.setCursorPos(2,8) | |
| 195 | monitor.write("Lumium")
| |
| 196 | ||
| 197 | --monitor.setCursorPos(2,10) | |
| 198 | --monitor.write("")
| |
| 199 | ||
| 200 | --monitor.setCursorPos(2,12) | |
| 201 | --monitor.write("")
| |
| 202 | ||
| 203 | --monitor.setCursorPos(2,14) | |
| 204 | --monitor.write("")
| |
| 205 | ||
| 206 | --monitor.setCursorPos(2,16) | |
| 207 | --monitor.write("")
| |
| 208 | ||
| 209 | monitor.setCursorPos(15,4)------------------- row 2 | |
| 210 | monitor.write("Alum Brass")
| |
| 211 | ||
| 212 | monitor.setCursorPos(15,6) | |
| 213 | monitor.write("Electrum")
| |
| 214 | ||
| 215 | monitor.setCursorPos(15,8) | |
| 216 | monitor.write("Manyullyn")
| |
| 217 | ||
| 218 | --monitor.setCursorPos(15,10) | |
| 219 | --monitor.write("")
| |
| 220 | ||
| 221 | --monitor.setCursorPos(15,12) | |
| 222 | --monitor.write("")
| |
| 223 | ||
| 224 | --monitor.setCursorPos(15,14) | |
| 225 | --monitor.write("")
| |
| 226 | ||
| 227 | --monitor.setCursorPos(15,16) | |
| 228 | --monitor.write("")
| |
| 229 | ||
| 230 | monitor.setCursorPos(28,4)------------------ row 3 | |
| 231 | monitor.write("Alumite")
| |
| 232 | ||
| 233 | monitor.setCursorPos(28,6) | |
| 234 | monitor.write("Enderium")
| |
| 235 | ||
| 236 | monitor.setCursorPos(28,8) | |
| 237 | monitor.write("Pig Iron")
| |
| 238 | ||
| 239 | --monitor.setCursorPos(28,10) | |
| 240 | --monitor.write("")
| |
| 241 | ||
| 242 | --monitor.setCursorPos(28,12) | |
| 243 | --monitor.write("")
| |
| 244 | ||
| 245 | --monitor.setCursorPos(28,14) | |
| 246 | --monitor.write("")
| |
| 247 | ||
| 248 | --monitor.setCursorPos(28,16) | |
| 249 | --monitor.write("")
| |
| 250 | ||
| 251 | monitor.setCursorPos(41,4)------------------ row 4 | |
| 252 | monitor.write("Bronze")
| |
| 253 | ||
| 254 | monitor.setCursorPos(41,6) | |
| 255 | monitor.write("Invar")
| |
| 256 | ||
| 257 | monitor.setCursorPos(41,8) | |
| 258 | monitor.write("Signalium")
| |
| 259 | ||
| 260 | --monitor.setCursorPos(41,10) | |
| 261 | --monitor.write("")
| |
| 262 | ||
| 263 | --monitor.setCursorPos(41,12) | |
| 264 | --monitor.write("")
| |
| 265 | ||
| 266 | --monitor.setCursorPos(41,14) | |
| 267 | --monitor.write("")
| |
| 268 | ||
| 269 | --monitor.setCursorPos(41,16) | |
| 270 | --monitor.write("")
| |
| 271 | ||
| 272 | monitor.setBackgroundColour((colours.black)) -- Set Background color back to black | |
| 273 | ||
| 274 | CAL = 1 -- Counter list Alloy is now 1 | |
| 275 | CFA = 1 -- Counter Filling Alloy is now 1 | |
| 276 | ||
| 277 | end -- Ends the function | |
| 278 | ||
| 279 | function listLiquids() -- Liquid listing function. | |
| 280 | ||
| 281 | monitor.clear() -- Clear Monitor | |
| 282 | ||
| 283 | monitor.setBackgroundColour((colours.lime)) -- Set monitor background color to Lime for button creation | |
| 284 | ||
| 285 | monitor.setCursorPos(2,6)------------------- row 1 | |
| 286 | monitor.write("Back")
| |
| 287 | ||
| 288 | monitor.setCursorPos(2,8) | |
| 289 | monitor.write("Glue")
| |
| 290 | ||
| 291 | --monitor.setCursorPos(2,10) | |
| 292 | --monitor.write("")
| |
| 293 | ||
| 294 | --monitor.setCursorPos(2,12) | |
| 295 | --monitor.write("")
| |
| 296 | ||
| 297 | --monitor.setCursorPos(2,14) | |
| 298 | --monitor.write("")
| |
| 299 | ||
| 300 | --monitor.setCursorPos(2,16) | |
| 301 | --monitor.write("")
| |
| 302 | ||
| 303 | --monitor.setCursorPos(2,18) | |
| 304 | --monitor.write("")
| |
| 305 | ||
| 306 | monitor.setCursorPos(15,6)------------------- row 2 | |
| 307 | monitor.write("Pyrotheum")
| |
| 308 | ||
| 309 | monitor.setCursorPos(15,8) | |
| 310 | monitor.write("Lava")
| |
| 311 | ||
| 312 | --monitor.setCursorPos(15,10) | |
| 313 | --monitor.write("")
| |
| 314 | ||
| 315 | --monitor.setCursorPos(15,12) | |
| 316 | --monitor.write("")
| |
| 317 | ||
| 318 | --monitor.setCursorPos(15,14) | |
| 319 | --monitor.write("")
| |
| 320 | ||
| 321 | --monitor.setCursorPos(15,16) | |
| 322 | --monitor.write("")
| |
| 323 | ||
| 324 | --monitor.setCursorPos(15,18) | |
| 325 | --monitor.write("")
| |
| 326 | ||
| 327 | monitor.setCursorPos(28,6)------------------ row 3 | |
| 328 | monitor.write("Blood")
| |
| 329 | ||
| 330 | monitor.setCursorPos(28,8) | |
| 331 | monitor.write("Water")
| |
| 332 | ||
| 333 | --monitor.setCursorPos(28,10) | |
| 334 | --monitor.write("")
| |
| 335 | ||
| 336 | --monitor.setCursorPos(28,12) | |
| 337 | --monitor.write("")
| |
| 338 | ||
| 339 | --monitor.setCursorPos(28,14) | |
| 340 | --monitor.write("")
| |
| 341 | ||
| 342 | --monitor.setCursorPos(28,16) | |
| 343 | --monitor.write("")
| |
| 344 | ||
| 345 | --monitor.setCursorPos(28,18) | |
| 346 | --monitor.write("")
| |
| 347 | ||
| 348 | monitor.setCursorPos(41,6)------------------ row 4 | |
| 349 | monitor.write("Cryotheum")
| |
| 350 | ||
| 351 | --monitor.setCursorPos(41,8) | |
| 352 | --monitor.write("")
| |
| 353 | ||
| 354 | --monitor.setCursorPos(41,10) | |
| 355 | --monitor.write("")
| |
| 356 | ||
| 357 | --monitor.setCursorPos(41,12) | |
| 358 | --monitor.write("")
| |
| 359 | ||
| 360 | --monitor.setCursorPos(41,14) | |
| 361 | --monitor.write("")
| |
| 362 | ||
| 363 | --monitor.setCursorPos(41,16) | |
| 364 | --monitor.write("")
| |
| 365 | ||
| 366 | --monitor.setCursorPos(41,18) | |
| 367 | --monitor.write("")
| |
| 368 | ||
| 369 | monitor.setBackgroundColour((colours.black)) -- Set Background color back to black | |
| 370 | ||
| 371 | CLL = 1 -- Counter list Liquids is now 1 | |
| 372 | CFL = 1 -- Counter Filling Liquids is now 1 | |
| 373 | ||
| 374 | end -- Ends the function | |
| 375 | ||
| 376 | function listBlocks() -- Block listing function. | |
| 377 | ||
| 378 | monitor.clear() -- Clear Monitor | |
| 379 | ||
| 380 | monitor.setBackgroundColour((colours.lime)) -- Set monitor background color to lime for button creation | |
| 381 | ||
| 382 | monitor.setCursorPos(2,8)------------------- row 1 | |
| 383 | monitor.write("Back")
| |
| 384 | ||
| 385 | --monitor.setCursorPos(2,10) | |
| 386 | --monitor.write("")
| |
| 387 | ||
| 388 | --monitor.setCursorPos(2,12) | |
| 389 | --monitor.write("")
| |
| 390 | ||
| 391 | --monitor.setCursorPos(2,14) | |
| 392 | --monitor.write("")
| |
| 393 | ||
| 394 | --monitor.setCursorPos(2,16) | |
| 395 | --monitor.write("")
| |
| 396 | ||
| 397 | --monitor.setCursorPos(2,18) | |
| 398 | --monitor.write("")
| |
| 399 | ||
| 400 | --monitor.setCursorPos(2,20) | |
| 401 | --monitor.write("")
| |
| 402 | ||
| 403 | monitor.setCursorPos(15,8)------------------- row 2 | |
| 404 | monitor.write("Obsidian")
| |
| 405 | ||
| 406 | --monitor.setCursorPos(15,10) | |
| 407 | --monitor.write("")
| |
| 408 | ||
| 409 | --monitor.setCursorPos(15,12) | |
| 410 | --monitor.write("")
| |
| 411 | ||
| 412 | --monitor.setCursorPos(15,14) | |
| 413 | --monitor.write("")
| |
| 414 | ||
| 415 | --monitor.setCursorPos(15,16) | |
| 416 | --monitor.write("")
| |
| 417 | ||
| 418 | --monitor.setCursorPos(15,18) | |
| 419 | --monitor.write("")
| |
| 420 | ||
| 421 | --monitor.setCursorPos(15,20) | |
| 422 | --monitor.write("")
| |
| 423 | ||
| 424 | monitor.setCursorPos(28,8)------------------ row 3 | |
| 425 | monitor.write("Seared Stone")
| |
| 426 | ||
| 427 | --monitor.setCursorPos(28,10) | |
| 428 | --monitor.write("")
| |
| 429 | ||
| 430 | --monitor.setCursorPos(28,12) | |
| 431 | --monitor.write("")
| |
| 432 | ||
| 433 | --monitor.setCursorPos(28,14) | |
| 434 | --monitor.write("")
| |
| 435 | ||
| 436 | --monitor.setCursorPos(28,16) | |
| 437 | --monitor.write("")
| |
| 438 | ||
| 439 | --monitor.setCursorPos(28,18) | |
| 440 | --monitor.write("")
| |
| 441 | ||
| 442 | --monitor.setCursorPos(28,20) | |
| 443 | --monitor.write("")
| |
| 444 | ||
| 445 | monitor.setCursorPos(41,8)------------------ row 4 | |
| 446 | monitor.write("Glass")
| |
| 447 | ||
| 448 | --monitor.setCursorPos(41,10) | |
| 449 | --monitor.write("")
| |
| 450 | ||
| 451 | --monitor.setCursorPos(41,12) | |
| 452 | --monitor.write("")
| |
| 453 | ||
| 454 | --monitor.setCursorPos(41,14) | |
| 455 | --monitor.write("")
| |
| 456 | ||
| 457 | --monitor.setCursorPos(41,16) | |
| 458 | --monitor.write("")
| |
| 459 | ||
| 460 | --monitor.setCursorPos(41,18) | |
| 461 | --monitor.write("")
| |
| 462 | ||
| 463 | --monitor.setCursorPos(41,20) | |
| 464 | --monitor.write("")
| |
| 465 | ||
| 466 | monitor.setBackgroundColour((colours.black)) -- Set Background color back to black | |
| 467 | ||
| 468 | CBL = 1 -- Counter list blocks is now 1 | |
| 469 | CFB = 1 -- Counter Filling blocks is now 1 | |
| 470 | end -- Ends the function | |
| 471 | ||
| 472 | -- If clicked here then Function | |
| 473 | ||
| 474 | function checkClickPosition() -- Everything below is a Function. | |
| 475 | ||
| 476 | ||
| 477 | if mouseWidth > 1 and mouseWidth < 7 and mouseHeight == 2 and CLL == 0 and CBL == 0 and CAL == 0 and CML == 0 then | |
| 478 | ||
| 479 | listMetals() | |
| 480 | sleep(1000) | |
| 481 | end -- End IF sentence | |
| 482 | ||
| 483 | if mouseWidth > 1 and mouseWidth < 7 and mouseHeight == 2 and CLL == 0 and CBL == 0 and CAL == 0 and CML == 1 then | |
| 484 | ||
| 485 | listMenu() | |
| 486 | ||
| 487 | end -- End IF sentence | |
| 488 | ||
| 489 | if mouseWidth > 1 and mouseWidth < 7 and mouseHeight == 4 and CLL == 0 and CBL == 0 and CAL == 0 and CML == 0 then | |
| 490 | ||
| 491 | listAlloys() | |
| 492 | ||
| 493 | end -- End IF sentence | |
| 494 | ||
| 495 | if mouseWidth > 1 and mouseWidth < 7 and mouseHeight == 4 and CLL == 0 and CBL == 0 and CAL == 1 and CML == 0 then | |
| 496 | ||
| 497 | listMenu() | |
| 498 | ||
| 499 | end | |
| 500 | ||
| 501 | if mouseWidth > 1 and mouseWidth < 7 and mouseHeight == 6 and CLL == 0 and CBL == 0 and CAL == 0 and CML == 0 then | |
| 502 | ||
| 503 | listLiquids() | |
| 504 | ||
| 505 | end -- End IF sentence | |
| 506 | ||
| 507 | if mouseWidth > 1 and mouseWidth < 7 and mouseHeight == 6 and CLL == 1 and CBL == 0 and CAL == 0 and CML == 0 then | |
| 508 | ||
| 509 | listMenu() | |
| 510 | ||
| 511 | end | |
| 512 | ||
| 513 | if mouseWidth > 1 and mouseWidth < 7 and mouseHeight == 8 and CLL == 0 and CBL == 0 and CAL == 0 and CML == 0 then | |
| 514 | ||
| 515 | listBlocks() | |
| 516 | ||
| 517 | end -- End IF sentence | |
| 518 | ||
| 519 | if mouseWidth > 1 and mouseWidth < 7 and mouseHeight == 8 and CLL == 0 and CBL == 1 and CAL == 0 and CML == 0 then | |
| 520 | ||
| 521 | listMenu() | |
| 522 | ||
| 523 | end | |
| 524 | ||
| 525 | end -- Ends the function | |
| 526 | ||
| 527 | -- \If clicked here then Function | |
| 528 | ||
| 529 | -- \Functions for right clicking on monitor and what it is supposed to do. | |
| 530 | ----------------------------------------------------------------------------------------------- | |
| 531 | -- Repeat event for checking if someone Right clicked the Monitor | |
| 532 | ||
| 533 | repeat -- Repeat this: | |
| 534 | ||
| 535 | event,p1,p2,p3 = os.pullEvent() -- Get Event data: event,p1,p2,p3 from os.pullEvent() | |
| 536 | ||
| 537 | if event == "monitor_touch" then -- When the event monitor_touch is triggered then | |
| 538 | ||
| 539 | mouseWidth = p2 -- sets the number of p2 into the variable mouseWidth. | |
| 540 | mouseHeight = p3 -- same with mouse Height | |
| 541 | checkClickPosition() -- This will run the Function previously created! | |
| 542 | ||
| 543 | -- Debug stuff! | |
| 544 | ||
| 545 | print(mouseWidth) | |
| 546 | print(mouseHeight) | |
| 547 | print("CLL: ", CLL)
| |
| 548 | print("CAL: ", CAL)
| |
| 549 | print("CML: ", CML)
| |
| 550 | print("CBL: ", CBL)
| |
| 551 | ||
| 552 | --\ Debug stuff! | |
| 553 | ||
| 554 | end -- end the IF statement. | |
| 555 | ||
| 556 | until event=="char" and p1==("x") -- Repeat until event "char" is activated and "x" is pressed.
| |
| 557 | ||
| 558 | -- \Repeat event for checking if someone Right clicked the Monitor |