Step by Step Installation of Python

Posted by SteamKnight on Wed 11 Nov 2009 09:03 PM — 30 posts, 123,164 views.

USA #0
Hi all,
I'd really appreciate a step by step tutorial on how to get Python up and running on MUSHclient. I've already installed it, but it seems like I can't get Python and MUSHclient to recognize each other. How can I get these two to "work in harmony?" Thanks for the help.
USA #1
Which distro of python did you dl? If It's the ActiveState one, it should Just Work.

If it's the official release from python.org, you'll need to run the axscript.py that's buried a bit down the install tree first.



I haven't touched it in years tho, so I'm sorry that I can't give you the step by step / full path to the axscript.py.
USA #2
WillFa said:

Which distro of python did you dl? If It's the ActiveState one, it should Just Work.

If it's the official release from python.org, you'll need to run the axscript.py that's buried a bit down the install tree first.



I haven't touched it in years tho, so I'm sorry that I can't give you the step by step / full path to the axscript.py.


I downloaded Python 2.6.4 from the official website and installed it on my computer, but should I reinstall it to run the axscript.py? Or can I just hit the axscript.py now? And where do I run it from?

(God, I'm sorry for all the questions. I feel like an idiot for asking.)
USA #3
It can be a bit of a hassle to set up the other engines properly. Don't feel bad. :)
USA #4
Just double click the axscript.py (it's somewhere under \python2.6.4\lib...) and restart MC.
USA #5
Um, I'm looking at \Lib right now, and I'm not seeing a thing. Here's a link to my python26 file:

http://www.mediafire.com/?wyvmt0mwgin (copy and paste)

If someone would be able to tell me where to go, and what file to access from where, I'd be very happy.
Amended on Wed 11 Nov 2009 11:04 PM by SteamKnight
USA #6
Look, I apologize for making such a fuss about this, but it's either get the Achaean Python script into MUSHclient or shell out 30 bucks for zMUD (which every member of my guild seems to have and love)...and quite frankly, MUSHclient has worked for me for the several years that I've been using it. I'd hate to have to switch to something that I'm not sure will work properly.
USA #7
Reposting the url (copy and paste):

http://www.mediafire.com/file/wyvmt0mwgin/Python26.zip

I'd seriously appreciate someone just looking through the file and seeing what the heck I need to do, because, as I've been saying, I'm lost.
USA #8
Click Start.
Choose Run... (or press Win+R)

C:\python26\lib\site-package\win32comext\client\pyscript.py --register
(adjust path if you installed somewhere else. If you have errors, make sure the path hasn't changed since version 2.2 in 2002 when I did this)


Restart Mushclient.



If your guild has python installed to use the plugin, they could probably help you better.
USA #9
Okay, I checked the official Python website, and they recommended ActivePython for computers running Windows XP. I'm downloading it now, and I'll post if there's any progress.

EDIT: I'm including the URL to a version of ActivePython that has Win32All, which I believe WillFa was talking about before:

http://www.activestate.com/activepython/
Amended on Thu 12 Nov 2009 03:17 AM by SteamKnight
USA #10
Alrighty.
Things seem to be coming together a lot more smoothly than before...now if it could only just load the...

Rats.

Error number: -2147352567
Event: Execution of line 35 column 0
Description: Traceback (most recent call last):

File "<Script Block >", line 35, in <module>

__version__ = "-- Revision: 6.9c - %s$" % (string.upper(world.GetVariable("Name")))

File "C:\Python26\Lib\string.py", line 235, in upper

return s.upper()

AttributeError: 'NoneType' object has no attribute 'upper'

Line in error:

__version__ = "-- Revision: 6.9c - %s$" % (string.upper(world.GetVariable("Name")))
Called by: Immediate execution

I think the problem is that...well...darned if I know. I'm going to bed, so if somone could help me out that'd be awesome. I think I've got the client to say, "Dude! What a nice looking Python script you got there!", but there's a few compatibility problems.
Amended on Thu 12 Nov 2009 03:33 AM by SteamKnight
USA #11
Maybe you need to have a name (and perhaps later password?) set in the world auto-connect preferences?
It looks like it's trying to access a MUSHclient variable that it expects to find, but isn't able to.
Australia Forum Administrator #12
I think David is right, as usual. ;)

It looks like:


GetVariable("Name")


has returned a type of 'NoneType object', which is probably because the client variable "Name" does not exist. Then the script tries to convert that to upper case, which it can't do.

So it might be a case of reading the documentation for the plugin, maybe there are variables you need to set up.
USA #13
SteamKnight said:

Alrighty.
Things seem to be coming together a lot more smoothly than before...now if it could only just load the...

Rats.

Error number: -2147352567
Event: Execution of line 35 column 0
Description: Traceback (most recent call last):

File "<Script Block >", line 35, in <module>

__version__ = "-- Revision: 6.9c - %s$" % (string.upper(world.GetVariable("Name")))

File "C:\Python26\Lib\string.py", line 235, in upper

return s.upper()

AttributeError: 'NoneType' object has no attribute 'upper'

Line in error:

__version__ = "-- Revision: 6.9c - %s$" % (string.upper(world.GetVariable("Name")))
Called by: Immediate execution

I think the problem is that...well...darned if I know. I'm going to bed, so if somone could help me out that'd be awesome. I think I've got the client to say, "Dude! What a nice looking Python script you got there!", but there's a few compatibility problems.


Hi..It would appear you're using the Achaea/MUSH script of mine.

You would need to follow the instructions that come inside the ZIP file you downloaded. It will explain, in great detail, what you need to do in order to set the system up to function correctly.

IT includes at a minimum:
Where to DL Python at
How to Register Python
Where to DL Win32 python dll at
How to Register the above

Then goes on, to tell you :
'Run the racs_setup alias BEFORE CONNECTING TO ACHAEA'

The current error you're getting, is as Nick and David state: There is no 'name' variable in Mushclient, and so it returnes a NoneType error. By running the racs_setup alias, when you're NOT connected to the world, you will solve this issue as well as many others.


Try it first! Then post your results here.
USA #14
Okay, I think I've figured out that my MUSHclient only recognizes these DLLs: VBScript, JScript, and PHPScript. No damn idea why, and I'm getting really frustrated with the whole system in general. Rakon, your 'install' file has nothing on where to get Python or how to register it, so you might want to check your files again.

At this point, shelling out thirty bucks for Zmud, a program that most everyone on Iron Realms games seems to use, is starting to sound really good.
USA #15
So far, no one has been able to give me an answer that I can understand, and thanks to my learning disability this makes things a lot worse.

All I want is step by step instructions for how to get Rakon's script going, posted here, in their entirety. I don't know my way around computers, I don't get how to work with programming languages. All I want is an updated version of Hawthorne's Reflex system. That's all. And I want to see numbered instructions on this topic, in a format that I can see clearly and in a language that a programming "NOOB" can understand.

Amended on Thu 12 Nov 2009 06:11 PM by SteamKnight
Australia Forum Administrator #16
SteamKnight said:

Okay, I think I've figured out that my MUSHclient only recognizes these DLLs: VBScript, JScript, and PHPScript. No damn idea why, and I'm getting really frustrated with the whole system in general. Rakon, your 'install' file has nothing on where to get Python or how to register it, so you might want to check your files again.


SteamKnight, please try to stay calm. You *have* Python installed now. Your more recent error message was nothing to do with it not being installed, it is an error message *from Python* because you didn't follow the instructions that came with the plugin.

From the plugin author:

Rakon said:

Then goes on, to tell you :
'Run the racs_setup alias BEFORE CONNECTING TO ACHAEA'


Now that you have Python installed, you can now use the plugin. He is telling you to, before you connect to the MUD, type:


racs_setup


You are welcome to use zMUD if you think that will work better for you. I receive no payment from people using MUSHclient (apart from the occasional donation) and the support given on this web site by myself and other people is free.
Australia Forum Administrator #17
SteamKnight said:

Rakon, your 'install' file has nothing on where to get Python or how to register it, so you might want to check your files again.


However the install.txt file that came with the plugin *does* say:



	The next step is now the setup command. proceed to type into the command
	prompt, 'racs_setup'. Without the ''s. That will (should) start a GUI
	setup process to set the intial values of the system. IT will ask
	question's such as, your character's name, have focus, insomnia, a 
	tree tattoo...ect. These values (aside from name) CAN BE CHANGED in the 
	same manner later on. (By issuing the 'racs_setup' command). As well,
	in game factors may change these settings, such as getting a tree tattoo
	inked, and typing tattoos to register it. The system would (should)
	then enable the tree curing teirs.


As he says there, it sets up "your character's name" - as we have been trying to explain, your most recent error message was that the name variable was not set up. Did you not read those posts?
USA #18
SteamKnight said:

At this point, shelling out thirty bucks for Zmud, a program that most everyone on Iron Realms games seems to use, is starting to sound really good.


Just felt like chiming in: I, along with most (if not all) members of the 'MUSHclient Users' clan in Achaea, use MUSHclient, and I believe many Lusternian players also heavily use it (at least based off of its tech support forum). MUSHclient is a very powerful client, but it can take a little effort to make things work as you want them to. But the fact remains that you can make them work. Many other clients have no such options; relevant to this discussion, most force you to use their own proprietary language.

Be patient and try to work with us instead of against us, and things will work out.
Amended on Thu 12 Nov 2009 08:21 PM by Twisol
USA #19
Okay, fine. It's just that whole 'before connecting' that has me confused. How do I get a command prompt open without opening a connection to a world?
I'm sorry for getting upset, but I've never done any of this technical stuff with my computer before. Heck, I tried to learn how to write programs on my TI-83 calculator and failed miserably - yes, it's that bad.
Australia Forum Administrator #20
In MUSHclient, uncheck the menu Connection -> Auto Connect.

Then when you open the world you can play with it, not connected to the MUD (eg. do the alias you need to to).

It's not really a command prompt, it is typing an alias in, which you can do unconnected. If the alias tries to send to the MUD, it will offer to connect you, but this one doesn't, I gather.

Then when you are done hit <enter> and it will say you aren't connected and offer to connect you.
Amended on Thu 12 Nov 2009 09:03 PM by Nick Gammon
USA #21
I think we're getting closer.

Another error message...this one said there was a problem loading the scripting engine.
Australia Forum Administrator #22
Please paste the message, don't just paraphrase it.
USA #23
Error number: -2147221164
Event: loading scripting engine
Description: Error -2147221164 occurred when loading scripting engine:



Class not registered


Called by:
Australia Forum Administrator #24
Hmmm.

OK, to try to reproduce this I installed Python, and then followed the instructions to make Python the scripting engine, and use the Achaea.pys file my script file.

Now, before connecting, and without doing anything else, I got this message:


Script error
World: Achaea test
Execution of line 35 column 0
Immediate execution
Traceback (most recent call last):
  File "<Script Block >", line 35, in <module>
    __version__ = "-- Revision: 6.9c - %s$" % (string.upper(world.GetVariable("Name")))
  File "C:\Python25\Lib\string.py", line 233, in upper
    return s.upper()
AttributeError: 'NoneType' object has no attribute 'upper'

Line in error: 
__version__ = "-- Revision: 6.9c - %s$" % (string.upper(world.GetVariable("Name")))
Error context in script:
  31 : 
  32 : 
  33 : __author__ = "Chris Williams - Rakon - <rakon@penguincoder.com"
  34 : __date__ = "08 DEC 2008"
  35*: __version__ = "-- Revision: 6.9c - %s$" % (string.upper(world.GetVariable("Name")))
  36 : __meditversion__ = " - Ver 4.9 "
  37 : 
  38 : 
  39 : 


Since the script didn't compile, I can't enter racs_setup.

A bit more investigation reveals that you need to do more than install the script.

Perhaps Rakon can explain better than me, since he wrote it, but it seems that the very least you need to do is:

  • Install ActivePython. I did this by finding a previous download called "ActivePython-2.5.2.2-win32-x86.msi". Double-clicking that and accepting the defaults seemed to get Python installed OK.
  • In the Achaea.zip file there is a file Achaea.mcl (a MUSHclient world file). YOU MUST USE THIS. This has all the aliases in it that implements the Achaea features. In other words, open this file from MUSHclient (or double-click it).
  • You will probably get an error message because it is configured to use this file as the script file:

    
    "Z:\home\chris\Documents\IPOD\Files\MEDIT\Achaea.pys"
    


    Now it is unlikely you will have those exact directories, so it won't find the script.
  • You need to go into the Script configuration tab, click External Script File -> Browse and find the file Achaea.pys that was in the Achaea.zip file you downloaded.
  • Reload the script file (Game menu -> Reload Script File).
  • You should now see this:

    
    ---- RACS(Rakons Achaean Combat System)   ----
    
    ---- Revision: 6.9c - $                   ----
    
    ---- SCRIPT COMPILED SUCCESFULLY          ----
    


    Now type into the command window "racs_setup" - this initiates the questions needed to configure the script for your character etc.
  • I didn't get any further than this, but this should help.
Amended on Sat 23 Jan 2010 03:26 AM by Nick Gammon
USA #25
Nick, I've done it.

I've actually got the darned script running perfectly :)

Thanks for everyone's help over the past couple days!

And Rakon, I'd be happy to work with you on a version for Aetolia.
USA #26
Nick,
You have been extremely helpful in this matter and with any questions of MUSH in general. I for one, thank you for such great support!

Twisol,
I agree. I might not post here often, albeit that's because of my own lack of time and generally forgetting about the forums here sometimes! However, the community here and within various MUD's clans/guilds is great! Even better is that MUSH client is offered as FREE, and open source software. (I still bought MUSH back when it had the die roll start up, cause I hated that screen! :P)

Steamknight:
As stated above, I don't get on these forums a lot and so it takes time for me to respond to YOUR questions.
You're right, the INSTALL file doesn't say where to get Python, I assumed too much I suppose. IT has been entered in there now. Also, please refrain from throwing insults when things do not go exactly as planned. In my orignal post for this system, I DID say :

NOTE2: The system is complex, and created with myself in mind.

---------

Due to the complexities you received in setting this system up, I have made a few changes to the PYS file to explicitly not expect a name variable. I have also changed and updated the INSTALL file with the following modifications:

Quote:

To begin with, you will need to download and install ActivePython, as well as registering the Python WSH dll. To download Python for windows, go to
https://www.activestate.com/activepython/downloads/
and download the appropiate version of Python for your computer.

If you are on a x64 bit computer, you will also need to install the pywin32 libriaries found at:

http://sourceforge.net/projects/pywin32/files/


After the installation is complete, you need to REGISTER the python scripting DLL. Note, this should be done automaticcly for i386(32 bit) systems, but x64 users will need to manually register them. Open a command terminal (START>RUN> type, cmd) and change directory to the following : C:\Python26\Lib\site-packages\win32comext\axscript\client\


Once in that directory, then issue the command:
python pyscript.py

Which will complete the registration of the DLL for you.

Now, you should be able to open MUSHclient, and the Achaea.mcl world file without incidents!


* * THIS NEXT STEP IS VERY IMPORTANT FOR THE PROPER RUNNING OF THE SYSTEM * *


Go to the menu FILE>GLOBAL PREFERENCES. UNCHECK THE BOX of 'Auto connect at world start'. Click on the timers tab, and change the number in the scrollbox to 0 (zero).


Also, I removed the very large map from the ZIP file, and now include it as a seperate file.

Nick, if you could please update the Achaea.zip file with the one I just made changes to, I would greatly appreciate it, as it would help prevent this type of issue in the future.


The system is at:http://penguincoder.com/Achaea.zip
The map is at:http://penguincoder.com/Map.zip

Thank you.


Amended on Fri 13 Nov 2009 08:31 PM by Rakon
Australia Forum Administrator #27
OK, those two files are now at:

http://www.gammon.com.au/mushclient/plugins/Achaea.zip (143 Kb)
http://www.gammon.com.au/mushclient/plugins/Map.zip (510 Kb)
#28
Yeah, I'm having the name error too, I can't seem to fix it at all, installed python, and set it to read the script. Can't use racs_setup because it keeps giving me the name error and won't compile the script
USA #29
Okay, I found a slight typo with the uploaded version that was still causing the name error to pop up.

This error has been fixed now, and can be downloaded at :
http://penguincoder.com/Achaea.zip

Thank you.