Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sat Jan 31, 2009 5:23 am   

Can you fix LUA integration please
 
I'm not sure what the problem is but I can't seem to get anything to work correctly.

For example, sendraw doesn't even work. I typed #lua {sendraw("def")} and it did absolutely nothing.

Then I type #lua {send("def")} and it gave me a response like I typed garbage. So I then typed def and it worked.


3500h, 3850m exdb-def

Clarification is in order.
3500h, 3850m exdb-def

You are blind.
You are deaf.
You have accepted a blessing for aid in times of need.
You are walking with the grace of the stars.
You are protected by 4 defences.
3500h, 3850m xdb-


Then weird stuff started happening...

qq

Your meaning eludes me.
3500h, 3850m exdb-look

Could you be a bit clearer?
3500h, 3850m exdb-chin

You look about yourself, rubbing your chin thoughtfully.
3500h, 3850m exdb-look

You are blind and can see nothing but darkness.
3500h, 3850m exdb-look

Come again?
3500h, 3850m exdb-look

Where do you want to apply the salve? You may spread it on your head, your arms, your legs, or your body.
3500h, 3850m exdb-chin

You look about yourself, rubbing your chin thoughtfully.


.....

What the hell is that? It seems ever since I tried to use LUA nothing works right.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Jan 31, 2009 1:47 pm   
 
I hope you understand my frustration with these problems you're having - essentially this thread says "it doesn't work", and when I try these things myself, they work fine. The send() example you gave in particular is working fine.

Sendraw() does have a problem - it seems it's afflicted with an old bug of zScript's, where it isn't appended with the CRLF needed for the server to execute the command. That's why it's giving a result like you typed garbage - the server gets two packets: def and then when you enter your next command, somethingelse<CRLF>. It now tries to execute "defsomethingelse", which isn't a command and thus gives you an error. To avoid this, simply add .. "\n" to the end of any sendraw()s your're doing until this is fixed.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sun Feb 01, 2009 3:32 am   
 
Well I am not trying to frustrate anyone, but am becoming frustrated myself. :-)

Send() also doesn't work to fire oninput triggers from buttons and other avenues. I'm wondering if it is related?

Using aliases with Lua code in them causes problems and caused me to switch to oninput anyway and then I ran into the send() problem.

I'm not saying it "all" doesn't work. I am saying enough of it doesn't work to prohibit me from fully integrating it. You know how to work around all of this stuff because I suppose you are helping implement it? Please put yourself in other's shoes who try and read what little help files there are and then the scripts do not work when you try them. I sat there for 5 minutes online logged into the server trying to understand why absolutely nothing was happening since I can't see sendraw and it doesn't show anything on debug.

As far as print() goes, that is fine to say there are people who want to test their triggers with it, but that seems backwards doesn't it? Since you are rarely going to be testing other triggers from your scripts themselves, shouldn't people who want to test triggers have to type the extra characters and not the other way around? I suppose I could just remap it in my code to do zs.print(). No big deal.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Feb 01, 2009 6:57 am   
 
oldguy2 wrote:
You know how to work around all of this stuff because I suppose you are helping implement it?

Actually, no - the only advantage Gurus have is that they read a few dozen threads every day, and occasionally remember some of them. The sendraw() problem I remembered from when #sendraw had the same issue.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net