epinna / tplmap

Server-Side Template Injection and Code Injection Detection and Exploitation Tool
GNU General Public License v3.0
3.69k stars 666 forks source link

Getting error: Name 'GuiderQuest' is not defined even though it is global and i think it is all right? Help please. #115

Closed EthanNinja11426 closed 1 year ago

EthanNinja11426 commented 1 year ago

Code:

Massive but the error is at line 76.

import random def game(): global GuidersQuest, username, gift, health_points, luck, sure, username, travel, inventory, stats stats = [health_points == 3, luck == 2] print('''Guide: Hello traveller, welcome back from your DEEP slumber. Welcome to my home, The starting hut! Once ago, the lands of hillthain was a beautiful lively place filled with the most gracious hills. Until the screechers came. They had long but thin bodys, no eyes, only extremely sensitive hearing, they had devil like claws, forming out of there hands. You cannot make bearlly any noise on your travels dear friend. They created an inhumane device that when they sacrifice enough of the souls of the villagers, it would shoot a beam into the sun and steal all of the light source! This very light source helped them grow stronger, bigger, and more inteligent. Darkness fell over hillthain, everyone panicked as they went around conquering city by city, town by town, country by country. Until you came traveller. You were the chosen one. The prophecys told that you would come. You are our last hope, the screechers have destroyed everything, sending hillthain into an apocolypse. Take this sword traveller. And... Kill Them ALL.''') def inventory(): global GuidersQuest, username, gift, health_points, luck, sure, username, travel, inventory, stats inventory = ["Inventory:"]

inventory()

def options(): global GuidersQuest, username, gift, health_points, luck, sure, username, travel, inventory, stats GuidersQuest = input('''Guide: Please traveller help us do this mission. For us all.

Options: A: But why can't you do it yourself? B: What do you mean, 'Chosen ones' and what 'Prophecy' are you on about? (Get to choose name) C: Sure, I will get right on it. D: (Player escapes guide due to cowardness and dies to the screechers) E: (Player grabs sword and murders the guide due to fear and makes to much noise, leading the screechers to your location) F: ... (Exits game) ''') options() def result_of_options(): global GuidersQuest, username, gift, health_points, luck, sure, username, travel, inventory, stats if GuidersQuest == "a" or GuidersQuest == "A": print("Guide: Traveller, im to old and injured for this mission, but you my friend, are the chosen one meant for this mission.")

elif GuidersQuest == "b" or GuidersQuest == "B":
    print("Guide: The holy bible mentions your name traveller, you will help us all.")
    username = input('''Traveller: But what is my name?

                         Username here: ''')
    print("Guide: Traveller, your name is",username)

elif GuidersQuest == "c" or GuidersQuest == "C":
    print("Guide: Thank you traveller, and here take this sword, amelet to help you and a luck potion to increase your luck.")
    inventory.apend("Wooden Sword")
    inventory.apend("Guider Amelet")
    inventory.apend("Potion Of Luck")
    print(inventory)

elif GuidersQuest == "d" or GuidersQuest == "D":
    print('''Guide: Wait Traveller, Come back!
              Traveller: (Runs away and accidently runs into a screecher horde)''')

elif GuidersQuest == "e" or GuidersQuest == "E":
    print('''Guide: Thank you for accepting the swo...
            TRAVELLER, WHAT ARE YOU DOING!? PLEASE STO...
            Traveller: (Stares at bloody hands in a trance but snaps out when he hears a screecher scream nearby)
            Wooden Sword added to inventory.  ''')
    inventory.append("WoodenSword")

elif GuidersQuest == "f" or GuidersQuest == "F":
    print("Guide: Traveller?")

result_of_options()

def start(): global GuidersQuest, username, gift, health_points, luck, sure, username, travel, inventory, stats if GuidersQuest == "a" or GuidersQuest == "A": guider_help = input("Guide: But I can still help if you want chosen one? [Y] or [N]") if guider_help == "Y" or guider_help == "y" or guider_help == "yes": print("Guide: I will do as you command great traveller.")

    elif guider_help == "N" or guider_help == "n" or guider_help == "no":
         gift = input("Ok Traveller I will do as you wish, but if you ever get stuck on your travels, take this amelet to listen to my advice anytime, do you accept? [Y] or [N]  ")
         if gift == "Y" or gift == "y" or gift == "yes":
             print("Game: Guider Amelet added to inventory.")

         elif gift == "N" or gift == "n" or gift == "no":
             sure = input("Are you sure? You are probably gonna need it... [Y] or [N]  ")
             if sure == "Y" or sure == "y" or sure == "yes":
                 print("Guide: Have it your way then, great travels traveller!")

             elif sure == "N" or sure == "n" or sure == "no":
                 print('''Thank you for reconsidering.
                      Game: Guider Amelet added to inventory.''')
                 inventory.apend("Guider Amelet")

elif GuidersQuest == "b" or GuidersQuest == "B":
    travel = input("Ok", username,", where shall we go now?")

elif GuidersQuest == "c" or GuidersQuest == "C":
    print("not finished")

elif GuidersQuest == "d" or GuidersQuest == "D":
    quit()

elif GuidersQuest == "e" or GuidersQuest == "E":
    choice_in_battle = input("I have not long left, I need to: run, fight, kill self, stats  ")
    if choice_in_battle == "run" or choice_in_battle == "RUN":
        print('''You hear the screechers breaking down the hut door so you proceed to run even though your lungs refuse.
              You are looking behind you seeing if they followed you but then you run head first into a solid brick wall.''')

        fight = input('''You wake up to see 1 small screecher wandering around investigating the sudden sound.
                      Do you: run, fight, kill self   ''')

        if fight == "run" or fight == "RUN":
            print("You attempt in running again but your head is in agonizning pain so you scream in help, alerting the screecher nearby.")
            quit()

        elif fight == "fight" or "FIGHT":
            show_inventory = input("You decide what to use as your killing weapon. (Type Show Inventory)")
            if show_inventory == "ShowInventory" or show_inventory == "showinventory" or show_inventory == "Show Inventory" or show_inventory == "show inventory":
                print(inventory)
            weapon = input("Choose your weapon:  ")
            if weapon == "Wooden Sword" or weapon == "wooden sword" or weapon == "WoodenSword" or weapon == "woodensword":
                print("You take out your wooden sword in your inventory.")
                striking_position = input('''Where do you wanna strike at the screecher?
                                          Head
                                          Legs
                                          Arms  ''')
                if striking_position == "head" or striking_position == "Head":
                    chance_at_hit = random.randint(1,4)
                    if chance_at_hit < luck:
                        print("You run up to the screecher, wacking your sword around its head, it breaks.")
                        print("The screecher attacks you, mercilessy ripping your head from your neck.")
                        quit()

                    elif chance_at_hit == luck:
                        print('''You run up to the screecher, jumping on its back, stabbing your wooden sword in its head, it pierces it skin but not its skull.
                              It shakes you off its back, but then you jump and kick the sword, seeing the end at the other side of the head.
                              The screecher falls down but you quickly catch it, trying not to alert any others. +1 luck''')
                        luck + 1

                    elif chance_at_hit > luck:
                        print("You charge at the screecher, while holding your own head, you effortlessly pierce its skull. +2 luck")
                        luck + 2

                elif striking_position == "Legs" or striking_position == "legs":
                    chance_at_hit = random.randint(1,4)
                    if chance_at_hit < luck:
                        print('''You grab your wooden sword and charge at the screecher, sliding to its legs and marking the left one,
                                 However, the screecher plunges its claws into your chest, and then lifts you up, proceeding to eat of your head.''')
                        quit()

                    elif chance_at_hit == luck:
                        print('''You grab your wooden sword and charge at the screecher, you slash of half of its left leg, disabling its attacks for a while but then it slashes you around the chest with its claws. -2 HP
                                 Then you finish of the screecher by plunging your sword deep in its head. +1 luck''')

                        health_points -2
                        luck +1

                    elif chance_at_hit > luck:
                        print('''You grab your wooden sword and charge at the screecher, you slash of both of its legs, disabling and fataly injuring the screecher, then it trys to slash you with its claws,
                              but luckily you dodge and cut of its arm, finishing the screecher off. +3 luck''')
                        luck +3

                elif striking_position == "Arms" or striking_position == "arms":
                    chance_at_hit = random.randint(1,4)
                    if chance_at_hit < luck:
                        print('''You grab your wooden sword and charge at the screecher, dodging its first attack and getting a good hit on its right arm,
                                 but then it slashes down, chopping of both of your arms, then it picks you up with its mouth, and slowly crushes you.''')
                        quit()

                    elif chance_at_hit == luck:
                        print('''You grab your wooden sword and charge at the screecher, sliding under its first attack, chopping of its left hand in the process,
                                 but then the screecher kicks you away (-1 HP)but then you proceed to chuck your sword and it lands deep in the screechers chest, stunning it,
                                 you then grab the sword out of its wounded chest and stomp on its right arm to stop it attacking you and then you plunge your sword in its mouth, killing it. +1 luck''')

                        health_points -1
                        luck +1

                        looting = input("Do you want to loot the screecher or continue? [L] or [C]?  ")
                        if looting == "L" or looting == "l" or looting == "loot" or looting == "Loot":
                            print("You scavenge through the corpse of the remaining creature and found nothing.")
                            crafting = input("Do you want to inspect the screecher or continue? [I] or [C]?  ")
                            if crafting == "I" or crafting == "i" or crafting == "inspect" or crafting == "Inspect":
                                print("You inspect the screecher and realise you can create claws out of the screechers claws. Claws added to inventory")
                                inventory.apend("Screecher Claws")

                            elif crafting == "C" or crafting == "c" or crafting == "continue" or crafting == "Continue":
                                print("You walk along, trying to fight the pain in your chest and the gory image of you defeating one of those beasts.")

                        elif looting == "C" or looting == "c" or looting == "continue" or looting == "Continue":
                            print("You walk along, trying to fight the pain in your chest and the gory image of you defeating one of those beasts.")

                    elif chance_at_hit > luck:
                        print('''You grab your wooden sword and charge at the screecher, it trys to slash you with both hands but it fails,
                                 and you chop of both of its arms, leaving it defenseless, then you plunge your sword deep in its heart. +2 luck''')

                        luck +2

    elif choice_in_battle == "fight" or choice_in_battle == "Fight" or choice_in_battle == "FIGHT":
        print("You run over to the screecher breaking down the door, and then the door falls down and you see a creature emerge out of the darkness.")
        show_inventory = input("You decide what to use as your killing weapon. (Type Show Inventory)")
        if show_inventory == "ShowInventory" or show_inventory == "showinventory" or show_inventory == "Show Inventory" or show_inventory == "show inventory":
                print(inventory)
        weapon = input("Choose your weapon:  ")
        if weapon == "Wooden Sword" or weapon == "wooden sword" or weapon == "WoodenSword" or weapon == "woodensword":
                print("You take out your wooden sword in your inventory.")
                striking_position = input('''Where do you wanna strike at the screecher?
                                          Head
                                          Legs
                                          Arms  ''')
                if striking_position == "head" or striking_position == "Head":
                    chance_at_hit = random.randint(1,4)
                    if chance_at_hit < luck:
                        print("You run up to the screecher, wacking your sword around its head, it breaks.")
                        print("The screecher attacks you, mercilessy ripping your head from your neck.")
                        quit()

                    elif chance_at_hit == luck:
                        print('''You run up to the screecher, jumping on its back, stabbing your wooden sword in its head, it pierces it skin but not its skull.
                              It shakes you off its back, but then you jump and kick the sword, seeing the end at the other side of the head.
                              The screecher falls down but you quickly catch it, trying not to alert any others. +1 luck''')
                        luck + 1

                    elif chance_at_hit > luck:
                        print("You charge at the screecher, while holding your own head, you effortlessly pierce its skull. +2 luck")
                        luck + 2

                elif striking_position == "Legs" or striking_position == "legs":
                    chance_at_hit = random.randint(1,4)
                    if chance_at_hit < luck:
                        print('''You grab your wooden sword and charge at the screecher, sliding to its legs and marking the left one,
                                 However, the screecher plunges its claws into your chest, and then lifts you up, proceeding to eat of your head.''')
                        quit()

                    elif chance_at_hit == luck:
                        print('''You grab your wooden sword and charge at the screecher, you slash of half of its left leg, disabling its attacks for a while but then it slashes you around the chest with its claws. -2 HP
                                 Then you finish of the screecher by plunging your sword deep in its head. +1 luck''')

                        health_points -2
                        luck +1

                    elif chance_at_hit > luck:
                        print('''You grab your wooden sword and charge at the screecher, you slash of both of its legs, disabling and fataly injuring the screecher, then it trys to slash you with its claws,
                              but luckily you dodge and cut of its arm, finishing the screecher off. +3 luck''')
                        luck +3

                elif striking_position == "Arms" or striking_position == "arms":
                    chance_at_hit = random.randint(1,4)
                    if chance_at_hit < luck:
                        print('''You grab your wooden sword and charge at the screecher, dodging its first attack and getting a good hit on its right arm,
                                 but then it slashes down, chopping of both of your arms, then it picks you up with its mouth, and slowly crushes you.''')
                        quit()

                    elif chance_at_hit == luck:
                        print('''You grab your wooden sword and charge at the screecher, sliding under its first attack, chopping of its left hand in the process,
                                 but then the screecher kicks you away (-1 HP)but then you proceed to chuck your sword and it lands deep in the screechers chest, stunning it,
                                 you then grab the sword out of its wounded chest and stomp on its right arm to stop it attacking you and then you plunge your sword in its mouth, killing it. +1 luck''')

                        health_points -1
                        luck +1

                        looting = input("Do you want to loot the screecher or continue? [L] or [C]?  ")
                        if looting == "L" or looting == "l" or looting == "loot" or looting == "Loot":
                            print("You scavenge through the corpse of the remaining creature and found nothing.")
                            crafting = input("Do you want to inspect the screecher or continue? [I] or [C]?  ")
                            if crafting == "I" or crafting == "i" or crafting == "inspect" or crafting == "Inspect":
                                print("You inspect the screecher and realise you can create claws out of the screechers claws. Claws added to inventory")
                                inventory.apend("Screecher Claws")

                            elif crafting == "C" or crafting == "c" or crafting == "continue" or crafting == "Continue":
                                print("You walk along, trying to fight the pain in your chest and the gory image of you defeating one of those beasts.")

                        elif looting == "C" or looting == "c" or looting == "continue" or looting == "Continue":
                            print("You walk along, trying to fight the pain in your chest and the gory image of you defeating one of those beasts.")

                    elif chance_at_hit > luck:
                        print('''You grab your wooden sword and charge at the screecher, it trys to slash you with both hands but it fails,
                                 and you chop of both of its arms, leaving it defenseless, then you plunge your sword deep in its heart. +2 luck''')

                        luck +2
    elif choice_in_battle == "killself" or choice_in_battle == "KillSelf" or choice_in_battle == "kill self" or choice_in_battle == "Kill Self":
        print("You take out your sword and aim it at your head, you cant take the stress of saving the world, so you plunge your sword in your head.")
        quit()

    elif choice_in_battle == "stats" or choice_in_battle == "Stats":
        print(stats)

elif GuidersQuest == "f" or GuidersQuest == "F":
    print("I guess you don't want to do this then, no need for you to sit around now, well stay safe in the apocolypse.")
    print("Coward ending")
    quit()

start()

game()