|
Post by heimerdawg on Jun 25, 2017 9:12:10 GMT -6
I set up /lpy and I am able to connect but I am getting an error when I do mc.postToChat("Test"). Here is the error: Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
mc.postToChat("Test")
AttributeError: 'function' object has no attribute 'postToChat'
And this is the full script: >>> from mc import *
>>> mc = Minecraft.create
>>> mc.postToChat("Test")
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
mc.postToChat("Test")
AttributeError: 'function' object has no attribute 'postToChat'
>>>
How do I fix it?
|
|
|
Post by heimerdawg on Jun 25, 2017 9:14:41 GMT -6
I am also getting an error on every thing else. Inset from mc import * and mc = Minecraft.create().
|
|
|
Post by spohnz on Jun 25, 2017 9:30:55 GMT -6
I am not sure what you mean by inset. Does /lpy helloworld work for you?
|
|
|
Post by heimerdawg on Jun 25, 2017 9:46:01 GMT -6
I mean incept. Yes, /lpy helloword works.
|
|
|
Post by spohnz on Jun 26, 2017 21:08:42 GMT -6
Okay I see that you are using the shell to 'push' the connection... ./lpy means you are 'pulling' the script. Write a postToChat in a script and pull it while you are on the server.
OR
with your mc=Minecraft.create() You need to add our server IP address in the arguments (parenthesis) in quotes.
|
|
|
Post by heimerdawg on Jun 30, 2017 10:04:31 GMT -6
Ok, I will try adding the address.
|
|
|
Post by spohnz on Jun 30, 2017 10:32:32 GMT -6
Also,,, If you are doing it from the minecraft for Python shell, make sure you are in the correct directory. .minecraft/mcpipy If you do not know how to get there in a python shell I can show you with a quick video and an import of the os module. remember that if you are in the shell you will need to import mine
|
|
|
Post by heimerdawg on Jun 30, 2017 16:32:20 GMT -6
Ok. I was doing it from the shell.
|
|
|
Post by heimerdawg on Jun 30, 2017 16:40:05 GMT -6
It worked. Thank you. I did: >>> from mc import * >>> mc = Minecraft.create("***.***.*.*") This time and it worked.
|
|
|
Post by spohnz on Jun 30, 2017 16:41:37 GMT -6
It is not ok to post the ip address. But I am happy you got it. Yes we need to 'point' the connection to the server if we are working in the shell and pushing scripts to the server. That is how I run the notifications and Kate from my raspberry pi.
|
|
|
Post by heimerdawg on Jun 30, 2017 16:58:48 GMT -6
Sorry, I wont post it anymore.
|
|
|
Post by spohnz on Jun 30, 2017 17:14:35 GMT -6
I think it was worth making a sticky thread for it. No worries.
|
|
thepifanatic
New Member
pi is awsome people have calculated it past 1 million digits
Posts: 41
|
Post by thepifanatic on Jul 11, 2017 17:36:16 GMT -6
hi i was trying to make a monoply like board game with turtle thats why i asked about the background. So i have a chunk of code that acts as a virtual die depending on the roll it has a for loop that moves the turtle/player. with each iteration through the loop it checks your turtles position to see if it needs to go up or down instead of straight like normal but it keeps ignoring the position checking and continuing with the loop. here is some shortened code.
|
|
thepifanatic
New Member
pi is awsome people have calculated it past 1 million digits
Posts: 41
|
Post by thepifanatic on Jul 11, 2017 17:37:11 GMT -6
sorry it indented when i copied and pasted the indentations aren't there sorry.
|
|
|
Post by spohnz on Jul 11, 2017 17:53:54 GMT -6
Edit it and click the code button at the top. Then paste it in. I've made the same mistake. But without seeing your indention I can't tell if you are all correct.
|
|