lincruste

Infocom Game Engine Powershell (ChatGPT)

May 29th, 2026
94
0
Never
6
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # =========================================================
  2. # This code is 100% AI generated with ChatGPT free.
  3. # No credits for anything taken, I'm just saving this
  4. # to educate myself later, when I have time for this.
  5. # Mini moteur d'aventure textuelle type Infocom / HHGG
  6. # PowerShell 5+ / 7+
  7. #
  8. # Fonctionnalités :
  9. # - Parsing simple de commandes naturelles
  10. # - Système de pièces
  11. # - Objets manipulables
  12. # - Actions extensibles
  13. # - Inventaire
  14. # - Facile à enrichir
  15. #
  16. # Exemples :
  17. #   regarder
  18. #   examiner lit
  19. #   prendre serviette
  20. #   inventaire
  21. #   ouvrir porte
  22. #   nord
  23. #   aide
  24. #   quitter
  25. # =========================================================
  26.  
  27. Clear-Host
  28.  
  29. # ---------------------------------------------------------
  30. # ETAT GLOBAL DU JEU
  31. # ---------------------------------------------------------
  32.  
  33. $Game = @{
  34.     Running = $true
  35.     CurrentRoom = "bedroom"
  36.     Inventory = @()
  37.     Flags = @{}
  38. }
  39.  
  40. # ---------------------------------------------------------
  41. # DEFINITIONS DES PIECES
  42. # ---------------------------------------------------------
  43.  
  44. $Rooms = @{
  45.  
  46.     bedroom = @{
  47.         Name = "Votre chambre"
  48.         Description = @"
  49. Vous êtes allongé dans votre lit.
  50.  
  51. La pièce ressemble à un champ de bataille administratif.
  52. Des papiers sont empilés partout.
  53.  
  54. Une porte mène vers le nord.
  55. "@
  56.  
  57.         Exits = @{
  58.             nord = "hallway"
  59.         }
  60.  
  61.         Objects = @(
  62.             "lit",
  63.             "serviette",
  64.             "papier",
  65.             "porte"
  66.         )
  67.     }
  68.  
  69.     hallway = @{
  70.         Name = "Le couloir"
  71.         Description = @"
  72. Un couloir étroit et mal éclairé.
  73.  
  74. Il y a une odeur persistante de thé tiède.
  75. "@
  76.  
  77.         Exits = @{
  78.             sud = "bedroom"
  79.         }
  80.  
  81.         Objects = @()
  82.     }
  83. }
  84.  
  85. # ---------------------------------------------------------
  86. # DEFINITIONS DES OBJETS
  87. # ---------------------------------------------------------
  88.  
  89. $Objects = @{
  90.  
  91.     lit = @{
  92.         Name = "lit"
  93.         Description = "Un lit défait. Vous préféreriez y rester."
  94.         Portable = $false
  95.     }
  96.  
  97.     serviette = @{
  98.         Name = "serviette"
  99.         Description = "Une grande serviette étonnamment propre."
  100.         Portable = $true
  101.     }
  102.  
  103.     papier = @{
  104.         Name = "papier"
  105.         Description = "Des formulaires probablement catastrophiques."
  106.         Portable = $true
  107.     }
  108.  
  109.     porte = @{
  110.         Name = "porte"
  111.         Description = "Une porte parfaitement ordinaire."
  112.         Portable = $false
  113.     }
  114. }
  115.  
  116. # ---------------------------------------------------------
  117. # AFFICHAGE DE LA PIECE
  118. # ---------------------------------------------------------
  119.  
  120. function Show-Room {
  121.  
  122.     $room = $Rooms[$Game.CurrentRoom]
  123.  
  124.     Write-Host ""
  125.     Write-Host "=== $($room.Name) ===" -ForegroundColor Cyan
  126.     Write-Host ""
  127.     Write-Host $room.Description
  128.  
  129.     $visibleObjects = $room.Objects
  130.  
  131.     if ($visibleObjects.Count -gt 0) {
  132.  
  133.         Write-Host ""
  134.         Write-Host "Vous voyez : " -NoNewline
  135.  
  136.         $names = $visibleObjects | ForEach-Object {
  137.             $Objects[$_].Name
  138.         }
  139.  
  140.         Write-Host ($names -join ", ")
  141.     }
  142.  
  143.     Write-Host ""
  144. }
  145.  
  146. # ---------------------------------------------------------
  147. # INVENTAIRE
  148. # ---------------------------------------------------------
  149.  
  150. function Show-Inventory {
  151.  
  152.     Write-Host ""
  153.  
  154.     if ($Game.Inventory.Count -eq 0) {
  155.         Write-Host "Vous ne portez rien."
  156.         return
  157.     }
  158.  
  159.     Write-Host "Vous avez :"
  160.  
  161.     foreach ($item in $Game.Inventory) {
  162.         Write-Host "- $($Objects[$item].Name)"
  163.     }
  164.  
  165.     Write-Host ""
  166. }
  167.  
  168. # ---------------------------------------------------------
  169. # TROUVER UN OBJET DANS LA PIECE OU INVENTAIRE
  170. # ---------------------------------------------------------
  171.  
  172. function Find-Object($name) {
  173.  
  174.     $room = $Rooms[$Game.CurrentRoom]
  175.  
  176.     foreach ($obj in $room.Objects) {
  177.         if ($obj -eq $name) {
  178.             return $obj
  179.         }
  180.     }
  181.  
  182.     foreach ($obj in $Game.Inventory) {
  183.         if ($obj -eq $name) {
  184.             return $obj
  185.         }
  186.     }
  187.  
  188.     return $null
  189. }
  190.  
  191. # ---------------------------------------------------------
  192. # EXAMINER
  193. # ---------------------------------------------------------
  194.  
  195. function Examine-Object($target) {
  196.  
  197.     if (-not $target) {
  198.         Write-Host "Examiner quoi ?"
  199.         return
  200.     }
  201.  
  202.     $obj = Find-Object $target
  203.  
  204.     if (-not $obj) {
  205.         Write-Host "Vous ne voyez pas ça ici."
  206.         return
  207.     }
  208.  
  209.     Write-Host ""
  210.     Write-Host $Objects[$obj].Description
  211.     Write-Host ""
  212. }
  213.  
  214. # ---------------------------------------------------------
  215. # PRENDRE
  216. # ---------------------------------------------------------
  217.  
  218. function Take-Object($target) {
  219.  
  220.     if (-not $target) {
  221.         Write-Host "Prendre quoi ?"
  222.         return
  223.     }
  224.  
  225.     $room = $Rooms[$Game.CurrentRoom]
  226.  
  227.     if ($Game.Inventory -contains $target) {
  228.         Write-Host "Vous l'avez déjà."
  229.         return
  230.     }
  231.  
  232.     if (-not ($room.Objects -contains $target)) {
  233.         Write-Host "Impossible."
  234.         return
  235.     }
  236.  
  237.     $obj = $Objects[$target]
  238.  
  239.     if (-not $obj.Portable) {
  240.         Write-Host "Vous ne pouvez pas prendre ça."
  241.         return
  242.     }
  243.  
  244.     $Game.Inventory += $target
  245.  
  246.     $room.Objects = $room.Objects | Where-Object {
  247.         $_ -ne $target
  248.     }
  249.  
  250.     Write-Host "Pris."
  251. }
  252.  
  253. # ---------------------------------------------------------
  254. # DEPLACEMENT
  255. # ---------------------------------------------------------
  256.  
  257. function Move-Player($direction) {
  258.  
  259.     $room = $Rooms[$Game.CurrentRoom]
  260.  
  261.     if (-not $room.Exits.ContainsKey($direction)) {
  262.         Write-Host "Vous ne pouvez pas aller par là."
  263.         return
  264.     }
  265.  
  266.     $Game.CurrentRoom = $room.Exits[$direction]
  267.  
  268.     Show-Room
  269. }
  270.  
  271. # ---------------------------------------------------------
  272. # ACTIONS SPECIALES
  273. # ---------------------------------------------------------
  274.  
  275. function Handle-SpecialAction($verb, $target) {
  276.  
  277.     switch ("$verb $target") {
  278.  
  279.         "ouvrir porte" {
  280.  
  281.             Write-Host ""
  282.             Write-Host "Vous ouvrez la porte avec une certaine appréhension existentielle."
  283.             Write-Host ""
  284.  
  285.             return $true
  286.         }
  287.  
  288.         default {
  289.             return $false
  290.         }
  291.     }
  292. }
  293.  
  294. # ---------------------------------------------------------
  295. # PARSER SIMPLE
  296. # ---------------------------------------------------------
  297.  
  298. function Parse-Command($inputText) {
  299.  
  300.     $inputText = $inputText.ToLower().Trim()
  301.  
  302.     if ([string]::IsNullOrWhiteSpace($inputText)) {
  303.         return
  304.     }
  305.  
  306.     # Alias directions
  307.     switch ($inputText) {
  308.         "n" { $inputText = "nord" }
  309.         "s" { $inputText = "sud" }
  310.         "e" { $inputText = "est" }
  311.         "o" { $inputText = "ouest" }
  312.     }
  313.  
  314.     $parts = $inputText -split "\s+"
  315.  
  316.     $verb = $parts[0]
  317.  
  318.     $target = $null
  319.  
  320.     if ($parts.Count -gt 1) {
  321.         $target = $parts[1]
  322.     }
  323.  
  324.     # Déplacements directs
  325.     if ($verb -in @("nord","sud","est","ouest")) {
  326.         Move-Player $verb
  327.         return
  328.     }
  329.  
  330.     switch ($verb) {
  331.  
  332.         "regarder" {
  333.             Show-Room
  334.         }
  335.  
  336.         "examiner" {
  337.             Examine-Object $target
  338.         }
  339.  
  340.         "prendre" {
  341.             Take-Object $target
  342.         }
  343.  
  344.         "inventaire" {
  345.             Show-Inventory
  346.         }
  347.  
  348.         "i" {
  349.             Show-Inventory
  350.         }
  351.  
  352.         "aide" {
  353.  
  354.             Write-Host ""
  355.             Write-Host "Commandes disponibles :"
  356.             Write-Host ""
  357.             Write-Host "  regarder"
  358.             Write-Host "  examiner <objet>"
  359.             Write-Host "  prendre <objet>"
  360.             Write-Host "  inventaire"
  361.             Write-Host "  nord/sud/est/ouest"
  362.             Write-Host "  quitter"
  363.             Write-Host ""
  364.         }
  365.  
  366.         "quitter" {
  367.             $Game.Running = $false
  368.         }
  369.  
  370.         default {
  371.  
  372.             $handled = Handle-SpecialAction $verb $target
  373.  
  374.             if (-not $handled) {
  375.                 Write-Host "Je ne comprends pas."
  376.             }
  377.         }
  378.     }
  379. }
  380.  
  381. # ---------------------------------------------------------
  382. # INTRO
  383. # ---------------------------------------------------------
  384.  
  385. Write-Host ""
  386. Write-Host "GUIDE GALACTIQUE DU SURVIVANT ADMINISTRATIF" -ForegroundColor Yellow
  387. Write-Host ""
  388. Write-Host "Tapez 'aide' pour les commandes."
  389. Write-Host ""
  390.  
  391. Show-Room
  392.  
  393. # ---------------------------------------------------------
  394. # BOUCLE PRINCIPALE
  395. # ---------------------------------------------------------
  396.  
  397. while ($Game.Running) {
  398.  
  399.     $command = Read-Host ">"
  400.  
  401.     Parse-Command $command
  402. }
  403.  
  404. Write-Host ""
  405. Write-Host "Fin du jeu."
  406. Write-Host ""
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Nonadyy
    34 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
  • Saxbexid
    8 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=pvrivmezzg
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment