This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#201 2012-10-13 16:31:35

zippynk
Scratcher
Registered: 2011-07-23
Posts: 500+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

I thought it was to revert to the last revision before the problems started.

Now that we know that didn't work, though, reverting to 2.0 until the problem is fixed seems like the best solution for now.

However, if Magnie doesn't want to revert, or doesn't have the time, they get the final decision.


edit: page 9

Last edited by zippynk (2012-10-13 16:32:09)


https://dl.dropbox.com/u/60598636/trifocal_interlude_soundcloud_button.png

Offline

 

#202 2012-10-13 17:51:47

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

ohaiderstudios wrote:

Magnie wrote:

ohaiderstudios wrote:

Chat.PY doesn't seem so "reverted" to me...

No idea what's going on. But with greenlet's timeout features, client commands will be resilient hopefully.

I thought the plan was to revert to 2.0?

If not, sorry for the accusation, but nothing's fixed.

Oh. I thought you meant an older version of 3.0... Eh. I don't know.  hmm

I think I'm just going to leave the server as it is and then look into the problem when I have time. Don't expect any results anytime soon.

Offline

 

#203 2012-10-13 18:05:19

ohaiderstudios
Scratcher
Registered: 2010-10-31
Posts: 100+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

Well then, I guess zippynk will have to pull out his Anarchy chat server... tongue


Fork Clamor on GitHub!

Offline

 

#204 2012-10-13 20:41:03

zippynk
Scratcher
Registered: 2011-07-23
Posts: 500+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

ohaiderstudios wrote:

Well then, I guess zippynk will have to pull out his Anarchy chat server... tongue

Nope, my parents won't let me port forward anymore.


https://dl.dropbox.com/u/60598636/trifocal_interlude_soundcloud_button.png

Offline

 

#205 2012-10-13 22:48:33

ohaiderstudios
Scratcher
Registered: 2010-10-31
Posts: 100+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

zippynk wrote:

ohaiderstudios wrote:

Well then, I guess zippynk will have to pull out his Anarchy chat server... tongue

Nope, my parents won't let me port forward anymore.

Oh well  hmm

Last edited by ohaiderstudios (2012-10-13 22:48:48)


Fork Clamor on GitHub!

Offline

 

#206 2012-10-14 14:45:52

playzooki
Scratcher
Registered: 2012-02-07
Posts: 100+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

Yeah, its either gonna be 2.0, 3.1 or 4.0


I iz a sig. So there. CLICK ME ITS SO IMPORTANT!!!!

Offline

 

#207 2012-10-15 11:56:06

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

Someone interested in making a parser with regex for me? It needs to support these sorts of formats:

Code:

broadcast "broadcast" "broadcast2" ...
broadcast "broadcast"
sensor-update "test" 1 "test2" "test" ...
sensor-update "test" "test"
sensor-update "test" 1

... = repeated "indefinitely"

And then have it output it to something like this:

Code:

{'sensor-update' : {'sensor_name' : 'sensor value in string', 'sensor2' : 'value2'}, ['broadcast1', 'broadcast2']

Offline

 

#208 2012-10-15 13:22:24

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

Code:

r'broadcast ((\".*?\)*)"'
r'broadcast \"(.*?)\"'

for begin

how i hate regex...  hmm

Offline

 

#209 2012-10-15 13:41:53

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

Magnie wrote:

Someone interested in making a parser with regex for me? ...

Don't scratchpy or Scratra have a good one?

And does it *have* to be regex?  tongue

Last edited by blob8108 (2012-10-15 13:42:11)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#210 2012-10-15 13:51:54

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

what about

Code:

message = "broadcast foo,baz"
if message.startswith('broadcast'):
    message = message[len(broadcast) + 1:]
    values = message.split(',')

Offline

 

#211 2012-10-15 14:36:22

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

blob8108 wrote:

Magnie wrote:

Someone interested in making a parser with regex for me? ...

Don't scratchpy or Scratra have a good one?

For some reason scratchpy's doesn't always work. Scratra's is even harder to read than scratchpy's.  tongue

And does it *have* to be regex?  tongue

It doesn't. I personally hate regex, which is why I'm asking someone else to write it.  tongue

If you can write it in a readable form with something else (must use a built-in Python module, or custom coded), then I will gladly accept it.  smile

roijac: I'll accept anything if I can look at it and understand it, and it works.  smile

Offline

 

#212 2012-10-15 15:12:10

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

Here's my attempt.

Last edited by blob8108 (2012-10-15 15:12:30)


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#213 2012-10-15 15:41:15

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

blob8108 wrote:

Here's my attempt.

Sweet. It doesn't seem to support double-quotes (") within the broadcast values or sensor-update values (this is important for chat programs, since it's common for people to type double-quotes and stuff) though.  hmm

Offline

 

#214 2012-10-15 16:12:41

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

Magnie wrote:

blob8108 wrote:

Here's my attempt.

Sweet. It doesn't seem to support double-quotes (") within the broadcast values or sensor-update values (this is important for chat programs, since it's common for people to type double-quotes and stuff) though.  hmm

Ah, you forgot to mention those  tongue  remind me how they work again — does:

    hi, so-called "emperor"...

come out as

    broadcast "hi, so-called ""emperor""..."

ie, double quotes " are escaped as double double quotes ""?


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#215 2012-10-15 16:20:01

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

blob8108 wrote:

Magnie wrote:

blob8108 wrote:

Here's my attempt.

Sweet. It doesn't seem to support double-quotes (") within the broadcast values or sensor-update values (this is important for chat programs, since it's common for people to type double-quotes and stuff) though.  hmm

Ah, you forgot to mention those  tongue  remind me how they work again — does:

    hi, so-called "emperor"...

come out as

    broadcast "hi, so-called ""emperor""..."

ie, double quotes " are escaped as double double quotes ""?

I don't remember. I've always thought it was:

    broadcast "hi, so-called "emperor"..."

Offline

 

#216 2012-10-15 17:00:37

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

Magnie wrote:

blob8108 wrote:

Magnie wrote:


Sweet. It doesn't seem to support double-quotes (") within the broadcast values or sensor-update values (this is important for chat programs, since it's common for people to type double-quotes and stuff) though.  hmm

Ah, you forgot to mention those  tongue  remind me how they work again — does:

    hi, so-called "emperor"...

come out as

    broadcast "hi, so-called ""emperor""..."

ie, double quotes " are escaped as double double quotes ""?

I don't remember. I've always thought it was:

    broadcast "hi, so-called "emperor"..."

Could you check for me? Because what you just described surely can't work...


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#217 2012-10-15 18:21:49

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

Yes, it doubles quotes.


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#218 2012-10-15 19:12:57

laser314
Scratcher
Registered: 2010-07-16
Posts: 100+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

Bit art is broken.


http://alpha.scratch.mit.edu/scratchr2/static//images/logo_sm.png 2.0 Alpha Tester!http://i49.tinypic.com/1zckcqb.png

Offline

 

#219 2012-10-15 22:38:47

ohaiderstudios
Scratcher
Registered: 2010-10-31
Posts: 100+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

Hey Magnie...do you still have any desire to continue with the MUD idea? I'm working on a  generic (yes, completely object oriented) generic MUD platform in Python.

What I'm thinking about for the classes are:
Room()
Enemy()
Item()
Dungeon()
With Dungeon being the parent class that stores and manipulates the rooms, inventory, battles, etc.

If you're interested in collaborating, I'd love to work with you on this.

So far I only have a rough room class.


Fork Clamor on GitHub!

Offline

 

#220 2012-10-15 23:03:42

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

ohaiderstudios wrote:

Hey Magnie...do you still have any desire to continue with the MUD idea? I'm working on a  generic (yes, completely object oriented) generic MUD platform in Python.

What I'm thinking about for the classes are:
Room()
Enemy()
Item()
Dungeon()
With Dungeon being the parent class that stores and manipulates the rooms, inventory, battles, etc.

If you're interested in collaborating, I'd love to work with you on this.

So far I only have a rough room class.

Sure, after I've fixed LSTC.  tongue

Offline

 

#221 2012-10-15 23:43:18

ohaiderstudios
Scratcher
Registered: 2010-10-31
Posts: 100+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

Magnie wrote:

ohaiderstudios wrote:

Hey Magnie...do you still have any desire to continue with the MUD idea? I'm working on a  generic (yes, completely object oriented) generic MUD platform in Python.

What I'm thinking about for the classes are:
Room()
Enemy()
Item()
Dungeon()
With Dungeon being the parent class that stores and manipulates the rooms, inventory, battles, etc.

If you're interested in collaborating, I'd love to work with you on this.

So far I only have a rough room class.

Sure, after I've fixed LSTC.  tongue

Cool.

I'm having trouble structuring the 'Item' class. Not sure how to store and evaluate the effect an item has, if you know what I mean.


Fork Clamor on GitHub!

Offline

 

#222 2012-10-15 23:56:20

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

ohaiderstudios wrote:

Magnie wrote:

ohaiderstudios wrote:

Hey Magnie...do you still have any desire to continue with the MUD idea? I'm working on a  generic (yes, completely object oriented) generic MUD platform in Python.

What I'm thinking about for the classes are:
Room()
Enemy()
Item()
Dungeon()
With Dungeon being the parent class that stores and manipulates the rooms, inventory, battles, etc.

If you're interested in collaborating, I'd love to work with you on this.

So far I only have a rough room class.

Sure, after I've fixed LSTC.  tongue

Cool.

I'm having trouble structuring the 'Item' class. Not sure how to store and evaluate the effect an item has, if you know what I mean.

You know, decorators might have some use in this:

Code:

@item
def magic_sword(self, damage_modifiers):
    base_damage = 10
    return base_damage - damage_modifiers

Though I have very little knowledge on how to use them. I just saw the above method used in M30W.  tongue

Offline

 

#223 2012-10-16 00:00:07

ohaiderstudios
Scratcher
Registered: 2010-10-31
Posts: 100+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

Magnie wrote:

ohaiderstudios wrote:

Magnie wrote:

Sure, after I've fixed LSTC.  tongue

Cool.

I'm having trouble structuring the 'Item' class. Not sure how to store and evaluate the effect an item has, if you know what I mean.

You know, decorators might have some use in this:

Code:

@item
def magic_sword(self, damage_modifiers):
    base_damage = 10
    return base_damage - damage_modifiers

Though I have very little knowledge on how to use them. I just saw the above method used in M30W.  tongue

First you want to use classes, now operators?????

What's next, functions?

I was hoping for something like:

Code:

Dungeon().add_item('Magic Sword', 'some statement that could be "exec"-ed')

Last edited by ohaiderstudios (2012-10-16 00:04:29)


Fork Clamor on GitHub!

Offline

 

#224 2012-10-16 00:11:04

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

ohaiderstudios wrote:

Magnie wrote:

ohaiderstudios wrote:


Cool.

I'm having trouble structuring the 'Item' class. Not sure how to store and evaluate the effect an item has, if you know what I mean.

You know, decorators might have some use in this:

Code:

@item
def magic_sword(self, damage_modifiers):
    base_damage = 10
    return base_damage - damage_modifiers

Though I have very little knowledge on how to use them. I just saw the above method used in M30W.  tongue

First you want to use classes, now operators?????

What's next, functions?

I was hoping for something like:

Code:

Dungeon().add_item('Magic Sword', 'some statement that could be "exec"-ed')

Sure. That works I guess.

Offline

 

#225 2012-10-16 00:14:12

ohaiderstudios
Scratcher
Registered: 2010-10-31
Posts: 100+

Re: Little Server That Can (Chat.PY, Bit Art, etc.)

Magnie wrote:

ohaiderstudios wrote:

Magnie wrote:

You know, decorators might have some use in this:

Code:

@item
def magic_sword(self, damage_modifiers):
    base_damage = 10
    return base_damage - damage_modifiers

Though I have very little knowledge on how to use them. I just saw the above method used in M30W.  tongue

First you want to use classes, now operators?????

What's next, functions?

I was hoping for something like:

Code:

Dungeon().add_item('Magic Sword', 'some statement that could be "exec"-ed')

Sure. That works I guess.

tongue ...

how about an additional 'type' argument that specifies consumable/weapon/armor/misc?
This would make classification easier.
A weapon's code would look like:

Code:

Dungeon().add_item('Magic Sword', 10, 'weapon')

with 10 being the attack bonus
A potion's code would look like this:

Code:

Dungeon().add_item('Potion', 'self.hp += 10', 'consumable')

Not sure about misc, but my generic platform will have an automatic item called 'Key,' which can unlock one lock. Doors have a 'lock' value ranging from 0 to however many locks are on the door. When you attempt to exit, you are prompted with a message saying, 'This exit has x locks. Would you like to open it with x keys?'

So basically, misc items cannot be used, their presence is checked by the computer to accomplish arbitrary tasks.

MUD wrote:

The Werewolf (Level 2) avoids you because you have a Level 3 Garlic Amulet.

Last edited by ohaiderstudios (2012-10-16 00:23:51)


Fork Clamor on GitHub!

Offline

 

Board footer