Project

Profile

Help

Bug #109

Problem with # in sharp scripts

Added by Moritz Wolfart over 1 year ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Category:
Customization
Sprint/Milestone:
% Done:

100%

Company:
-
Contact person:
-
Additional contact persons:
-

Description

Hi!
Somehow i cant use sharp scripts. It think the Cocomud don't accept the #-symbol for the process cause the mud sending me messages as it would be a command.
Do i have to activate the sharp script somewhere in a configuration? Or is it another problem with the language configuration?
Or are there two different keys for the #-symbol and i am only using the wrong symbol?

History

#1 Updated by Vincent Le Goff over 1 year ago

  • Tracker changed from Feature to Bug
  • Status changed from Open to Feedback
  • Assignee set to Vincent Le Goff

SharpScript uses the # symbol as its beginning, to indicate what follows is a SharpScript instruction. You can bypass this behavior by entering two symbols ##. This will be ignored by the SharpScript engine and will allow a simple # symbol. Using symbols in triggers shouldn't confuse the engine, however, except if the # symbol is at the beginning of the line (which is possible, but not likely). Could you provide more context on when the situation occurs? It's not impossible something is wrong with the engine at all, of course!

Thank you,

#2 Updated by Moritz Wolfart over 1 year ago

HMM, the only thing i can say is, that it occurs whenever i enter it.
I tried it after i entered a world and the Mud treated it like it would be a normal command for the mud.
i copied the example-line for the easy north macro.

#macro F1 north

#3 Updated by Vincent Le Goff over 1 year ago

Ho, that is correct! SharpScript isn't accessible through the input field anymore. Users complained it interfered with their commands to send to the MUD, and it seemed logical. I will offer a quick toggle checkbox to decide to use SharpScript in the input field, or to send it anyway to the MUD server. The documentation should be updated, indeed.

In the meantime, to create macros, I'm afraid you will have to go through the interface. But it shouldn't be too complicated, just not as time-effective.

#4 Updated by Vincent Le Goff over 1 year ago

  • Sprint/Milestone set to 15

#5 Updated by Vincent Le Goff over 1 year ago

  • Sprint/Milestone deleted (15)

#6 Updated by Vincent Le Goff 8 months ago

  • Sprint/Milestone set to 16

#7 Updated by Francisco Del Roio 5 months ago

Hello,

I was investigating this with a breakpoint put in line 254 of client.py and I found that if you execute self.factory.sharp_engine.client == self it returns False, indicating that the sharp engine sends all commands to the incorrect client, not only macros but aliases too.

I will take a look to sharp engine and see if I can solve this.

Cheers,

#8 Updated by Vincent Le Goff 5 months ago

This might be tied to #136 more, as a matter of fact. Since in most cases SharpScript is executed from the client itself, I guess I didn't properly check the bound client was correctly tied. If you look at the logs, they should indicate that, on opening a world and connecting, a client is created, then a sharp engine with a specific ID. This sharp engine should be unique for each client. So that's probably where it goes haywire.

#9 Updated by Francisco Del Roio 5 months ago

HMMM ... I made a big mistake.

I was confused, the comment is for #136...

Sorry...

#10 Updated by Vincent Le Goff 5 months ago

No problem at all! That's the price to pay for having a lot of issues in CocomUD!

#11 Updated by Vincent Le Goff 5 months ago

  • Category set to Customization
  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

Hi Moritz,

It has been some time! We're going to offer an alternative (in beta) for the next version. Instead of writing SharpScript directly in the input window (which created problems for other users), I created a SharpScript console, identical to the Python console. Basically you open it and can type the SharpScript examples that were given in the documentation. The documentation itself will be updated. For now, this feature isn't stable yet and we'll need feedback from users to know how good it is, but I believe this would make configuration much easier. The SharpScript console is actually able to handle multi-line triggers, if you want to type in Python code for instance.

This was introduced in Feature #138: Add a SharpScript editor in the menu bar. It will be accessible in a few days with the next version of CocoMUD.

Please register to edit this issue

Also available in: Atom PDF Tracking page