barneygale / quarry

Python library that implements the Minecraft network protocol and data types
Other
534 stars 74 forks source link

How do i get "quarry" to run (E:\quarry-master\examples\proxy_hide_chat.py) #199

Closed meldahl closed 3 months ago

meldahl commented 1 year ago

The OOP languages i know are c++ javascript and recently ive been trying to learn python and i get the basics of it when it comes to the code. But i have literally no clue what "pip" and all these command prompt commands are, and i also dont quite get how to actually run the examples in quarry.

What im basically asking is how do i get quarry to run the code that i am making in my own files. are there no tutorials on the internet or something for this because im quite confused on this, and ive tried searching but i cant find any, there are no manuals ive found either...

so please link me a manual or a tutorial video or anything that lets me understand how quarry works.

Obviously i have no experience in this, so i any help is appreciated.

meldahl commented 1 year ago

Some additional context: when i run proxy_hide_chat.py literally nothing happens, it just opens a cmd window and displays nothing.... no error no feedback what so ever, thats why i am so confused on what i am supposed to do...

TechDudie commented 1 year ago

The code you need to understand is the last bit.

import sys
main(sys.argv[1:])

These last two lines basically take the program arguments, the stuff passed to the program after python proxy_hide_chat.py.

‘main’ is a function, and in the declaration, it says:

def main(argv):
    # Parse options
    import argparse
    parser = argparse.ArgumentParser()
    parser.add_argument("-a", "--listen-host", default="", help="address to listen on")
    parser.add_argument("-p", "--listen-port", default=25565, type=int, help="port to listen on")
    parser.add_argument("-b", "--connect-host", default="127.0.0.1", help="address to connect to")
    parser.add_argument("-q", "--connect-port", default=25565, type=int, help="port to connect to")
    args = parser.parse_args(argv)
    …

The function is accepting the arguments passed to the program after python and the file name. Here, the four lines provide options, along with a description. The command to run the script should look something like:

python3 proxy_hide_chat.py —listen-host localhost —listen-port 25565 —connect-host mc.hypixel.net —connect-port 25565

Note that MSA doesn’t appear to be supported, you have to use a mojang account or look at https://github.com/barneygale/quarry/issues/135

Hope this helped! :grin: